| File: | codegen/balaccodebasemodule.c |
| Warning: | line 24508, column 2 Value stored to 'self' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
| 1 | /* balaccodebasemodule.c generated by balac, the Bala compiler |
| 2 | * generated from balaccodebasemodule.bala, do not modify */ |
| 3 | |
| 4 | /* balaccodebasemodule.bala |
| 5 | * |
| 6 | * Copyright (C) 2006-2012 Jürg Billeter |
| 7 | * Copyright (C) 2006-2008 Raffaele Sandrini |
| 8 | * |
| 9 | * This library is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU Lesser General Public |
| 11 | * License as published by the Free Software Foundation; either |
| 12 | * version 2.1 of the License, or (at your option) any later version. |
| 13 | |
| 14 | * This library is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 | * Lesser General Public License for more details. |
| 18 | |
| 19 | * You should have received a copy of the GNU Lesser General Public |
| 20 | * License along with this library; if not, write to the Free Software |
| 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 22 | * |
| 23 | * Author: |
| 24 | * Jürg Billeter <j@bitron.ch> |
| 25 | * Raffaele Sandrini <raffaele@sandrini.ch> |
| 26 | */ |
| 27 | |
| 28 | #include "balacodegen.h" |
| 29 | #include <bala.h> |
| 30 | #include <balagee.h> |
| 31 | #include <glib-object.h> |
| 32 | #include <balaccode.h> |
| 33 | #include <glib.h> |
| 34 | #include <stdlib.h> |
| 35 | #include <string.h> |
| 36 | #include <stdio.h> |
| 37 | #include <glib/gstdio.h> |
| 38 | #include <float.h> |
| 39 | #include <math.h> |
| 40 | #include <gobject/gvaluecollector.h> |
| 41 | |
| 42 | #define _bala_code_context_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (bala_code_context_unref (var), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (bala_code_context_unref (var), NULL((void*)0)))) |
| 43 | #define _bala_code_node_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (bala_code_node_unref (var), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (bala_code_node_unref (var), NULL((void*)0)))) |
| 44 | #define _bala_ccode_base_module_emit_context_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (bala_ccode_base_module_emit_context_unref (var), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (bala_ccode_base_module_emit_context_unref (var), NULL((void*)0)))) |
| 45 | #define _bala_iterable_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (bala_iterable_unref (var), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (bala_iterable_unref (var), NULL((void*)0)))) |
| 46 | #define _bala_ccode_node_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (bala_ccode_node_unref (var), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (bala_ccode_node_unref (var), NULL((void*)0)))) |
| 47 | #define _bala_ccode_file_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (bala_ccode_file_unref (var), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (bala_ccode_file_unref (var), NULL((void*)0)))) |
| 48 | #define _bala_map_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (bala_map_unref (var ), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (bala_map_unref (var), NULL((void*)0)))) |
| 49 | #define _g_free0(var)(var = (g_free (var), ((void*)0))) (var = (g_free (var), NULL((void*)0))) |
| 50 | #define _bala_source_file_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (bala_source_file_unref (var), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (bala_source_file_unref (var), NULL((void*)0)))) |
| 51 | #define _fclose0(var)((var == ((void*)0)) ? ((void*)0) : (var = (fclose (var), ((void *)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (fclose (var), NULL((void*)0)))) |
| 52 | #define _bala_comment_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (bala_comment_unref (var), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (bala_comment_unref (var), NULL((void*)0)))) |
| 53 | #define _bala_ccode_declarator_suffix_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (bala_ccode_declarator_suffix_unref (var), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (bala_ccode_declarator_suffix_unref (var), NULL((void*)0)))) |
| 54 | #define _bala_target_value_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (bala_target_value_unref (var), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (bala_target_value_unref (var), NULL((void*)0)))) |
| 55 | #define _bala_iterator_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (bala_iterator_unref (var), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (bala_iterator_unref (var), NULL((void*)0)))) |
| 56 | #define _g_regex_unref0(var)((var == ((void*)0)) ? ((void*)0) : (var = (g_regex_unref (var ), ((void*)0)))) ((var == NULL((void*)0)) ? NULL((void*)0) : (var = (g_regex_unref (var), NULL((void*)0)))) |
| 57 | typedef struct _BalaCCodeBaseModuleParamSpecEmitContext BalaCCodeBaseModuleParamSpecEmitContext; |
| 58 | #define _bala_assert(expr, msg)if (expr) ; else g_assertion_message_expr ("bala-ccodegen", "balaccodebasemodule.c" , 58, ((const char*) (__func__)), msg); if G_LIKELY (expr)(expr) ; else g_assertion_message_expr (G_LOG_DOMAIN"bala-ccodegen", __FILE__"balaccodebasemodule.c", __LINE__58, G_STRFUNC((const char*) (__func__)), msg); |
| 59 | #define _bala_return_if_fail(expr, msg)if (expr) ; else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), msg); return; } if G_LIKELY (expr)(expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN"bala-ccodegen", G_STRFUNC((const char*) (__func__)), msg); return; } |
| 60 | #define _bala_return_val_if_fail(expr, msg, val)if (expr) ; else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), msg); return val; } if G_LIKELY (expr)(expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN"bala-ccodegen", G_STRFUNC((const char*) (__func__)), msg); return val; } |
| 61 | #define _bala_warn_if_fail(expr, msg)if (expr) ; else g_warn_message ("bala-ccodegen", "balaccodebasemodule.c" , 61, ((const char*) (__func__)), msg); if G_LIKELY (expr)(expr) ; else g_warn_message (G_LOG_DOMAIN"bala-ccodegen", __FILE__"balaccodebasemodule.c", __LINE__61, G_STRFUNC((const char*) (__func__)), msg); |
| 62 | |
| 63 | struct _BalaCCodeBaseModulePrivate { |
| 64 | BalaCodeContext* _context; |
| 65 | BalaList* emit_context_stack; |
| 66 | BalaList* line_directive_stack; |
| 67 | gint next_block_id; |
| 68 | BalaMap* block_map; |
| 69 | BalaMap* method_inner_error_var_count; |
| 70 | BalaDelegate* destroy_notify; |
| 71 | BalaClass* gerror; |
| 72 | BalaSet* generated_external_symbols; |
| 73 | gint next_variant_function_id; |
| 74 | }; |
| 75 | |
| 76 | struct _BalaCCodeBaseModuleParamSpecEmitContext { |
| 77 | GParamSpec parent_instance; |
| 78 | }; |
| 79 | |
| 80 | static gint BalaCCodeBaseModule_private_offset; |
| 81 | static gpointer bala_ccode_base_module_parent_class = NULL((void*)0); |
| 82 | BalaSet* bala_ccode_base_module_reserved_identifiers = NULL((void*)0); |
| 83 | gint bala_ccode_base_module_ccode_attribute_cache_index = 0; |
| 84 | static gpointer bala_ccode_base_module_emit_context_parent_class = NULL((void*)0); |
| 85 | |
| 86 | static void bala_ccode_base_module_real_emit (BalaCodeGenerator* base, |
| 87 | BalaCodeContext* context); |
| 88 | static void bala_ccode_base_module_real_append_bala_array_free (BalaCCodeBaseModule* self); |
| 89 | static void bala_ccode_base_module_real_append_bala_array_move (BalaCCodeBaseModule* self); |
| 90 | static void bala_ccode_base_module_real_append_bala_array_length (BalaCCodeBaseModule* self); |
| 91 | static void bala_ccode_base_module_real_append_params_array (BalaCCodeBaseModule* self, |
| 92 | BalaMethod* m); |
| 93 | static void bala_ccode_base_module_real_visit_source_file (BalaCodeVisitor* base, |
| 94 | BalaSourceFile* source_file); |
| 95 | static gboolean bala_ccode_base_module_real_generate_enum_declaration (BalaCCodeBaseModule* self, |
| 96 | BalaEnum* en, |
| 97 | BalaCCodeFile* decl_space); |
| 98 | static void bala_ccode_base_module_real_visit_enum (BalaCodeVisitor* base, |
| 99 | BalaEnum* en); |
| 100 | static void bala_ccode_base_module_constant_array_ranks_sizes (BalaInitializerList* initializer_list, |
| 101 | gint* sizes, |
| 102 | gint sizes_length1, |
| 103 | gint rank); |
| 104 | static BalaCCodeDeclaratorSuffix* bala_ccode_base_module_get_constant_declarator_suffix (BalaCCodeBaseModule* self, |
| 105 | BalaConstant* c); |
| 106 | static void bala_ccode_base_module_real_visit_constant (BalaCodeVisitor* base, |
| 107 | BalaConstant* c); |
| 108 | static void bala_ccode_base_module_real_visit_field (BalaCodeVisitor* base, |
| 109 | BalaField* f); |
| 110 | static void bala_ccode_base_module_real_visit_property (BalaCodeVisitor* base, |
| 111 | BalaProperty* prop); |
| 112 | static void bala_ccode_base_module_real_generate_class_struct_declaration (BalaCCodeBaseModule* self, |
| 113 | BalaClass* cl, |
| 114 | BalaCCodeFile* decl_space); |
| 115 | static void bala_ccode_base_module_real_generate_struct_declaration (BalaCCodeBaseModule* self, |
| 116 | BalaStruct* st, |
| 117 | BalaCCodeFile* decl_space); |
| 118 | static void bala_ccode_base_module_real_generate_delegate_declaration (BalaCCodeBaseModule* self, |
| 119 | BalaDelegate* d, |
| 120 | BalaCCodeFile* decl_space); |
| 121 | static void bala_ccode_base_module_real_generate_cparameters (BalaCCodeBaseModule* self, |
| 122 | BalaMethod* m, |
| 123 | BalaCCodeFile* decl_space, |
| 124 | BalaMap* cparam_map, |
| 125 | BalaCCodeFunction* func, |
| 126 | BalaCCodeFunctionDeclarator* vdeclarator, |
| 127 | BalaMap* carg_map, |
| 128 | BalaCCodeFunctionCall* vcall, |
| 129 | gint direction); |
| 130 | static void bala_ccode_base_module_real_visit_property_accessor (BalaCodeVisitor* base, |
| 131 | BalaPropertyAccessor* acc); |
| 132 | static void bala_ccode_base_module_create_property_type_check_statement (BalaCCodeBaseModule* self, |
| 133 | BalaProperty* prop, |
| 134 | gboolean check_return_type, |
| 135 | BalaTypeSymbol* t, |
| 136 | gboolean non_null, |
| 137 | const gchar* var_name); |
| 138 | static gchar* bala_ccode_base_module_generate_cmp_wrapper (BalaCCodeBaseModule* self, |
| 139 | BalaCCodeIdentifier* cmpid); |
| 140 | static gchar* bala_ccode_base_module_generate_struct_equal_function (BalaCCodeBaseModule* self, |
| 141 | BalaStruct* st); |
| 142 | static void bala_ccode_base_module_real_visit_destructor (BalaCodeVisitor* base, |
| 143 | BalaDestructor* d); |
| 144 | static void bala_ccode_base_module_capture_parameter (BalaCCodeBaseModule* self, |
| 145 | BalaParameter* param, |
| 146 | BalaCCodeStruct* data, |
| 147 | gint block_id); |
| 148 | static void bala_ccode_base_module_real_visit_block (BalaCodeVisitor* base, |
| 149 | BalaBlock* b); |
| 150 | static void bala_ccode_base_module_real_visit_declaration_statement (BalaCodeVisitor* base, |
| 151 | BalaDeclarationStatement* stmt); |
| 152 | static gboolean bala_ccode_base_module_is_foreach_element_variable (BalaLocalVariable* local); |
| 153 | static void bala_ccode_base_module_real_visit_local_variable (BalaCodeVisitor* base, |
| 154 | BalaLocalVariable* local); |
| 155 | static void bala_ccode_base_module_real_visit_initializer_list (BalaCodeVisitor* base, |
| 156 | BalaInitializerList* list); |
| 157 | static gboolean bala_ccode_base_module_is_in_generic_type (BalaCCodeBaseModule* self, |
| 158 | BalaGenericType* type); |
| 159 | static void bala_ccode_base_module_require_generic_accessors (BalaCCodeBaseModule* self, |
| 160 | BalaInterface* iface); |
| 161 | static BalaCCodeExpression* bala_ccode_base_module_real_get_dup_func_expression (BalaCCodeBaseModule* self, |
| 162 | BalaDataType* type, |
| 163 | BalaSourceReference* source_reference, |
| 164 | gboolean is_chainup); |
| 165 | static gchar* bala_ccode_base_module_generate_struct_dup_wrapper (BalaCCodeBaseModule* self, |
| 166 | BalaValueType* value_type); |
| 167 | static void bala_ccode_base_module_make_comparable_cexpression (BalaCCodeBaseModule* self, |
| 168 | BalaDataType* * left_type, |
| 169 | BalaCCodeExpression* * cleft, |
| 170 | BalaDataType* * right_type, |
| 171 | BalaCCodeExpression* * cright); |
| 172 | static gchar* bala_ccode_base_module_generate_numeric_equal_function (BalaCCodeBaseModule* self, |
| 173 | BalaTypeSymbol* sym); |
| 174 | static void bala_ccode_base_module_generate_struct_copy_function (BalaCCodeBaseModule* self, |
| 175 | BalaStruct* st); |
| 176 | static void bala_ccode_base_module_generate_struct_destroy_function (BalaCCodeBaseModule* self, |
| 177 | BalaStruct* st); |
| 178 | static gchar* bala_ccode_base_module_generate_collection_free_wrapper (BalaCCodeBaseModule* self, |
| 179 | BalaDataType* collection_type, |
| 180 | BalaCCodeIdentifier* element_destroy_func_expression); |
| 181 | static gchar* bala_ccode_base_module_real_append_struct_array_destroy (BalaCCodeBaseModule* self, |
| 182 | BalaStruct* st); |
| 183 | static gchar* bala_ccode_base_module_real_append_struct_array_free (BalaCCodeBaseModule* self, |
| 184 | BalaStruct* st); |
| 185 | static BalaCCodeExpression* bala_ccode_base_module_real_destroy_value (BalaCCodeBaseModule* self, |
| 186 | BalaTargetValue* value, |
| 187 | gboolean is_macro_definition); |
| 188 | static void bala_ccode_base_module_real_visit_end_full_expression (BalaCodeVisitor* base, |
| 189 | BalaExpression* expr); |
| 190 | static void bala_ccode_base_module_real_visit_expression_statement (BalaCodeVisitor* base, |
| 191 | BalaExpressionStatement* stmt); |
| 192 | static void bala_ccode_base_module_real_append_scope_free (BalaCCodeBaseModule* self, |
| 193 | BalaSymbol* sym, |
| 194 | BalaCodeNode* stop_at); |
| 195 | static void bala_ccode_base_module_append_param_free (BalaCCodeBaseModule* self, |
| 196 | BalaMethod* m); |
| 197 | static void bala_ccode_base_module_real_visit_return_statement (BalaCodeVisitor* base, |
| 198 | BalaReturnStatement* stmt); |
| 199 | static BalaCCodeExpression* bala_ccode_base_module_get_lock_expression (BalaCCodeBaseModule* self, |
| 200 | BalaStatement* stmt, |
| 201 | BalaExpression* resource); |
| 202 | static void bala_ccode_base_module_real_visit_lock_statement (BalaCodeVisitor* base, |
| 203 | BalaLockStatement* stmt); |
| 204 | static void bala_ccode_base_module_real_visit_unlock_statement (BalaCodeVisitor* base, |
| 205 | BalaUnlockStatement* stmt); |
| 206 | static void bala_ccode_base_module_real_visit_delete_statement (BalaCodeVisitor* base, |
| 207 | BalaDeleteStatement* stmt); |
| 208 | static gboolean bala_ccode_base_module_is_compact_class_destructor_call (BalaExpression* expr); |
| 209 | static void bala_ccode_base_module_real_visit_expression (BalaCodeVisitor* base, |
| 210 | BalaExpression* expr); |
| 211 | static void bala_ccode_base_module_real_visit_boolean_literal (BalaCodeVisitor* base, |
| 212 | BalaBooleanLiteral* expr); |
| 213 | static void bala_ccode_base_module_real_visit_character_literal (BalaCodeVisitor* base, |
| 214 | BalaCharacterLiteral* expr); |
| 215 | static void bala_ccode_base_module_real_visit_integer_literal (BalaCodeVisitor* base, |
| 216 | BalaIntegerLiteral* expr); |
| 217 | static void bala_ccode_base_module_real_visit_real_literal (BalaCodeVisitor* base, |
| 218 | BalaRealLiteral* expr); |
| 219 | static void bala_ccode_base_module_real_visit_string_literal (BalaCodeVisitor* base, |
| 220 | BalaStringLiteral* expr); |
| 221 | static void bala_ccode_base_module_real_visit_regex_literal (BalaCodeVisitor* base, |
| 222 | BalaRegexLiteral* expr); |
| 223 | static void bala_ccode_base_module_real_visit_null_literal (BalaCodeVisitor* base, |
| 224 | BalaNullLiteral* expr); |
| 225 | static BalaTargetValue* bala_ccode_base_module_real_get_local_cvalue (BalaCCodeBaseModule* self, |
| 226 | BalaLocalVariable* local); |
| 227 | static BalaTargetValue* bala_ccode_base_module_real_get_parameter_cvalue (BalaCCodeBaseModule* self, |
| 228 | BalaParameter* param); |
| 229 | static BalaTargetValue* bala_ccode_base_module_real_get_field_cvalue (BalaCCodeBaseModule* self, |
| 230 | BalaField* field, |
| 231 | BalaTargetValue* instance); |
| 232 | static BalaTargetValue* bala_ccode_base_module_real_load_variable (BalaCCodeBaseModule* self, |
| 233 | BalaVariable* variable, |
| 234 | BalaTargetValue* value, |
| 235 | BalaExpression* expr); |
| 236 | static BalaTargetValue* bala_ccode_base_module_real_load_this_parameter (BalaCCodeBaseModule* self, |
| 237 | BalaTypeSymbol* sym); |
| 238 | static void bala_ccode_base_module_real_store_value (BalaCCodeBaseModule* self, |
| 239 | BalaTargetValue* lvalue, |
| 240 | BalaTargetValue* value, |
| 241 | BalaSourceReference* source_reference); |
| 242 | static gchar* bala_ccode_base_module_real_get_delegate_target_cname (BalaCCodeBaseModule* self, |
| 243 | const gchar* delegate_cname); |
| 244 | static BalaCCodeExpression* bala_ccode_base_module_real_get_delegate_target_cexpression (BalaCCodeBaseModule* self, |
| 245 | BalaExpression* delegate_expr, |
| 246 | BalaCCodeExpression* * delegate_target_destroy_notify); |
| 247 | static BalaCCodeExpression* bala_ccode_base_module_real_get_delegate_target_cvalue (BalaCCodeBaseModule* self, |
| 248 | BalaTargetValue* value); |
| 249 | static BalaCCodeExpression* bala_ccode_base_module_real_get_delegate_target_destroy_notify_cvalue (BalaCCodeBaseModule* self, |
| 250 | BalaTargetValue* value); |
| 251 | static gchar* bala_ccode_base_module_real_get_delegate_target_destroy_notify_cname (BalaCCodeBaseModule* self, |
| 252 | const gchar* delegate_cname); |
| 253 | static void bala_ccode_base_module_real_visit_base_access (BalaCodeVisitor* base, |
| 254 | BalaBaseAccess* expr); |
| 255 | static void bala_ccode_base_module_real_visit_postfix_expression (BalaCodeVisitor* base, |
| 256 | BalaPostfixExpression* expr); |
| 257 | static BalaMemberAccess* bala_ccode_base_module_find_property_access (BalaCCodeBaseModule* self, |
| 258 | BalaExpression* expr); |
| 259 | static gboolean bala_ccode_base_module_is_limited_generic_type (BalaGenericType* type); |
| 260 | static BalaTargetValue* bala_ccode_base_module_real_copy_value (BalaCCodeBaseModule* self, |
| 261 | BalaTargetValue* value, |
| 262 | BalaCodeNode* node); |
| 263 | static void bala_ccode_base_module_real_generate_class_declaration (BalaCCodeBaseModule* self, |
| 264 | BalaClass* cl, |
| 265 | BalaCCodeFile* decl_space); |
| 266 | static void bala_ccode_base_module_real_generate_interface_declaration (BalaCCodeBaseModule* self, |
| 267 | BalaInterface* iface, |
| 268 | BalaCCodeFile* decl_space); |
| 269 | static gboolean bala_ccode_base_module_real_generate_method_declaration (BalaCCodeBaseModule* self, |
| 270 | BalaMethod* m, |
| 271 | BalaCCodeFile* decl_space); |
| 272 | static void bala_ccode_base_module_real_generate_error_domain_declaration (BalaCCodeBaseModule* self, |
| 273 | BalaErrorDomain* edomain, |
| 274 | BalaCCodeFile* decl_space); |
| 275 | static void bala_ccode_base_module_real_visit_object_creation_expression (BalaCodeVisitor* base, |
| 276 | BalaObjectCreationExpression* expr); |
| 277 | static void bala_ccode_base_module_real_visit_sizeof_expression (BalaCodeVisitor* base, |
| 278 | BalaSizeofExpression* expr); |
| 279 | static void bala_ccode_base_module_real_visit_typeof_expression (BalaCodeVisitor* base, |
| 280 | BalaTypeofExpression* expr); |
| 281 | static void bala_ccode_base_module_real_visit_unary_expression (BalaCodeVisitor* base, |
| 282 | BalaUnaryExpression* expr); |
| 283 | static BalaCCodeExpression* bala_ccode_base_module_real_deserialize_expression (BalaCCodeBaseModule* self, |
| 284 | BalaDataType* type, |
| 285 | BalaCCodeExpression* variant_expr, |
| 286 | BalaCCodeExpression* expr, |
| 287 | BalaCCodeExpression* error_expr, |
| 288 | gboolean* may_fail); |
| 289 | static BalaCCodeExpression* bala_ccode_base_module_real_serialize_expression (BalaCCodeBaseModule* self, |
| 290 | BalaDataType* type, |
| 291 | BalaCCodeExpression* expr); |
| 292 | static void bala_ccode_base_module_real_visit_cast_expression (BalaCodeVisitor* base, |
| 293 | BalaCastExpression* expr); |
| 294 | static void bala_ccode_base_module_real_visit_named_argument (BalaCodeVisitor* base, |
| 295 | BalaNamedArgument* expr); |
| 296 | static void bala_ccode_base_module_real_visit_pointer_indirection (BalaCodeVisitor* base, |
| 297 | BalaPointerIndirection* expr); |
| 298 | static void bala_ccode_base_module_real_visit_addressof_expression (BalaCodeVisitor* base, |
| 299 | BalaAddressofExpression* expr); |
| 300 | static void bala_ccode_base_module_real_visit_reference_transfer_expression (BalaCodeVisitor* base, |
| 301 | BalaReferenceTransferExpression* expr); |
| 302 | static void bala_ccode_base_module_real_visit_binary_expression (BalaCodeVisitor* base, |
| 303 | BalaBinaryExpression* expr); |
| 304 | static gchar* bala_ccode_base_module_generate_array_contains_wrapper (BalaCCodeBaseModule* self, |
| 305 | BalaArrayType* array_type); |
| 306 | static void bala_ccode_base_module_real_visit_type_check (BalaCodeVisitor* base, |
| 307 | BalaTypeCheck* expr); |
| 308 | static void bala_ccode_base_module_real_visit_lambda_expression (BalaCodeVisitor* base, |
| 309 | BalaLambdaExpression* lambda); |
| 310 | static BalaCCodeExpression* bala_ccode_base_module_real_get_implicit_cast_expression (BalaCCodeBaseModule* self, |
| 311 | BalaCCodeExpression* source_cexpr, |
| 312 | BalaDataType* expression_type, |
| 313 | BalaDataType* target_type, |
| 314 | BalaCodeNode* node); |
| 315 | static void bala_ccode_base_module_real_create_type_check_statement (BalaCCodeBaseModule* self, |
| 316 | BalaCodeNode* method_node, |
| 317 | BalaDataType* ret_type, |
| 318 | BalaTypeSymbol* t, |
| 319 | gboolean non_null, |
| 320 | const gchar* var_name); |
| 321 | static void bala_ccode_base_module_real_visit_class (BalaCodeVisitor* base, |
| 322 | BalaClass* cl); |
| 323 | static void bala_ccode_base_module_real_generate_dynamic_method_wrapper (BalaCCodeBaseModule* self, |
| 324 | BalaDynamicMethod* method); |
| 325 | static gboolean bala_ccode_base_module_real_method_has_wrapper (BalaCCodeBaseModule* self, |
| 326 | BalaMethod* method); |
| 327 | static BalaCCodeExpression* bala_ccode_base_module_real_get_param_spec_cexpression (BalaCCodeBaseModule* self, |
| 328 | BalaProperty* prop); |
| 329 | static BalaCCodeExpression* bala_ccode_base_module_real_get_param_spec (BalaCCodeBaseModule* self, |
| 330 | BalaProperty* prop); |
| 331 | static BalaCCodeExpression* bala_ccode_base_module_real_get_signal_creation (BalaCCodeBaseModule* self, |
| 332 | BalaSignal* sig, |
| 333 | BalaObjectTypeSymbol* type); |
| 334 | static BalaCCodeExpression* bala_ccode_base_module_real_get_value_getter_function (BalaCCodeBaseModule* self, |
| 335 | BalaDataType* type_reference); |
| 336 | static BalaCCodeExpression* bala_ccode_base_module_real_get_value_setter_function (BalaCCodeBaseModule* self, |
| 337 | BalaDataType* type_reference); |
| 338 | static BalaCCodeExpression* bala_ccode_base_module_real_get_value_taker_function (BalaCCodeBaseModule* self, |
| 339 | BalaDataType* type_reference); |
| 340 | static void bala_ccode_base_module_real_register_dbus_info (BalaCCodeBaseModule* self, |
| 341 | BalaCCodeBlock* block, |
| 342 | BalaObjectTypeSymbol* bindable); |
| 343 | static gchar* bala_ccode_base_module_real_get_dynamic_property_getter_cname (BalaCCodeBaseModule* self, |
| 344 | BalaDynamicProperty* node); |
| 345 | static gchar* bala_ccode_base_module_real_get_dynamic_property_setter_cname (BalaCCodeBaseModule* self, |
| 346 | BalaDynamicProperty* node); |
| 347 | static gchar* bala_ccode_base_module_real_get_dynamic_signal_cname (BalaCCodeBaseModule* self, |
| 348 | BalaDynamicSignal* node); |
| 349 | static gchar* bala_ccode_base_module_real_get_dynamic_signal_connect_wrapper_name (BalaCCodeBaseModule* self, |
| 350 | BalaDynamicSignal* node); |
| 351 | static gchar* bala_ccode_base_module_real_get_dynamic_signal_connect_after_wrapper_name (BalaCCodeBaseModule* self, |
| 352 | BalaDynamicSignal* node); |
| 353 | static gchar* bala_ccode_base_module_real_get_dynamic_signal_disconnect_wrapper_name (BalaCCodeBaseModule* self, |
| 354 | BalaDynamicSignal* node); |
| 355 | static gchar* bala_ccode_base_module_real_get_array_length_cname (BalaCCodeBaseModule* self, |
| 356 | const gchar* array_cname, |
| 357 | gint dim); |
| 358 | static gchar* bala_ccode_base_module_real_get_variable_array_length_cname (BalaCCodeBaseModule* self, |
| 359 | BalaVariable* variable, |
| 360 | gint dim); |
| 361 | static BalaCCodeExpression* bala_ccode_base_module_real_get_array_length_cexpression (BalaCCodeBaseModule* self, |
| 362 | BalaExpression* array_expr, |
| 363 | gint dim); |
| 364 | static BalaCCodeExpression* bala_ccode_base_module_real_get_array_length_cvalue (BalaCCodeBaseModule* self, |
| 365 | BalaTargetValue* value, |
| 366 | gint dim); |
| 367 | static gchar* bala_ccode_base_module_real_get_array_size_cname (BalaCCodeBaseModule* self, |
| 368 | const gchar* array_cname); |
| 369 | static void bala_ccode_base_module_real_add_simple_check (BalaCCodeBaseModule* self, |
| 370 | BalaCodeNode* node, |
| 371 | gboolean always_fails); |
| 372 | static gchar* bala_ccode_base_module_real_generate_ready_function (BalaCCodeBaseModule* self, |
| 373 | BalaMethod* m); |
| 374 | static void bala_ccode_base_module_emit_context_finalize (BalaCCodeBaseModuleEmitContext * obj); |
| 375 | static GType bala_ccode_base_module_emit_context_get_type_once (void); |
| 376 | static void bala_ccode_base_module_finalize (BalaCodeVisitor * obj); |
| 377 | static GType bala_ccode_base_module_get_type_once (void); |
| 378 | static void _bala_array_destroy (gpointer array, |
| 379 | gint array_length, |
| 380 | GDestroyNotify destroy_func); |
| 381 | static void _bala_array_free (gpointer array, |
| 382 | gint array_length, |
| 383 | GDestroyNotify destroy_func); |
| 384 | static gint _bala_array_length (gpointer array); |
| 385 | |
| 386 | static inline gpointer |
| 387 | bala_ccode_base_module_get_instance_private (BalaCCodeBaseModule* self) |
| 388 | { |
| 389 | return G_STRUCT_MEMBER_P (self, BalaCCodeBaseModule_private_offset)((gpointer) ((guint8*) (self) + (glong) (BalaCCodeBaseModule_private_offset ))); |
| 390 | } |
| 391 | |
| 392 | BalaCodeContext* |
| 393 | bala_ccode_base_module_get_context (BalaCCodeBaseModule* self) |
| 394 | { |
| 395 | BalaCodeContext* result; |
| 396 | BalaCodeContext* _tmp0_; |
| 397 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 398 | _tmp0_ = self->priv->_context; |
| 399 | result = _tmp0_; |
| 400 | return result; |
| 401 | } |
| 402 | |
| 403 | static gpointer |
| 404 | _bala_code_context_ref0 (gpointer self) |
| 405 | { |
| 406 | return self ? bala_code_context_ref (self) : NULL((void*)0); |
| 407 | } |
| 408 | |
| 409 | void |
| 410 | bala_ccode_base_module_set_context (BalaCCodeBaseModule* self, |
| 411 | BalaCodeContext* value) |
| 412 | { |
| 413 | BalaCodeContext* _tmp0_; |
| 414 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 415 | _tmp0_ = _bala_code_context_ref0 (value); |
| 416 | _bala_code_context_unref0 (self->priv->_context)((self->priv->_context == ((void*)0)) ? ((void*)0) : (self ->priv->_context = (bala_code_context_unref (self->priv ->_context), ((void*)0)))); |
| 417 | self->priv->_context = _tmp0_; |
| 418 | } |
| 419 | |
| 420 | BalaSymbol* |
| 421 | bala_ccode_base_module_get_current_symbol (BalaCCodeBaseModule* self) |
| 422 | { |
| 423 | BalaSymbol* result; |
| 424 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 425 | BalaSymbol* _tmp1_; |
| 426 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 427 | _tmp0_ = self->emit_context; |
| 428 | _tmp1_ = _tmp0_->current_symbol; |
| 429 | result = _tmp1_; |
| 430 | return result; |
| 431 | } |
| 432 | |
| 433 | BalaTryStatement* |
| 434 | bala_ccode_base_module_get_current_try (BalaCCodeBaseModule* self) |
| 435 | { |
| 436 | BalaTryStatement* result; |
| 437 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 438 | BalaTryStatement* _tmp1_; |
| 439 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 440 | _tmp0_ = self->emit_context; |
| 441 | _tmp1_ = _tmp0_->current_try; |
| 442 | result = _tmp1_; |
| 443 | return result; |
| 444 | } |
| 445 | |
| 446 | static gpointer |
| 447 | _bala_code_node_ref0 (gpointer self) |
| 448 | { |
| 449 | return self ? bala_code_node_ref (self) : NULL((void*)0); |
| 450 | } |
| 451 | |
| 452 | void |
| 453 | bala_ccode_base_module_set_current_try (BalaCCodeBaseModule* self, |
| 454 | BalaTryStatement* value) |
| 455 | { |
| 456 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 457 | BalaTryStatement* _tmp1_; |
| 458 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 459 | _tmp0_ = self->emit_context; |
| 460 | _tmp1_ = _bala_code_node_ref0 (value); |
| 461 | _bala_code_node_unref0 (_tmp0_->current_try)((_tmp0_->current_try == ((void*)0)) ? ((void*)0) : (_tmp0_ ->current_try = (bala_code_node_unref (_tmp0_->current_try ), ((void*)0)))); |
| 462 | _tmp0_->current_try = _tmp1_; |
| 463 | } |
| 464 | |
| 465 | gint |
| 466 | bala_ccode_base_module_get_current_try_id (BalaCCodeBaseModule* self) |
| 467 | { |
| 468 | gint result; |
| 469 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 470 | g_return_val_if_fail (self != NULL, 0)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (0); } } while (0); |
| 471 | _tmp0_ = self->emit_context; |
| 472 | result = _tmp0_->current_try_id; |
| 473 | return result; |
| 474 | } |
| 475 | |
| 476 | void |
| 477 | bala_ccode_base_module_set_current_try_id (BalaCCodeBaseModule* self, |
| 478 | gint value) |
| 479 | { |
| 480 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 481 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 482 | _tmp0_ = self->emit_context; |
| 483 | _tmp0_->current_try_id = value; |
| 484 | } |
| 485 | |
| 486 | gint |
| 487 | bala_ccode_base_module_get_next_try_id (BalaCCodeBaseModule* self) |
| 488 | { |
| 489 | gint result; |
| 490 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 491 | g_return_val_if_fail (self != NULL, 0)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (0); } } while (0); |
| 492 | _tmp0_ = self->emit_context; |
| 493 | result = _tmp0_->next_try_id; |
| 494 | return result; |
| 495 | } |
| 496 | |
| 497 | void |
| 498 | bala_ccode_base_module_set_next_try_id (BalaCCodeBaseModule* self, |
| 499 | gint value) |
| 500 | { |
| 501 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 502 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 503 | _tmp0_ = self->emit_context; |
| 504 | _tmp0_->next_try_id = value; |
| 505 | } |
| 506 | |
| 507 | BalaCatchClause* |
| 508 | bala_ccode_base_module_get_current_catch (BalaCCodeBaseModule* self) |
| 509 | { |
| 510 | BalaCatchClause* result; |
| 511 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 512 | BalaCatchClause* _tmp1_; |
| 513 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 514 | _tmp0_ = self->emit_context; |
| 515 | _tmp1_ = _tmp0_->current_catch; |
| 516 | result = _tmp1_; |
| 517 | return result; |
| 518 | } |
| 519 | |
| 520 | void |
| 521 | bala_ccode_base_module_set_current_catch (BalaCCodeBaseModule* self, |
| 522 | BalaCatchClause* value) |
| 523 | { |
| 524 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 525 | BalaCatchClause* _tmp1_; |
| 526 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 527 | _tmp0_ = self->emit_context; |
| 528 | _tmp1_ = _bala_code_node_ref0 (value); |
| 529 | _bala_code_node_unref0 (_tmp0_->current_catch)((_tmp0_->current_catch == ((void*)0)) ? ((void*)0) : (_tmp0_ ->current_catch = (bala_code_node_unref (_tmp0_->current_catch ), ((void*)0)))); |
| 530 | _tmp0_->current_catch = _tmp1_; |
| 531 | } |
| 532 | |
| 533 | gint |
| 534 | bala_ccode_base_module_get_current_inner_error_id (BalaCCodeBaseModule* self) |
| 535 | { |
| 536 | gint result; |
| 537 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 538 | g_return_val_if_fail (self != NULL, 0)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (0); } } while (0); |
| 539 | _tmp0_ = self->emit_context; |
| 540 | result = _tmp0_->current_inner_error_id; |
| 541 | return result; |
| 542 | } |
| 543 | |
| 544 | void |
| 545 | bala_ccode_base_module_set_current_inner_error_id (BalaCCodeBaseModule* self, |
| 546 | gint value) |
| 547 | { |
| 548 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 549 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 550 | _tmp0_ = self->emit_context; |
| 551 | _tmp0_->current_inner_error_id = value; |
| 552 | } |
| 553 | |
| 554 | gboolean |
| 555 | bala_ccode_base_module_get_is_in_method_precondition (BalaCCodeBaseModule* self) |
| 556 | { |
| 557 | gboolean result; |
| 558 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 559 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 560 | _tmp0_ = self->emit_context; |
| 561 | result = _tmp0_->is_in_method_precondition; |
| 562 | return result; |
| 563 | } |
| 564 | |
| 565 | void |
| 566 | bala_ccode_base_module_set_is_in_method_precondition (BalaCCodeBaseModule* self, |
| 567 | gboolean value) |
| 568 | { |
| 569 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 570 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 571 | _tmp0_ = self->emit_context; |
| 572 | _tmp0_->is_in_method_precondition = value; |
| 573 | } |
| 574 | |
| 575 | BalaTypeSymbol* |
| 576 | bala_ccode_base_module_get_current_type_symbol (BalaCCodeBaseModule* self) |
| 577 | { |
| 578 | BalaTypeSymbol* result; |
| 579 | BalaSymbol* sym = NULL((void*)0); |
| 580 | BalaSymbol* _tmp0_; |
| 581 | BalaSymbol* _tmp1_; |
| 582 | BalaSymbol* _tmp2_; |
| 583 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 584 | _tmp0_ = bala_ccode_base_module_get_current_symbol (self); |
| 585 | _tmp1_ = _tmp0_; |
| 586 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 587 | sym = _tmp2_; |
| 588 | while (TRUE(!(0))) { |
| 589 | BalaSymbol* _tmp3_; |
| 590 | BalaSymbol* _tmp4_; |
| 591 | BalaSymbol* _tmp6_; |
| 592 | BalaSymbol* _tmp7_; |
| 593 | BalaSymbol* _tmp8_; |
| 594 | BalaSymbol* _tmp9_; |
| 595 | _tmp3_ = sym; |
| 596 | if (!(_tmp3_ != NULL((void*)0))) { |
| 597 | break; |
| 598 | } |
| 599 | _tmp4_ = sym; |
| 600 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, BALA_TYPE_TYPESYMBOL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp4_); GType __t = ((bala_typesymbol_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 601 | BalaSymbol* _tmp5_; |
| 602 | _tmp5_ = sym; |
| 603 | result = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp5_), ((bala_typesymbol_get_type ()))))); |
| 604 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 605 | return result; |
| 606 | } |
| 607 | _tmp6_ = sym; |
| 608 | _tmp7_ = bala_symbol_get_parent_symbol (_tmp6_); |
| 609 | _tmp8_ = _tmp7_; |
| 610 | _tmp9_ = _bala_code_node_ref0 (_tmp8_); |
| 611 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 612 | sym = _tmp9_; |
| 613 | } |
| 614 | result = NULL((void*)0); |
| 615 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 616 | return result; |
| 617 | } |
| 618 | |
| 619 | BalaClass* |
| 620 | bala_ccode_base_module_get_current_class (BalaCCodeBaseModule* self) |
| 621 | { |
| 622 | BalaClass* result; |
| 623 | BalaTypeSymbol* _tmp0_; |
| 624 | BalaTypeSymbol* _tmp1_; |
| 625 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 626 | _tmp0_ = bala_ccode_base_module_get_current_type_symbol (self); |
| 627 | _tmp1_ = _tmp0_; |
| 628 | result = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp1_) : NULL((void*)0); |
| 629 | return result; |
| 630 | } |
| 631 | |
| 632 | BalaMethod* |
| 633 | bala_ccode_base_module_get_current_method (BalaCCodeBaseModule* self) |
| 634 | { |
| 635 | BalaMethod* result; |
| 636 | BalaSymbol* sym = NULL((void*)0); |
| 637 | BalaSymbol* _tmp0_; |
| 638 | BalaSymbol* _tmp1_; |
| 639 | BalaSymbol* _tmp2_; |
| 640 | BalaSymbol* _tmp8_; |
| 641 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 642 | _tmp0_ = bala_ccode_base_module_get_current_symbol (self); |
| 643 | _tmp1_ = _tmp0_; |
| 644 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 645 | sym = _tmp2_; |
| 646 | while (TRUE(!(0))) { |
| 647 | BalaSymbol* _tmp3_; |
| 648 | BalaSymbol* _tmp4_; |
| 649 | BalaSymbol* _tmp5_; |
| 650 | BalaSymbol* _tmp6_; |
| 651 | BalaSymbol* _tmp7_; |
| 652 | _tmp3_ = sym; |
| 653 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_BLOCK)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_block_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 654 | break; |
| 655 | } |
| 656 | _tmp4_ = sym; |
| 657 | _tmp5_ = bala_symbol_get_parent_symbol (_tmp4_); |
| 658 | _tmp6_ = _tmp5_; |
| 659 | _tmp7_ = _bala_code_node_ref0 (_tmp6_); |
| 660 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 661 | sym = _tmp7_; |
| 662 | } |
| 663 | _tmp8_ = sym; |
| 664 | result = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, BALA_TYPE_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp8_); GType __t = ((bala_method_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaMethod*) _tmp8_) : NULL((void*)0); |
| 665 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 666 | return result; |
| 667 | } |
| 668 | |
| 669 | BalaPropertyAccessor* |
| 670 | bala_ccode_base_module_get_current_property_accessor (BalaCCodeBaseModule* self) |
| 671 | { |
| 672 | BalaPropertyAccessor* result; |
| 673 | BalaSymbol* sym = NULL((void*)0); |
| 674 | BalaSymbol* _tmp0_; |
| 675 | BalaSymbol* _tmp1_; |
| 676 | BalaSymbol* _tmp2_; |
| 677 | BalaSymbol* _tmp8_; |
| 678 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 679 | _tmp0_ = bala_ccode_base_module_get_current_symbol (self); |
| 680 | _tmp1_ = _tmp0_; |
| 681 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 682 | sym = _tmp2_; |
| 683 | while (TRUE(!(0))) { |
| 684 | BalaSymbol* _tmp3_; |
| 685 | BalaSymbol* _tmp4_; |
| 686 | BalaSymbol* _tmp5_; |
| 687 | BalaSymbol* _tmp6_; |
| 688 | BalaSymbol* _tmp7_; |
| 689 | _tmp3_ = sym; |
| 690 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_BLOCK)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_block_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 691 | break; |
| 692 | } |
| 693 | _tmp4_ = sym; |
| 694 | _tmp5_ = bala_symbol_get_parent_symbol (_tmp4_); |
| 695 | _tmp6_ = _tmp5_; |
| 696 | _tmp7_ = _bala_code_node_ref0 (_tmp6_); |
| 697 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 698 | sym = _tmp7_; |
| 699 | } |
| 700 | _tmp8_ = sym; |
| 701 | result = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, BALA_TYPE_PROPERTY_ACCESSOR)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp8_); GType __t = ((bala_property_accessor_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaPropertyAccessor*) _tmp8_) : NULL((void*)0); |
| 702 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 703 | return result; |
| 704 | } |
| 705 | |
| 706 | BalaConstructor* |
| 707 | bala_ccode_base_module_get_current_constructor (BalaCCodeBaseModule* self) |
| 708 | { |
| 709 | BalaConstructor* result; |
| 710 | BalaSymbol* sym = NULL((void*)0); |
| 711 | BalaSymbol* _tmp0_; |
| 712 | BalaSymbol* _tmp1_; |
| 713 | BalaSymbol* _tmp2_; |
| 714 | BalaSymbol* _tmp8_; |
| 715 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 716 | _tmp0_ = bala_ccode_base_module_get_current_symbol (self); |
| 717 | _tmp1_ = _tmp0_; |
| 718 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 719 | sym = _tmp2_; |
| 720 | while (TRUE(!(0))) { |
| 721 | BalaSymbol* _tmp3_; |
| 722 | BalaSymbol* _tmp4_; |
| 723 | BalaSymbol* _tmp5_; |
| 724 | BalaSymbol* _tmp6_; |
| 725 | BalaSymbol* _tmp7_; |
| 726 | _tmp3_ = sym; |
| 727 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_BLOCK)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_block_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 728 | break; |
| 729 | } |
| 730 | _tmp4_ = sym; |
| 731 | _tmp5_ = bala_symbol_get_parent_symbol (_tmp4_); |
| 732 | _tmp6_ = _tmp5_; |
| 733 | _tmp7_ = _bala_code_node_ref0 (_tmp6_); |
| 734 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 735 | sym = _tmp7_; |
| 736 | } |
| 737 | _tmp8_ = sym; |
| 738 | result = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, BALA_TYPE_CONSTRUCTOR)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp8_); GType __t = ((bala_constructor_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaConstructor*) _tmp8_) : NULL((void*)0); |
| 739 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 740 | return result; |
| 741 | } |
| 742 | |
| 743 | BalaDestructor* |
| 744 | bala_ccode_base_module_get_current_destructor (BalaCCodeBaseModule* self) |
| 745 | { |
| 746 | BalaDestructor* result; |
| 747 | BalaSymbol* sym = NULL((void*)0); |
| 748 | BalaSymbol* _tmp0_; |
| 749 | BalaSymbol* _tmp1_; |
| 750 | BalaSymbol* _tmp2_; |
| 751 | BalaSymbol* _tmp8_; |
| 752 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 753 | _tmp0_ = bala_ccode_base_module_get_current_symbol (self); |
| 754 | _tmp1_ = _tmp0_; |
| 755 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 756 | sym = _tmp2_; |
| 757 | while (TRUE(!(0))) { |
| 758 | BalaSymbol* _tmp3_; |
| 759 | BalaSymbol* _tmp4_; |
| 760 | BalaSymbol* _tmp5_; |
| 761 | BalaSymbol* _tmp6_; |
| 762 | BalaSymbol* _tmp7_; |
| 763 | _tmp3_ = sym; |
| 764 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_BLOCK)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_block_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 765 | break; |
| 766 | } |
| 767 | _tmp4_ = sym; |
| 768 | _tmp5_ = bala_symbol_get_parent_symbol (_tmp4_); |
| 769 | _tmp6_ = _tmp5_; |
| 770 | _tmp7_ = _bala_code_node_ref0 (_tmp6_); |
| 771 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 772 | sym = _tmp7_; |
| 773 | } |
| 774 | _tmp8_ = sym; |
| 775 | result = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, BALA_TYPE_DESTRUCTOR)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp8_); GType __t = ((bala_destructor_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaDestructor*) _tmp8_) : NULL((void*)0); |
| 776 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 777 | return result; |
| 778 | } |
| 779 | |
| 780 | BalaDataType* |
| 781 | bala_ccode_base_module_get_current_return_type (BalaCCodeBaseModule* self) |
| 782 | { |
| 783 | BalaDataType* result; |
| 784 | BalaMethod* m = NULL((void*)0); |
| 785 | BalaMethod* _tmp0_; |
| 786 | BalaMethod* _tmp1_; |
| 787 | BalaMethod* _tmp2_; |
| 788 | BalaMethod* _tmp3_; |
| 789 | BalaPropertyAccessor* acc = NULL((void*)0); |
| 790 | BalaPropertyAccessor* _tmp7_; |
| 791 | BalaPropertyAccessor* _tmp8_; |
| 792 | BalaPropertyAccessor* _tmp9_; |
| 793 | BalaPropertyAccessor* _tmp10_; |
| 794 | gboolean _tmp18_ = FALSE(0); |
| 795 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 796 | _tmp0_ = bala_ccode_base_module_get_current_method (self); |
| 797 | _tmp1_ = _tmp0_; |
| 798 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 799 | m = _tmp2_; |
| 800 | _tmp3_ = m; |
| 801 | if (_tmp3_ != NULL((void*)0)) { |
| 802 | BalaMethod* _tmp4_; |
| 803 | BalaDataType* _tmp5_; |
| 804 | BalaDataType* _tmp6_; |
| 805 | _tmp4_ = m; |
| 806 | _tmp5_ = bala_callable_get_return_type ((BalaCallable*) _tmp4_); |
| 807 | _tmp6_ = _tmp5_; |
| 808 | result = _tmp6_; |
| 809 | _bala_code_node_unref0 (m)((m == ((void*)0)) ? ((void*)0) : (m = (bala_code_node_unref ( m), ((void*)0)))); |
| 810 | return result; |
| 811 | } |
| 812 | _tmp7_ = bala_ccode_base_module_get_current_property_accessor (self); |
| 813 | _tmp8_ = _tmp7_; |
| 814 | _tmp9_ = _bala_code_node_ref0 (_tmp8_); |
| 815 | acc = _tmp9_; |
| 816 | _tmp10_ = acc; |
| 817 | if (_tmp10_ != NULL((void*)0)) { |
| 818 | BalaPropertyAccessor* _tmp11_; |
| 819 | gboolean _tmp12_; |
| 820 | gboolean _tmp13_; |
| 821 | _tmp11_ = acc; |
| 822 | _tmp12_ = bala_property_accessor_get_readable (_tmp11_); |
| 823 | _tmp13_ = _tmp12_; |
| 824 | if (_tmp13_) { |
| 825 | BalaPropertyAccessor* _tmp14_; |
| 826 | BalaDataType* _tmp15_; |
| 827 | BalaDataType* _tmp16_; |
| 828 | _tmp14_ = acc; |
| 829 | _tmp15_ = bala_property_accessor_get_value_type (_tmp14_); |
| 830 | _tmp16_ = _tmp15_; |
| 831 | result = _tmp16_; |
| 832 | _bala_code_node_unref0 (acc)((acc == ((void*)0)) ? ((void*)0) : (acc = (bala_code_node_unref (acc), ((void*)0)))); |
| 833 | _bala_code_node_unref0 (m)((m == ((void*)0)) ? ((void*)0) : (m = (bala_code_node_unref ( m), ((void*)0)))); |
| 834 | return result; |
| 835 | } else { |
| 836 | BalaDataType* _tmp17_; |
| 837 | _tmp17_ = self->void_type; |
| 838 | result = _tmp17_; |
| 839 | _bala_code_node_unref0 (acc)((acc == ((void*)0)) ? ((void*)0) : (acc = (bala_code_node_unref (acc), ((void*)0)))); |
| 840 | _bala_code_node_unref0 (m)((m == ((void*)0)) ? ((void*)0) : (m = (bala_code_node_unref ( m), ((void*)0)))); |
| 841 | return result; |
| 842 | } |
| 843 | } |
| 844 | if (bala_ccode_base_module_is_in_constructor (self)) { |
| 845 | _tmp18_ = TRUE(!(0)); |
| 846 | } else { |
| 847 | _tmp18_ = bala_ccode_base_module_is_in_destructor (self); |
| 848 | } |
| 849 | if (_tmp18_) { |
| 850 | BalaDataType* _tmp19_; |
| 851 | _tmp19_ = self->void_type; |
| 852 | result = _tmp19_; |
| 853 | _bala_code_node_unref0 (acc)((acc == ((void*)0)) ? ((void*)0) : (acc = (bala_code_node_unref (acc), ((void*)0)))); |
| 854 | _bala_code_node_unref0 (m)((m == ((void*)0)) ? ((void*)0) : (m = (bala_code_node_unref ( m), ((void*)0)))); |
| 855 | return result; |
| 856 | } |
| 857 | result = NULL((void*)0); |
| 858 | _bala_code_node_unref0 (acc)((acc == ((void*)0)) ? ((void*)0) : (acc = (bala_code_node_unref (acc), ((void*)0)))); |
| 859 | _bala_code_node_unref0 (m)((m == ((void*)0)) ? ((void*)0) : (m = (bala_code_node_unref ( m), ((void*)0)))); |
| 860 | return result; |
| 861 | } |
| 862 | |
| 863 | gboolean |
| 864 | bala_ccode_base_module_is_in_coroutine (BalaCCodeBaseModule* self) |
| 865 | { |
| 866 | gboolean _tmp0_ = FALSE(0); |
| 867 | BalaMethod* _tmp1_; |
| 868 | BalaMethod* _tmp2_; |
| 869 | gboolean result = FALSE(0); |
| 870 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 871 | _tmp1_ = bala_ccode_base_module_get_current_method (self); |
| 872 | _tmp2_ = _tmp1_; |
| 873 | if (_tmp2_ != NULL((void*)0)) { |
| 874 | BalaMethod* _tmp3_; |
| 875 | BalaMethod* _tmp4_; |
| 876 | gboolean _tmp5_; |
| 877 | gboolean _tmp6_; |
| 878 | _tmp3_ = bala_ccode_base_module_get_current_method (self); |
| 879 | _tmp4_ = _tmp3_; |
| 880 | _tmp5_ = bala_method_get_coroutine (_tmp4_); |
| 881 | _tmp6_ = _tmp5_; |
| 882 | _tmp0_ = _tmp6_; |
| 883 | } else { |
| 884 | _tmp0_ = FALSE(0); |
| 885 | } |
| 886 | result = _tmp0_; |
| 887 | return result; |
| 888 | } |
| 889 | |
| 890 | gboolean |
| 891 | bala_ccode_base_module_is_in_constructor (BalaCCodeBaseModule* self) |
| 892 | { |
| 893 | BalaMethod* _tmp0_; |
| 894 | BalaMethod* _tmp1_; |
| 895 | BalaSymbol* sym = NULL((void*)0); |
| 896 | BalaSymbol* _tmp2_; |
| 897 | BalaSymbol* _tmp3_; |
| 898 | BalaSymbol* _tmp4_; |
| 899 | gboolean result = FALSE(0); |
| 900 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 901 | _tmp0_ = bala_ccode_base_module_get_current_method (self); |
| 902 | _tmp1_ = _tmp0_; |
| 903 | if (_tmp1_ != NULL((void*)0)) { |
| 904 | result = FALSE(0); |
| 905 | return result; |
| 906 | } |
| 907 | _tmp2_ = bala_ccode_base_module_get_current_symbol (self); |
| 908 | _tmp3_ = _tmp2_; |
| 909 | _tmp4_ = _bala_code_node_ref0 (_tmp3_); |
| 910 | sym = _tmp4_; |
| 911 | while (TRUE(!(0))) { |
| 912 | BalaSymbol* _tmp5_; |
| 913 | BalaSymbol* _tmp6_; |
| 914 | BalaSymbol* _tmp7_; |
| 915 | BalaSymbol* _tmp8_; |
| 916 | BalaSymbol* _tmp9_; |
| 917 | BalaSymbol* _tmp10_; |
| 918 | _tmp5_ = sym; |
| 919 | if (!(_tmp5_ != NULL((void*)0))) { |
| 920 | break; |
| 921 | } |
| 922 | _tmp6_ = sym; |
| 923 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, BALA_TYPE_CONSTRUCTOR)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp6_); GType __t = ((bala_constructor_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 924 | result = TRUE(!(0)); |
| 925 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 926 | return result; |
| 927 | } |
| 928 | _tmp7_ = sym; |
| 929 | _tmp8_ = bala_symbol_get_parent_symbol (_tmp7_); |
| 930 | _tmp9_ = _tmp8_; |
| 931 | _tmp10_ = _bala_code_node_ref0 (_tmp9_); |
| 932 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 933 | sym = _tmp10_; |
| 934 | } |
| 935 | result = FALSE(0); |
| 936 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 937 | return result; |
| 938 | } |
| 939 | |
| 940 | gboolean |
| 941 | bala_ccode_base_module_is_in_destructor (BalaCCodeBaseModule* self) |
| 942 | { |
| 943 | BalaMethod* _tmp0_; |
| 944 | BalaMethod* _tmp1_; |
| 945 | BalaSymbol* sym = NULL((void*)0); |
| 946 | BalaSymbol* _tmp2_; |
| 947 | BalaSymbol* _tmp3_; |
| 948 | BalaSymbol* _tmp4_; |
| 949 | gboolean result = FALSE(0); |
| 950 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 951 | _tmp0_ = bala_ccode_base_module_get_current_method (self); |
| 952 | _tmp1_ = _tmp0_; |
| 953 | if (_tmp1_ != NULL((void*)0)) { |
| 954 | result = FALSE(0); |
| 955 | return result; |
| 956 | } |
| 957 | _tmp2_ = bala_ccode_base_module_get_current_symbol (self); |
| 958 | _tmp3_ = _tmp2_; |
| 959 | _tmp4_ = _bala_code_node_ref0 (_tmp3_); |
| 960 | sym = _tmp4_; |
| 961 | while (TRUE(!(0))) { |
| 962 | BalaSymbol* _tmp5_; |
| 963 | BalaSymbol* _tmp6_; |
| 964 | BalaSymbol* _tmp7_; |
| 965 | BalaSymbol* _tmp8_; |
| 966 | BalaSymbol* _tmp9_; |
| 967 | BalaSymbol* _tmp10_; |
| 968 | _tmp5_ = sym; |
| 969 | if (!(_tmp5_ != NULL((void*)0))) { |
| 970 | break; |
| 971 | } |
| 972 | _tmp6_ = sym; |
| 973 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, BALA_TYPE_DESTRUCTOR)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp6_); GType __t = ((bala_destructor_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 974 | result = TRUE(!(0)); |
| 975 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 976 | return result; |
| 977 | } |
| 978 | _tmp7_ = sym; |
| 979 | _tmp8_ = bala_symbol_get_parent_symbol (_tmp7_); |
| 980 | _tmp9_ = _tmp8_; |
| 981 | _tmp10_ = _bala_code_node_ref0 (_tmp9_); |
| 982 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 983 | sym = _tmp10_; |
| 984 | } |
| 985 | result = FALSE(0); |
| 986 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 987 | return result; |
| 988 | } |
| 989 | |
| 990 | BalaBlock* |
| 991 | bala_ccode_base_module_get_current_closure_block (BalaCCodeBaseModule* self) |
| 992 | { |
| 993 | BalaBlock* result; |
| 994 | BalaSymbol* _tmp0_; |
| 995 | BalaSymbol* _tmp1_; |
| 996 | BalaBlock* _tmp2_; |
| 997 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 998 | _tmp0_ = bala_ccode_base_module_get_current_symbol (self); |
| 999 | _tmp1_ = _tmp0_; |
| 1000 | _tmp2_ = bala_ccode_base_module_next_closure_block (self, _tmp1_); |
| 1001 | result = _tmp2_; |
| 1002 | return result; |
| 1003 | } |
| 1004 | |
| 1005 | BalaBlock* |
| 1006 | bala_ccode_base_module_next_closure_block (BalaCCodeBaseModule* self, |
| 1007 | BalaSymbol* sym) |
| 1008 | { |
| 1009 | BalaBlock* result = NULL((void*)0); |
| 1010 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 1011 | g_return_val_if_fail (sym != NULL, NULL)do { if ((sym != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "sym != NULL") ; return (((void*)0)); } } while (0); |
| 1012 | while (TRUE(!(0))) { |
| 1013 | BalaMethod* method = NULL((void*)0); |
| 1014 | gboolean _tmp0_ = FALSE(0); |
| 1015 | BalaMethod* _tmp1_; |
| 1016 | BalaBlock* block = NULL((void*)0); |
| 1017 | gboolean _tmp5_ = FALSE(0); |
| 1018 | BalaMethod* _tmp6_; |
| 1019 | gboolean _tmp8_ = FALSE(0); |
| 1020 | BalaBlock* _tmp9_; |
| 1021 | BalaSymbol* _tmp14_; |
| 1022 | BalaSymbol* _tmp15_; |
| 1023 | method = G_TYPE_CHECK_INSTANCE_TYPE (sym, BALA_TYPE_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( sym); GType __t = ((bala_method_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst ->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaMethod*) sym) : NULL((void*)0); |
| 1024 | _tmp1_ = method; |
| 1025 | if (_tmp1_ != NULL((void*)0)) { |
| 1026 | BalaMethod* _tmp2_; |
| 1027 | gboolean _tmp3_; |
| 1028 | gboolean _tmp4_; |
| 1029 | _tmp2_ = method; |
| 1030 | _tmp3_ = bala_method_get_closure (_tmp2_); |
| 1031 | _tmp4_ = _tmp3_; |
| 1032 | _tmp0_ = !_tmp4_; |
| 1033 | } else { |
| 1034 | _tmp0_ = FALSE(0); |
| 1035 | } |
| 1036 | if (_tmp0_) { |
| 1037 | break; |
| 1038 | } |
| 1039 | block = G_TYPE_CHECK_INSTANCE_TYPE (sym, BALA_TYPE_BLOCK)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( sym); GType __t = ((bala_block_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst ->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaBlock*) sym) : NULL((void*)0); |
| 1040 | _tmp6_ = method; |
| 1041 | if (_tmp6_ == NULL((void*)0)) { |
| 1042 | BalaBlock* _tmp7_; |
| 1043 | _tmp7_ = block; |
| 1044 | _tmp5_ = _tmp7_ == NULL((void*)0); |
| 1045 | } else { |
| 1046 | _tmp5_ = FALSE(0); |
| 1047 | } |
| 1048 | if (_tmp5_) { |
| 1049 | break; |
| 1050 | } |
| 1051 | _tmp9_ = block; |
| 1052 | if (_tmp9_ != NULL((void*)0)) { |
| 1053 | BalaBlock* _tmp10_; |
| 1054 | gboolean _tmp11_; |
| 1055 | gboolean _tmp12_; |
| 1056 | _tmp10_ = block; |
| 1057 | _tmp11_ = bala_block_get_captured (_tmp10_); |
| 1058 | _tmp12_ = _tmp11_; |
| 1059 | _tmp8_ = _tmp12_; |
| 1060 | } else { |
| 1061 | _tmp8_ = FALSE(0); |
| 1062 | } |
| 1063 | if (_tmp8_) { |
| 1064 | BalaBlock* _tmp13_; |
| 1065 | _tmp13_ = block; |
| 1066 | result = _tmp13_; |
| 1067 | return result; |
| 1068 | } |
| 1069 | _tmp14_ = bala_symbol_get_parent_symbol (sym); |
| 1070 | _tmp15_ = _tmp14_; |
| 1071 | sym = _tmp15_; |
| 1072 | } |
| 1073 | result = NULL((void*)0); |
| 1074 | return result; |
| 1075 | } |
| 1076 | |
| 1077 | BalaCCodeFunction* |
| 1078 | bala_ccode_base_module_get_ccode (BalaCCodeBaseModule* self) |
| 1079 | { |
| 1080 | BalaCCodeFunction* result; |
| 1081 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 1082 | BalaCCodeFunction* _tmp1_; |
| 1083 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 1084 | _tmp0_ = self->emit_context; |
| 1085 | _tmp1_ = _tmp0_->ccode; |
| 1086 | result = _tmp1_; |
| 1087 | return result; |
| 1088 | } |
| 1089 | |
| 1090 | BalaArrayList* |
| 1091 | bala_ccode_base_module_get_temp_ref_values (BalaCCodeBaseModule* self) |
| 1092 | { |
| 1093 | BalaArrayList* result; |
| 1094 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 1095 | BalaArrayList* _tmp1_; |
| 1096 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 1097 | _tmp0_ = self->emit_context; |
| 1098 | _tmp1_ = _tmp0_->temp_ref_values; |
| 1099 | result = _tmp1_; |
| 1100 | return result; |
| 1101 | } |
| 1102 | |
| 1103 | gint |
| 1104 | bala_ccode_base_module_get_next_temp_var_id (BalaCCodeBaseModule* self) |
| 1105 | { |
| 1106 | gint result; |
| 1107 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 1108 | g_return_val_if_fail (self != NULL, 0)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (0); } } while (0); |
| 1109 | _tmp0_ = self->emit_context; |
| 1110 | result = _tmp0_->next_temp_var_id; |
| 1111 | return result; |
| 1112 | } |
| 1113 | |
| 1114 | void |
| 1115 | bala_ccode_base_module_set_next_temp_var_id (BalaCCodeBaseModule* self, |
| 1116 | gint value) |
| 1117 | { |
| 1118 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 1119 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 1120 | _tmp0_ = self->emit_context; |
| 1121 | _tmp0_->next_temp_var_id = value; |
| 1122 | } |
| 1123 | |
| 1124 | gboolean |
| 1125 | bala_ccode_base_module_get_in_creation_method (BalaCCodeBaseModule* self) |
| 1126 | { |
| 1127 | gboolean result; |
| 1128 | BalaMethod* _tmp0_; |
| 1129 | BalaMethod* _tmp1_; |
| 1130 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 1131 | _tmp0_ = bala_ccode_base_module_get_current_method (self); |
| 1132 | _tmp1_ = _tmp0_; |
| 1133 | result = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BALA_TYPE_CREATION_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1_); GType __t = ((bala_creation_method_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 1134 | return result; |
| 1135 | } |
| 1136 | |
| 1137 | gboolean |
| 1138 | bala_ccode_base_module_get_current_method_inner_error (BalaCCodeBaseModule* self) |
| 1139 | { |
| 1140 | gboolean result; |
| 1141 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 1142 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 1143 | _tmp0_ = self->emit_context; |
| 1144 | result = _tmp0_->current_method_inner_error; |
| 1145 | return result; |
| 1146 | } |
| 1147 | |
| 1148 | void |
| 1149 | bala_ccode_base_module_set_current_method_inner_error (BalaCCodeBaseModule* self, |
| 1150 | gboolean value) |
| 1151 | { |
| 1152 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 1153 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 1154 | _tmp0_ = self->emit_context; |
| 1155 | _tmp0_->current_method_inner_error = value; |
| 1156 | } |
| 1157 | |
| 1158 | gboolean |
| 1159 | bala_ccode_base_module_get_current_method_return (BalaCCodeBaseModule* self) |
| 1160 | { |
| 1161 | gboolean result; |
| 1162 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 1163 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 1164 | _tmp0_ = self->emit_context; |
| 1165 | result = _tmp0_->current_method_return; |
| 1166 | return result; |
| 1167 | } |
| 1168 | |
| 1169 | void |
| 1170 | bala_ccode_base_module_set_current_method_return (BalaCCodeBaseModule* self, |
| 1171 | gboolean value) |
| 1172 | { |
| 1173 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 1174 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 1175 | _tmp0_ = self->emit_context; |
| 1176 | _tmp0_->current_method_return = value; |
| 1177 | } |
| 1178 | |
| 1179 | BalaMap* |
| 1180 | bala_ccode_base_module_get_variable_name_map (BalaCCodeBaseModule* self) |
| 1181 | { |
| 1182 | BalaMap* result; |
| 1183 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 1184 | BalaMap* _tmp1_; |
| 1185 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 1186 | _tmp0_ = self->emit_context; |
| 1187 | _tmp1_ = _tmp0_->variable_name_map; |
| 1188 | result = _tmp1_; |
| 1189 | return result; |
| 1190 | } |
| 1191 | |
| 1192 | BalaCCodeBaseModule* |
| 1193 | bala_ccode_base_module_construct (GType object_type) |
| 1194 | { |
| 1195 | BalaCCodeBaseModule* self = NULL((void*)0); |
| 1196 | GHashFunc _tmp0_; |
| 1197 | GEqualFunc _tmp1_; |
| 1198 | BalaHashSet* _tmp2_; |
| 1199 | BalaSet* _tmp3_; |
| 1200 | BalaSet* _tmp4_; |
| 1201 | BalaSet* _tmp5_; |
| 1202 | BalaSet* _tmp6_; |
| 1203 | BalaSet* _tmp7_; |
| 1204 | BalaSet* _tmp8_; |
| 1205 | BalaSet* _tmp9_; |
| 1206 | BalaSet* _tmp10_; |
| 1207 | BalaSet* _tmp11_; |
| 1208 | BalaSet* _tmp12_; |
| 1209 | BalaSet* _tmp13_; |
| 1210 | BalaSet* _tmp14_; |
| 1211 | BalaSet* _tmp15_; |
| 1212 | BalaSet* _tmp16_; |
| 1213 | BalaSet* _tmp17_; |
| 1214 | BalaSet* _tmp18_; |
| 1215 | BalaSet* _tmp19_; |
| 1216 | BalaSet* _tmp20_; |
| 1217 | BalaSet* _tmp21_; |
| 1218 | BalaSet* _tmp22_; |
| 1219 | BalaSet* _tmp23_; |
| 1220 | GHashFunc _tmp24_; |
| 1221 | GEqualFunc _tmp25_; |
| 1222 | BalaHashSet* _tmp26_; |
| 1223 | BalaSet* _tmp27_; |
| 1224 | BalaSet* _tmp28_; |
| 1225 | BalaSet* _tmp29_; |
| 1226 | BalaSet* _tmp30_; |
| 1227 | BalaSet* _tmp31_; |
| 1228 | BalaSet* _tmp32_; |
| 1229 | BalaSet* _tmp33_; |
| 1230 | BalaSet* _tmp34_; |
| 1231 | BalaSet* _tmp35_; |
| 1232 | BalaSet* _tmp36_; |
| 1233 | BalaSet* _tmp37_; |
| 1234 | BalaSet* _tmp38_; |
| 1235 | BalaSet* _tmp39_; |
| 1236 | BalaSet* _tmp40_; |
| 1237 | BalaSet* _tmp41_; |
| 1238 | BalaSet* _tmp42_; |
| 1239 | BalaSet* _tmp43_; |
| 1240 | BalaSet* _tmp44_; |
| 1241 | BalaSet* _tmp45_; |
| 1242 | BalaSet* _tmp46_; |
| 1243 | BalaSet* _tmp47_; |
| 1244 | BalaSet* _tmp48_; |
| 1245 | BalaSet* _tmp49_; |
| 1246 | BalaSet* _tmp50_; |
| 1247 | BalaSet* _tmp51_; |
| 1248 | BalaSet* _tmp52_; |
| 1249 | BalaSet* _tmp53_; |
| 1250 | BalaSet* _tmp54_; |
| 1251 | BalaSet* _tmp55_; |
| 1252 | BalaSet* _tmp56_; |
| 1253 | BalaSet* _tmp57_; |
| 1254 | BalaSet* _tmp58_; |
| 1255 | BalaSet* _tmp59_; |
| 1256 | BalaSet* _tmp60_; |
| 1257 | BalaSet* _tmp61_; |
| 1258 | BalaSet* _tmp62_; |
| 1259 | BalaSet* _tmp63_; |
| 1260 | BalaSet* _tmp64_; |
| 1261 | BalaSet* _tmp65_; |
| 1262 | BalaSet* _tmp66_; |
| 1263 | BalaSet* _tmp67_; |
| 1264 | BalaSet* _tmp68_; |
| 1265 | BalaSet* _tmp69_; |
| 1266 | BalaSet* _tmp70_; |
| 1267 | BalaSet* _tmp71_; |
| 1268 | BalaSet* _tmp72_; |
| 1269 | BalaSet* _tmp73_; |
| 1270 | BalaSet* _tmp74_; |
| 1271 | BalaSet* _tmp75_; |
| 1272 | self = (BalaCCodeBaseModule*) bala_code_generator_construct (object_type); |
| 1273 | _tmp0_ = g_str_hash; |
| 1274 | _tmp1_ = g_str_equal; |
| 1275 | _tmp2_ = bala_hash_set_new (G_TYPE_STRING((GType) ((16) << (2))), (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp0_, _tmp1_); |
| 1276 | _bala_iterable_unref0 (self->predefined_marshal_set)((self->predefined_marshal_set == ((void*)0)) ? ((void*)0) : (self->predefined_marshal_set = (bala_iterable_unref (self ->predefined_marshal_set), ((void*)0)))); |
| 1277 | self->predefined_marshal_set = (BalaSet*) _tmp2_; |
| 1278 | _tmp3_ = self->predefined_marshal_set; |
| 1279 | bala_collection_add ((BalaCollection*) _tmp3_, "VOID:VOID"); |
| 1280 | _tmp4_ = self->predefined_marshal_set; |
| 1281 | bala_collection_add ((BalaCollection*) _tmp4_, "VOID:BOOLEAN"); |
| 1282 | _tmp5_ = self->predefined_marshal_set; |
| 1283 | bala_collection_add ((BalaCollection*) _tmp5_, "VOID:CHAR"); |
| 1284 | _tmp6_ = self->predefined_marshal_set; |
| 1285 | bala_collection_add ((BalaCollection*) _tmp6_, "VOID:UCHAR"); |
| 1286 | _tmp7_ = self->predefined_marshal_set; |
| 1287 | bala_collection_add ((BalaCollection*) _tmp7_, "VOID:INT"); |
| 1288 | _tmp8_ = self->predefined_marshal_set; |
| 1289 | bala_collection_add ((BalaCollection*) _tmp8_, "VOID:UINT"); |
| 1290 | _tmp9_ = self->predefined_marshal_set; |
| 1291 | bala_collection_add ((BalaCollection*) _tmp9_, "VOID:LONG"); |
| 1292 | _tmp10_ = self->predefined_marshal_set; |
| 1293 | bala_collection_add ((BalaCollection*) _tmp10_, "VOID:ULONG"); |
| 1294 | _tmp11_ = self->predefined_marshal_set; |
| 1295 | bala_collection_add ((BalaCollection*) _tmp11_, "VOID:ENUM"); |
| 1296 | _tmp12_ = self->predefined_marshal_set; |
| 1297 | bala_collection_add ((BalaCollection*) _tmp12_, "VOID:FLAGS"); |
| 1298 | _tmp13_ = self->predefined_marshal_set; |
| 1299 | bala_collection_add ((BalaCollection*) _tmp13_, "VOID:FLOAT"); |
| 1300 | _tmp14_ = self->predefined_marshal_set; |
| 1301 | bala_collection_add ((BalaCollection*) _tmp14_, "VOID:DOUBLE"); |
| 1302 | _tmp15_ = self->predefined_marshal_set; |
| 1303 | bala_collection_add ((BalaCollection*) _tmp15_, "VOID:STRING"); |
| 1304 | _tmp16_ = self->predefined_marshal_set; |
| 1305 | bala_collection_add ((BalaCollection*) _tmp16_, "VOID:POINTER"); |
| 1306 | _tmp17_ = self->predefined_marshal_set; |
| 1307 | bala_collection_add ((BalaCollection*) _tmp17_, "VOID:OBJECT"); |
| 1308 | _tmp18_ = self->predefined_marshal_set; |
| 1309 | bala_collection_add ((BalaCollection*) _tmp18_, "STRING:OBJECT,POINTER"); |
| 1310 | _tmp19_ = self->predefined_marshal_set; |
| 1311 | bala_collection_add ((BalaCollection*) _tmp19_, "VOID:UINT,POINTER"); |
| 1312 | _tmp20_ = self->predefined_marshal_set; |
| 1313 | bala_collection_add ((BalaCollection*) _tmp20_, "BOOLEAN:FLAGS"); |
| 1314 | _tmp21_ = self->predefined_marshal_set; |
| 1315 | bala_collection_add ((BalaCollection*) _tmp21_, "VOID:BOXED"); |
| 1316 | _tmp22_ = self->predefined_marshal_set; |
| 1317 | bala_collection_add ((BalaCollection*) _tmp22_, "VOID:VARIANT"); |
| 1318 | _tmp23_ = self->predefined_marshal_set; |
| 1319 | bala_collection_add ((BalaCollection*) _tmp23_, "BOOLEAN:BOXED,BOXED"); |
| 1320 | _tmp24_ = g_str_hash; |
| 1321 | _tmp25_ = g_str_equal; |
| 1322 | _tmp26_ = bala_hash_set_new (G_TYPE_STRING((GType) ((16) << (2))), (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp24_, _tmp25_); |
| 1323 | _bala_iterable_unref0 (bala_ccode_base_module_reserved_identifiers)((bala_ccode_base_module_reserved_identifiers == ((void*)0)) ? ((void*)0) : (bala_ccode_base_module_reserved_identifiers = ( bala_iterable_unref (bala_ccode_base_module_reserved_identifiers ), ((void*)0)))); |
| 1324 | bala_ccode_base_module_reserved_identifiers = (BalaSet*) _tmp26_; |
| 1325 | _tmp27_ = bala_ccode_base_module_reserved_identifiers; |
| 1326 | bala_collection_add ((BalaCollection*) _tmp27_, "_Bool"); |
| 1327 | _tmp28_ = bala_ccode_base_module_reserved_identifiers; |
| 1328 | bala_collection_add ((BalaCollection*) _tmp28_, "_Complex"); |
| 1329 | _tmp29_ = bala_ccode_base_module_reserved_identifiers; |
| 1330 | bala_collection_add ((BalaCollection*) _tmp29_, "_Imaginary"); |
| 1331 | _tmp30_ = bala_ccode_base_module_reserved_identifiers; |
| 1332 | bala_collection_add ((BalaCollection*) _tmp30_, "asm"); |
| 1333 | _tmp31_ = bala_ccode_base_module_reserved_identifiers; |
| 1334 | bala_collection_add ((BalaCollection*) _tmp31_, "auto"); |
| 1335 | _tmp32_ = bala_ccode_base_module_reserved_identifiers; |
| 1336 | bala_collection_add ((BalaCollection*) _tmp32_, "break"); |
| 1337 | _tmp33_ = bala_ccode_base_module_reserved_identifiers; |
| 1338 | bala_collection_add ((BalaCollection*) _tmp33_, "case"); |
| 1339 | _tmp34_ = bala_ccode_base_module_reserved_identifiers; |
| 1340 | bala_collection_add ((BalaCollection*) _tmp34_, "char"); |
| 1341 | _tmp35_ = bala_ccode_base_module_reserved_identifiers; |
| 1342 | bala_collection_add ((BalaCollection*) _tmp35_, "const"); |
| 1343 | _tmp36_ = bala_ccode_base_module_reserved_identifiers; |
| 1344 | bala_collection_add ((BalaCollection*) _tmp36_, "continue"); |
| 1345 | _tmp37_ = bala_ccode_base_module_reserved_identifiers; |
| 1346 | bala_collection_add ((BalaCollection*) _tmp37_, "default"); |
| 1347 | _tmp38_ = bala_ccode_base_module_reserved_identifiers; |
| 1348 | bala_collection_add ((BalaCollection*) _tmp38_, "do"); |
| 1349 | _tmp39_ = bala_ccode_base_module_reserved_identifiers; |
| 1350 | bala_collection_add ((BalaCollection*) _tmp39_, "double"); |
| 1351 | _tmp40_ = bala_ccode_base_module_reserved_identifiers; |
| 1352 | bala_collection_add ((BalaCollection*) _tmp40_, "else"); |
| 1353 | _tmp41_ = bala_ccode_base_module_reserved_identifiers; |
| 1354 | bala_collection_add ((BalaCollection*) _tmp41_, "enum"); |
| 1355 | _tmp42_ = bala_ccode_base_module_reserved_identifiers; |
| 1356 | bala_collection_add ((BalaCollection*) _tmp42_, "extern"); |
| 1357 | _tmp43_ = bala_ccode_base_module_reserved_identifiers; |
| 1358 | bala_collection_add ((BalaCollection*) _tmp43_, "float"); |
| 1359 | _tmp44_ = bala_ccode_base_module_reserved_identifiers; |
| 1360 | bala_collection_add ((BalaCollection*) _tmp44_, "for"); |
| 1361 | _tmp45_ = bala_ccode_base_module_reserved_identifiers; |
| 1362 | bala_collection_add ((BalaCollection*) _tmp45_, "goto"); |
| 1363 | _tmp46_ = bala_ccode_base_module_reserved_identifiers; |
| 1364 | bala_collection_add ((BalaCollection*) _tmp46_, "if"); |
| 1365 | _tmp47_ = bala_ccode_base_module_reserved_identifiers; |
| 1366 | bala_collection_add ((BalaCollection*) _tmp47_, "inline"); |
| 1367 | _tmp48_ = bala_ccode_base_module_reserved_identifiers; |
| 1368 | bala_collection_add ((BalaCollection*) _tmp48_, "int"); |
| 1369 | _tmp49_ = bala_ccode_base_module_reserved_identifiers; |
| 1370 | bala_collection_add ((BalaCollection*) _tmp49_, "long"); |
| 1371 | _tmp50_ = bala_ccode_base_module_reserved_identifiers; |
| 1372 | bala_collection_add ((BalaCollection*) _tmp50_, "register"); |
| 1373 | _tmp51_ = bala_ccode_base_module_reserved_identifiers; |
| 1374 | bala_collection_add ((BalaCollection*) _tmp51_, "restrict"); |
| 1375 | _tmp52_ = bala_ccode_base_module_reserved_identifiers; |
| 1376 | bala_collection_add ((BalaCollection*) _tmp52_, "return"); |
| 1377 | _tmp53_ = bala_ccode_base_module_reserved_identifiers; |
| 1378 | bala_collection_add ((BalaCollection*) _tmp53_, "short"); |
| 1379 | _tmp54_ = bala_ccode_base_module_reserved_identifiers; |
| 1380 | bala_collection_add ((BalaCollection*) _tmp54_, "signed"); |
| 1381 | _tmp55_ = bala_ccode_base_module_reserved_identifiers; |
| 1382 | bala_collection_add ((BalaCollection*) _tmp55_, "sizeof"); |
| 1383 | _tmp56_ = bala_ccode_base_module_reserved_identifiers; |
| 1384 | bala_collection_add ((BalaCollection*) _tmp56_, "static"); |
| 1385 | _tmp57_ = bala_ccode_base_module_reserved_identifiers; |
| 1386 | bala_collection_add ((BalaCollection*) _tmp57_, "struct"); |
| 1387 | _tmp58_ = bala_ccode_base_module_reserved_identifiers; |
| 1388 | bala_collection_add ((BalaCollection*) _tmp58_, "switch"); |
| 1389 | _tmp59_ = bala_ccode_base_module_reserved_identifiers; |
| 1390 | bala_collection_add ((BalaCollection*) _tmp59_, "typedef"); |
| 1391 | _tmp60_ = bala_ccode_base_module_reserved_identifiers; |
| 1392 | bala_collection_add ((BalaCollection*) _tmp60_, "union"); |
| 1393 | _tmp61_ = bala_ccode_base_module_reserved_identifiers; |
| 1394 | bala_collection_add ((BalaCollection*) _tmp61_, "unsigned"); |
| 1395 | _tmp62_ = bala_ccode_base_module_reserved_identifiers; |
| 1396 | bala_collection_add ((BalaCollection*) _tmp62_, "void"); |
| 1397 | _tmp63_ = bala_ccode_base_module_reserved_identifiers; |
| 1398 | bala_collection_add ((BalaCollection*) _tmp63_, "volatile"); |
| 1399 | _tmp64_ = bala_ccode_base_module_reserved_identifiers; |
| 1400 | bala_collection_add ((BalaCollection*) _tmp64_, "while"); |
| 1401 | _tmp65_ = bala_ccode_base_module_reserved_identifiers; |
| 1402 | bala_collection_add ((BalaCollection*) _tmp65_, "_Alignas"); |
| 1403 | _tmp66_ = bala_ccode_base_module_reserved_identifiers; |
| 1404 | bala_collection_add ((BalaCollection*) _tmp66_, "_Alignof"); |
| 1405 | _tmp67_ = bala_ccode_base_module_reserved_identifiers; |
| 1406 | bala_collection_add ((BalaCollection*) _tmp67_, "_Atomic"); |
| 1407 | _tmp68_ = bala_ccode_base_module_reserved_identifiers; |
| 1408 | bala_collection_add ((BalaCollection*) _tmp68_, "_Generic"); |
| 1409 | _tmp69_ = bala_ccode_base_module_reserved_identifiers; |
| 1410 | bala_collection_add ((BalaCollection*) _tmp69_, "_Noreturn"); |
| 1411 | _tmp70_ = bala_ccode_base_module_reserved_identifiers; |
| 1412 | bala_collection_add ((BalaCollection*) _tmp70_, "_Static_assert"); |
| 1413 | _tmp71_ = bala_ccode_base_module_reserved_identifiers; |
| 1414 | bala_collection_add ((BalaCollection*) _tmp71_, "_Thread_local"); |
| 1415 | _tmp72_ = bala_ccode_base_module_reserved_identifiers; |
| 1416 | bala_collection_add ((BalaCollection*) _tmp72_, "cdecl"); |
| 1417 | _tmp73_ = bala_ccode_base_module_reserved_identifiers; |
| 1418 | bala_collection_add ((BalaCollection*) _tmp73_, "error"); |
| 1419 | _tmp74_ = bala_ccode_base_module_reserved_identifiers; |
| 1420 | bala_collection_add ((BalaCollection*) _tmp74_, "result"); |
| 1421 | _tmp75_ = bala_ccode_base_module_reserved_identifiers; |
| 1422 | bala_collection_add ((BalaCollection*) _tmp75_, "self"); |
| 1423 | return self; |
| 1424 | } |
| 1425 | |
| 1426 | static gpointer |
| 1427 | _bala_iterable_ref0 (gpointer self) |
| 1428 | { |
| 1429 | return self ? bala_iterable_ref (self) : NULL((void*)0); |
| 1430 | } |
| 1431 | |
| 1432 | static void |
| 1433 | bala_ccode_base_module_real_emit (BalaCodeGenerator* base, |
| 1434 | BalaCodeContext* context) |
| 1435 | { |
| 1436 | BalaCCodeBaseModule * self; |
| 1437 | BalaNamespace* _tmp0_; |
| 1438 | BalaNamespace* _tmp1_; |
| 1439 | BalaSymbol* _tmp2_; |
| 1440 | BalaSymbol* _tmp3_; |
| 1441 | BalaScope* _tmp4_; |
| 1442 | BalaScope* _tmp5_; |
| 1443 | BalaSymbol* _tmp6_; |
| 1444 | BalaStruct* _tmp7_; |
| 1445 | BalaBooleanType* _tmp8_; |
| 1446 | BalaSymbol* _tmp9_; |
| 1447 | BalaScope* _tmp10_; |
| 1448 | BalaScope* _tmp11_; |
| 1449 | BalaSymbol* _tmp12_; |
| 1450 | BalaStruct* _tmp13_; |
| 1451 | BalaIntegerType* _tmp14_; |
| 1452 | BalaSymbol* _tmp15_; |
| 1453 | BalaScope* _tmp16_; |
| 1454 | BalaScope* _tmp17_; |
| 1455 | BalaSymbol* _tmp18_; |
| 1456 | BalaStruct* _tmp19_; |
| 1457 | BalaIntegerType* _tmp20_; |
| 1458 | BalaSymbol* _tmp21_; |
| 1459 | BalaScope* _tmp22_; |
| 1460 | BalaScope* _tmp23_; |
| 1461 | BalaSymbol* _tmp24_; |
| 1462 | BalaStruct* _tmp25_; |
| 1463 | BalaIntegerType* _tmp26_; |
| 1464 | BalaSymbol* _tmp27_; |
| 1465 | BalaScope* _tmp28_; |
| 1466 | BalaScope* _tmp29_; |
| 1467 | BalaSymbol* _tmp30_; |
| 1468 | BalaStruct* _tmp31_; |
| 1469 | BalaIntegerType* _tmp32_; |
| 1470 | BalaSymbol* _tmp33_; |
| 1471 | BalaScope* _tmp34_; |
| 1472 | BalaScope* _tmp35_; |
| 1473 | BalaSymbol* _tmp36_; |
| 1474 | BalaStruct* _tmp37_; |
| 1475 | BalaIntegerType* _tmp38_; |
| 1476 | BalaSymbol* _tmp39_; |
| 1477 | BalaScope* _tmp40_; |
| 1478 | BalaScope* _tmp41_; |
| 1479 | BalaSymbol* _tmp42_; |
| 1480 | BalaStruct* _tmp43_; |
| 1481 | BalaIntegerType* _tmp44_; |
| 1482 | BalaSymbol* _tmp45_; |
| 1483 | BalaScope* _tmp46_; |
| 1484 | BalaScope* _tmp47_; |
| 1485 | BalaSymbol* _tmp48_; |
| 1486 | BalaStruct* _tmp49_; |
| 1487 | BalaIntegerType* _tmp50_; |
| 1488 | BalaSymbol* _tmp51_; |
| 1489 | BalaScope* _tmp52_; |
| 1490 | BalaScope* _tmp53_; |
| 1491 | BalaSymbol* _tmp54_; |
| 1492 | BalaStruct* _tmp55_; |
| 1493 | BalaIntegerType* _tmp56_; |
| 1494 | BalaSymbol* _tmp57_; |
| 1495 | BalaScope* _tmp58_; |
| 1496 | BalaScope* _tmp59_; |
| 1497 | BalaSymbol* _tmp60_; |
| 1498 | BalaStruct* _tmp61_; |
| 1499 | BalaIntegerType* _tmp62_; |
| 1500 | BalaSymbol* _tmp63_; |
| 1501 | BalaScope* _tmp64_; |
| 1502 | BalaScope* _tmp65_; |
| 1503 | BalaSymbol* _tmp66_; |
| 1504 | BalaStruct* _tmp67_; |
| 1505 | BalaIntegerType* _tmp68_; |
| 1506 | BalaSymbol* _tmp69_; |
| 1507 | BalaScope* _tmp70_; |
| 1508 | BalaScope* _tmp71_; |
| 1509 | BalaSymbol* _tmp72_; |
| 1510 | BalaStruct* _tmp73_; |
| 1511 | BalaIntegerType* _tmp74_; |
| 1512 | BalaSymbol* _tmp75_; |
| 1513 | BalaScope* _tmp76_; |
| 1514 | BalaScope* _tmp77_; |
| 1515 | BalaSymbol* _tmp78_; |
| 1516 | BalaStruct* _tmp79_; |
| 1517 | BalaIntegerType* _tmp80_; |
| 1518 | BalaSymbol* _tmp81_; |
| 1519 | BalaScope* _tmp82_; |
| 1520 | BalaScope* _tmp83_; |
| 1521 | BalaSymbol* _tmp84_; |
| 1522 | BalaStruct* _tmp85_; |
| 1523 | BalaIntegerType* _tmp86_; |
| 1524 | BalaSymbol* _tmp87_; |
| 1525 | BalaScope* _tmp88_; |
| 1526 | BalaScope* _tmp89_; |
| 1527 | BalaSymbol* _tmp90_; |
| 1528 | BalaStruct* _tmp91_; |
| 1529 | BalaIntegerType* _tmp92_; |
| 1530 | BalaSymbol* _tmp93_; |
| 1531 | BalaScope* _tmp94_; |
| 1532 | BalaScope* _tmp95_; |
| 1533 | BalaSymbol* _tmp96_; |
| 1534 | BalaStruct* _tmp97_; |
| 1535 | BalaIntegerType* _tmp98_; |
| 1536 | BalaSymbol* _tmp99_; |
| 1537 | BalaScope* _tmp100_; |
| 1538 | BalaScope* _tmp101_; |
| 1539 | BalaSymbol* _tmp102_; |
| 1540 | BalaStruct* _tmp103_; |
| 1541 | BalaIntegerType* _tmp104_; |
| 1542 | BalaSymbol* _tmp105_; |
| 1543 | BalaScope* _tmp106_; |
| 1544 | BalaScope* _tmp107_; |
| 1545 | BalaSymbol* _tmp108_; |
| 1546 | BalaStruct* _tmp109_; |
| 1547 | BalaIntegerType* _tmp110_; |
| 1548 | BalaSymbol* _tmp111_; |
| 1549 | BalaScope* _tmp112_; |
| 1550 | BalaScope* _tmp113_; |
| 1551 | BalaSymbol* _tmp114_; |
| 1552 | BalaStruct* _tmp115_; |
| 1553 | BalaFloatingType* _tmp116_; |
| 1554 | BalaSymbol* _tmp117_; |
| 1555 | BalaScope* _tmp118_; |
| 1556 | BalaScope* _tmp119_; |
| 1557 | BalaSymbol* _tmp120_; |
| 1558 | BalaStruct* _tmp121_; |
| 1559 | BalaFloatingType* _tmp122_; |
| 1560 | BalaSymbol* _tmp123_; |
| 1561 | BalaScope* _tmp124_; |
| 1562 | BalaScope* _tmp125_; |
| 1563 | BalaSymbol* _tmp126_; |
| 1564 | BalaClass* _tmp127_; |
| 1565 | BalaObjectType* _tmp128_; |
| 1566 | BalaStruct* unichar_struct = NULL((void*)0); |
| 1567 | BalaSymbol* _tmp129_; |
| 1568 | BalaScope* _tmp130_; |
| 1569 | BalaScope* _tmp131_; |
| 1570 | BalaSymbol* _tmp132_; |
| 1571 | BalaStruct* _tmp133_; |
| 1572 | BalaProfile _tmp136_; |
| 1573 | BalaProfile _tmp137_; |
| 1574 | BalaSymbol* gtk_ns = NULL((void*)0); |
| 1575 | BalaSymbol* _tmp312_; |
| 1576 | BalaScope* _tmp313_; |
| 1577 | BalaScope* _tmp314_; |
| 1578 | BalaSymbol* _tmp315_; |
| 1579 | BalaSymbol* _tmp316_; |
| 1580 | BalaCCodeFile* _tmp321_; |
| 1581 | BalaCCodeFile* _tmp322_; |
| 1582 | BalaCCodeFile* _tmp323_; |
| 1583 | BalaCCodeFile* _tmp324_; |
| 1584 | BalaList* source_files = NULL((void*)0); |
| 1585 | BalaList* _tmp325_; |
| 1586 | BalaList* _tmp326_; |
| 1587 | const gchar* _tmp347_; |
| 1588 | const gchar* _tmp348_; |
| 1589 | const gchar* _tmp369_; |
| 1590 | const gchar* _tmp370_; |
| 1591 | const gchar* _tmp388_; |
| 1592 | const gchar* _tmp389_; |
| 1593 | self = (BalaCCodeBaseModule*) base; |
| 1594 | g_return_if_fail (context != NULL)do { if ((context != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "context != NULL" ); return; } } while (0); |
| 1595 | bala_ccode_base_module_set_context (self, context); |
| 1596 | _tmp0_ = bala_code_context_get_root (context); |
| 1597 | _tmp1_ = _tmp0_; |
| 1598 | _tmp2_ = _bala_code_node_ref0 ((BalaSymbol*) _tmp1_); |
| 1599 | _bala_code_node_unref0 (self->root_symbol)((self->root_symbol == ((void*)0)) ? ((void*)0) : (self-> root_symbol = (bala_code_node_unref (self->root_symbol), ( (void*)0)))); |
| 1600 | self->root_symbol = _tmp2_; |
| 1601 | _tmp3_ = self->root_symbol; |
| 1602 | _tmp4_ = bala_symbol_get_scope (_tmp3_); |
| 1603 | _tmp5_ = _tmp4_; |
| 1604 | _tmp6_ = bala_scope_lookup (_tmp5_, "bool"); |
| 1605 | _tmp7_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp6_), ((bala_struct_get_type ()))))); |
| 1606 | _tmp8_ = bala_boolean_type_new (_tmp7_); |
| 1607 | _bala_code_node_unref0 (self->bool_type)((self->bool_type == ((void*)0)) ? ((void*)0) : (self-> bool_type = (bala_code_node_unref (self->bool_type), ((void *)0)))); |
| 1608 | self->bool_type = (BalaDataType*) _tmp8_; |
| 1609 | _bala_code_node_unref0 (_tmp7_)((_tmp7_ == ((void*)0)) ? ((void*)0) : (_tmp7_ = (bala_code_node_unref (_tmp7_), ((void*)0)))); |
| 1610 | _tmp9_ = self->root_symbol; |
| 1611 | _tmp10_ = bala_symbol_get_scope (_tmp9_); |
| 1612 | _tmp11_ = _tmp10_; |
| 1613 | _tmp12_ = bala_scope_lookup (_tmp11_, "char"); |
| 1614 | _tmp13_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp12_), ((bala_struct_get_type ()))))); |
| 1615 | _tmp14_ = bala_integer_type_new (_tmp13_, NULL((void*)0), NULL((void*)0)); |
| 1616 | _bala_code_node_unref0 (self->char_type)((self->char_type == ((void*)0)) ? ((void*)0) : (self-> char_type = (bala_code_node_unref (self->char_type), ((void *)0)))); |
| 1617 | self->char_type = (BalaDataType*) _tmp14_; |
| 1618 | _bala_code_node_unref0 (_tmp13_)((_tmp13_ == ((void*)0)) ? ((void*)0) : (_tmp13_ = (bala_code_node_unref (_tmp13_), ((void*)0)))); |
| 1619 | _tmp15_ = self->root_symbol; |
| 1620 | _tmp16_ = bala_symbol_get_scope (_tmp15_); |
| 1621 | _tmp17_ = _tmp16_; |
| 1622 | _tmp18_ = bala_scope_lookup (_tmp17_, "uchar"); |
| 1623 | _tmp19_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp18_), ((bala_struct_get_type ()))))); |
| 1624 | _tmp20_ = bala_integer_type_new (_tmp19_, NULL((void*)0), NULL((void*)0)); |
| 1625 | _bala_code_node_unref0 (self->uchar_type)((self->uchar_type == ((void*)0)) ? ((void*)0) : (self-> uchar_type = (bala_code_node_unref (self->uchar_type), ((void *)0)))); |
| 1626 | self->uchar_type = (BalaDataType*) _tmp20_; |
| 1627 | _bala_code_node_unref0 (_tmp19_)((_tmp19_ == ((void*)0)) ? ((void*)0) : (_tmp19_ = (bala_code_node_unref (_tmp19_), ((void*)0)))); |
| 1628 | _tmp21_ = self->root_symbol; |
| 1629 | _tmp22_ = bala_symbol_get_scope (_tmp21_); |
| 1630 | _tmp23_ = _tmp22_; |
| 1631 | _tmp24_ = bala_scope_lookup (_tmp23_, "short"); |
| 1632 | _tmp25_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp24_), ((bala_struct_get_type ()))))); |
| 1633 | _tmp26_ = bala_integer_type_new (_tmp25_, NULL((void*)0), NULL((void*)0)); |
| 1634 | _bala_code_node_unref0 (self->short_type)((self->short_type == ((void*)0)) ? ((void*)0) : (self-> short_type = (bala_code_node_unref (self->short_type), ((void *)0)))); |
| 1635 | self->short_type = (BalaDataType*) _tmp26_; |
| 1636 | _bala_code_node_unref0 (_tmp25_)((_tmp25_ == ((void*)0)) ? ((void*)0) : (_tmp25_ = (bala_code_node_unref (_tmp25_), ((void*)0)))); |
| 1637 | _tmp27_ = self->root_symbol; |
| 1638 | _tmp28_ = bala_symbol_get_scope (_tmp27_); |
| 1639 | _tmp29_ = _tmp28_; |
| 1640 | _tmp30_ = bala_scope_lookup (_tmp29_, "ushort"); |
| 1641 | _tmp31_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp30_), ((bala_struct_get_type ()))))); |
| 1642 | _tmp32_ = bala_integer_type_new (_tmp31_, NULL((void*)0), NULL((void*)0)); |
| 1643 | _bala_code_node_unref0 (self->ushort_type)((self->ushort_type == ((void*)0)) ? ((void*)0) : (self-> ushort_type = (bala_code_node_unref (self->ushort_type), ( (void*)0)))); |
| 1644 | self->ushort_type = (BalaDataType*) _tmp32_; |
| 1645 | _bala_code_node_unref0 (_tmp31_)((_tmp31_ == ((void*)0)) ? ((void*)0) : (_tmp31_ = (bala_code_node_unref (_tmp31_), ((void*)0)))); |
| 1646 | _tmp33_ = self->root_symbol; |
| 1647 | _tmp34_ = bala_symbol_get_scope (_tmp33_); |
| 1648 | _tmp35_ = _tmp34_; |
| 1649 | _tmp36_ = bala_scope_lookup (_tmp35_, "int"); |
| 1650 | _tmp37_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp36_), ((bala_struct_get_type ()))))); |
| 1651 | _tmp38_ = bala_integer_type_new (_tmp37_, NULL((void*)0), NULL((void*)0)); |
| 1652 | _bala_code_node_unref0 (self->int_type)((self->int_type == ((void*)0)) ? ((void*)0) : (self->int_type = (bala_code_node_unref (self->int_type), ((void*)0)))); |
| 1653 | self->int_type = (BalaDataType*) _tmp38_; |
| 1654 | _bala_code_node_unref0 (_tmp37_)((_tmp37_ == ((void*)0)) ? ((void*)0) : (_tmp37_ = (bala_code_node_unref (_tmp37_), ((void*)0)))); |
| 1655 | _tmp39_ = self->root_symbol; |
| 1656 | _tmp40_ = bala_symbol_get_scope (_tmp39_); |
| 1657 | _tmp41_ = _tmp40_; |
| 1658 | _tmp42_ = bala_scope_lookup (_tmp41_, "uint"); |
| 1659 | _tmp43_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp42_), ((bala_struct_get_type ()))))); |
| 1660 | _tmp44_ = bala_integer_type_new (_tmp43_, NULL((void*)0), NULL((void*)0)); |
| 1661 | _bala_code_node_unref0 (self->uint_type)((self->uint_type == ((void*)0)) ? ((void*)0) : (self-> uint_type = (bala_code_node_unref (self->uint_type), ((void *)0)))); |
| 1662 | self->uint_type = (BalaDataType*) _tmp44_; |
| 1663 | _bala_code_node_unref0 (_tmp43_)((_tmp43_ == ((void*)0)) ? ((void*)0) : (_tmp43_ = (bala_code_node_unref (_tmp43_), ((void*)0)))); |
| 1664 | _tmp45_ = self->root_symbol; |
| 1665 | _tmp46_ = bala_symbol_get_scope (_tmp45_); |
| 1666 | _tmp47_ = _tmp46_; |
| 1667 | _tmp48_ = bala_scope_lookup (_tmp47_, "long"); |
| 1668 | _tmp49_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp48_), ((bala_struct_get_type ()))))); |
| 1669 | _tmp50_ = bala_integer_type_new (_tmp49_, NULL((void*)0), NULL((void*)0)); |
| 1670 | _bala_code_node_unref0 (self->long_type)((self->long_type == ((void*)0)) ? ((void*)0) : (self-> long_type = (bala_code_node_unref (self->long_type), ((void *)0)))); |
| 1671 | self->long_type = (BalaDataType*) _tmp50_; |
| 1672 | _bala_code_node_unref0 (_tmp49_)((_tmp49_ == ((void*)0)) ? ((void*)0) : (_tmp49_ = (bala_code_node_unref (_tmp49_), ((void*)0)))); |
| 1673 | _tmp51_ = self->root_symbol; |
| 1674 | _tmp52_ = bala_symbol_get_scope (_tmp51_); |
| 1675 | _tmp53_ = _tmp52_; |
| 1676 | _tmp54_ = bala_scope_lookup (_tmp53_, "ulong"); |
| 1677 | _tmp55_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp54_), ((bala_struct_get_type ()))))); |
| 1678 | _tmp56_ = bala_integer_type_new (_tmp55_, NULL((void*)0), NULL((void*)0)); |
| 1679 | _bala_code_node_unref0 (self->ulong_type)((self->ulong_type == ((void*)0)) ? ((void*)0) : (self-> ulong_type = (bala_code_node_unref (self->ulong_type), ((void *)0)))); |
| 1680 | self->ulong_type = (BalaDataType*) _tmp56_; |
| 1681 | _bala_code_node_unref0 (_tmp55_)((_tmp55_ == ((void*)0)) ? ((void*)0) : (_tmp55_ = (bala_code_node_unref (_tmp55_), ((void*)0)))); |
| 1682 | _tmp57_ = self->root_symbol; |
| 1683 | _tmp58_ = bala_symbol_get_scope (_tmp57_); |
| 1684 | _tmp59_ = _tmp58_; |
| 1685 | _tmp60_ = bala_scope_lookup (_tmp59_, "int8"); |
| 1686 | _tmp61_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp60_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp60_), ((bala_struct_get_type ()))))); |
| 1687 | _tmp62_ = bala_integer_type_new (_tmp61_, NULL((void*)0), NULL((void*)0)); |
| 1688 | _bala_code_node_unref0 (self->int8_type)((self->int8_type == ((void*)0)) ? ((void*)0) : (self-> int8_type = (bala_code_node_unref (self->int8_type), ((void *)0)))); |
| 1689 | self->int8_type = (BalaDataType*) _tmp62_; |
| 1690 | _bala_code_node_unref0 (_tmp61_)((_tmp61_ == ((void*)0)) ? ((void*)0) : (_tmp61_ = (bala_code_node_unref (_tmp61_), ((void*)0)))); |
| 1691 | _tmp63_ = self->root_symbol; |
| 1692 | _tmp64_ = bala_symbol_get_scope (_tmp63_); |
| 1693 | _tmp65_ = _tmp64_; |
| 1694 | _tmp66_ = bala_scope_lookup (_tmp65_, "uint8"); |
| 1695 | _tmp67_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp66_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp66_), ((bala_struct_get_type ()))))); |
| 1696 | _tmp68_ = bala_integer_type_new (_tmp67_, NULL((void*)0), NULL((void*)0)); |
| 1697 | _bala_code_node_unref0 (self->uint8_type)((self->uint8_type == ((void*)0)) ? ((void*)0) : (self-> uint8_type = (bala_code_node_unref (self->uint8_type), ((void *)0)))); |
| 1698 | self->uint8_type = (BalaDataType*) _tmp68_; |
| 1699 | _bala_code_node_unref0 (_tmp67_)((_tmp67_ == ((void*)0)) ? ((void*)0) : (_tmp67_ = (bala_code_node_unref (_tmp67_), ((void*)0)))); |
| 1700 | _tmp69_ = self->root_symbol; |
| 1701 | _tmp70_ = bala_symbol_get_scope (_tmp69_); |
| 1702 | _tmp71_ = _tmp70_; |
| 1703 | _tmp72_ = bala_scope_lookup (_tmp71_, "int16"); |
| 1704 | _tmp73_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp72_), ((bala_struct_get_type ()))))); |
| 1705 | _tmp74_ = bala_integer_type_new (_tmp73_, NULL((void*)0), NULL((void*)0)); |
| 1706 | _bala_code_node_unref0 (self->int16_type)((self->int16_type == ((void*)0)) ? ((void*)0) : (self-> int16_type = (bala_code_node_unref (self->int16_type), ((void *)0)))); |
| 1707 | self->int16_type = (BalaDataType*) _tmp74_; |
| 1708 | _bala_code_node_unref0 (_tmp73_)((_tmp73_ == ((void*)0)) ? ((void*)0) : (_tmp73_ = (bala_code_node_unref (_tmp73_), ((void*)0)))); |
| 1709 | _tmp75_ = self->root_symbol; |
| 1710 | _tmp76_ = bala_symbol_get_scope (_tmp75_); |
| 1711 | _tmp77_ = _tmp76_; |
| 1712 | _tmp78_ = bala_scope_lookup (_tmp77_, "uint16"); |
| 1713 | _tmp79_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp78_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp78_), ((bala_struct_get_type ()))))); |
| 1714 | _tmp80_ = bala_integer_type_new (_tmp79_, NULL((void*)0), NULL((void*)0)); |
| 1715 | _bala_code_node_unref0 (self->uint16_type)((self->uint16_type == ((void*)0)) ? ((void*)0) : (self-> uint16_type = (bala_code_node_unref (self->uint16_type), ( (void*)0)))); |
| 1716 | self->uint16_type = (BalaDataType*) _tmp80_; |
| 1717 | _bala_code_node_unref0 (_tmp79_)((_tmp79_ == ((void*)0)) ? ((void*)0) : (_tmp79_ = (bala_code_node_unref (_tmp79_), ((void*)0)))); |
| 1718 | _tmp81_ = self->root_symbol; |
| 1719 | _tmp82_ = bala_symbol_get_scope (_tmp81_); |
| 1720 | _tmp83_ = _tmp82_; |
| 1721 | _tmp84_ = bala_scope_lookup (_tmp83_, "int32"); |
| 1722 | _tmp85_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp84_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp84_), ((bala_struct_get_type ()))))); |
| 1723 | _tmp86_ = bala_integer_type_new (_tmp85_, NULL((void*)0), NULL((void*)0)); |
| 1724 | _bala_code_node_unref0 (self->int32_type)((self->int32_type == ((void*)0)) ? ((void*)0) : (self-> int32_type = (bala_code_node_unref (self->int32_type), ((void *)0)))); |
| 1725 | self->int32_type = (BalaDataType*) _tmp86_; |
| 1726 | _bala_code_node_unref0 (_tmp85_)((_tmp85_ == ((void*)0)) ? ((void*)0) : (_tmp85_ = (bala_code_node_unref (_tmp85_), ((void*)0)))); |
| 1727 | _tmp87_ = self->root_symbol; |
| 1728 | _tmp88_ = bala_symbol_get_scope (_tmp87_); |
| 1729 | _tmp89_ = _tmp88_; |
| 1730 | _tmp90_ = bala_scope_lookup (_tmp89_, "uint32"); |
| 1731 | _tmp91_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp90_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp90_), ((bala_struct_get_type ()))))); |
| 1732 | _tmp92_ = bala_integer_type_new (_tmp91_, NULL((void*)0), NULL((void*)0)); |
| 1733 | _bala_code_node_unref0 (self->uint32_type)((self->uint32_type == ((void*)0)) ? ((void*)0) : (self-> uint32_type = (bala_code_node_unref (self->uint32_type), ( (void*)0)))); |
| 1734 | self->uint32_type = (BalaDataType*) _tmp92_; |
| 1735 | _bala_code_node_unref0 (_tmp91_)((_tmp91_ == ((void*)0)) ? ((void*)0) : (_tmp91_ = (bala_code_node_unref (_tmp91_), ((void*)0)))); |
| 1736 | _tmp93_ = self->root_symbol; |
| 1737 | _tmp94_ = bala_symbol_get_scope (_tmp93_); |
| 1738 | _tmp95_ = _tmp94_; |
| 1739 | _tmp96_ = bala_scope_lookup (_tmp95_, "int64"); |
| 1740 | _tmp97_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp96_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp96_), ((bala_struct_get_type ()))))); |
| 1741 | _tmp98_ = bala_integer_type_new (_tmp97_, NULL((void*)0), NULL((void*)0)); |
| 1742 | _bala_code_node_unref0 (self->int64_type)((self->int64_type == ((void*)0)) ? ((void*)0) : (self-> int64_type = (bala_code_node_unref (self->int64_type), ((void *)0)))); |
| 1743 | self->int64_type = (BalaDataType*) _tmp98_; |
| 1744 | _bala_code_node_unref0 (_tmp97_)((_tmp97_ == ((void*)0)) ? ((void*)0) : (_tmp97_ = (bala_code_node_unref (_tmp97_), ((void*)0)))); |
| 1745 | _tmp99_ = self->root_symbol; |
| 1746 | _tmp100_ = bala_symbol_get_scope (_tmp99_); |
| 1747 | _tmp101_ = _tmp100_; |
| 1748 | _tmp102_ = bala_scope_lookup (_tmp101_, "uint64"); |
| 1749 | _tmp103_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp102_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp102_), ((bala_struct_get_type ()))))); |
| 1750 | _tmp104_ = bala_integer_type_new (_tmp103_, NULL((void*)0), NULL((void*)0)); |
| 1751 | _bala_code_node_unref0 (self->uint64_type)((self->uint64_type == ((void*)0)) ? ((void*)0) : (self-> uint64_type = (bala_code_node_unref (self->uint64_type), ( (void*)0)))); |
| 1752 | self->uint64_type = (BalaDataType*) _tmp104_; |
| 1753 | _bala_code_node_unref0 (_tmp103_)((_tmp103_ == ((void*)0)) ? ((void*)0) : (_tmp103_ = (bala_code_node_unref (_tmp103_), ((void*)0)))); |
| 1754 | _tmp105_ = self->root_symbol; |
| 1755 | _tmp106_ = bala_symbol_get_scope (_tmp105_); |
| 1756 | _tmp107_ = _tmp106_; |
| 1757 | _tmp108_ = bala_scope_lookup (_tmp107_, "size_t"); |
| 1758 | _tmp109_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp108_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp108_), ((bala_struct_get_type ()))))); |
| 1759 | _tmp110_ = bala_integer_type_new (_tmp109_, NULL((void*)0), NULL((void*)0)); |
| 1760 | _bala_code_node_unref0 (self->size_t_type)((self->size_t_type == ((void*)0)) ? ((void*)0) : (self-> size_t_type = (bala_code_node_unref (self->size_t_type), ( (void*)0)))); |
| 1761 | self->size_t_type = (BalaDataType*) _tmp110_; |
| 1762 | _bala_code_node_unref0 (_tmp109_)((_tmp109_ == ((void*)0)) ? ((void*)0) : (_tmp109_ = (bala_code_node_unref (_tmp109_), ((void*)0)))); |
| 1763 | _tmp111_ = self->root_symbol; |
| 1764 | _tmp112_ = bala_symbol_get_scope (_tmp111_); |
| 1765 | _tmp113_ = _tmp112_; |
| 1766 | _tmp114_ = bala_scope_lookup (_tmp113_, "float"); |
| 1767 | _tmp115_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp114_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp114_), ((bala_struct_get_type ()))))); |
| 1768 | _tmp116_ = bala_floating_type_new (_tmp115_); |
| 1769 | _bala_code_node_unref0 (self->float_type)((self->float_type == ((void*)0)) ? ((void*)0) : (self-> float_type = (bala_code_node_unref (self->float_type), ((void *)0)))); |
| 1770 | self->float_type = (BalaDataType*) _tmp116_; |
| 1771 | _bala_code_node_unref0 (_tmp115_)((_tmp115_ == ((void*)0)) ? ((void*)0) : (_tmp115_ = (bala_code_node_unref (_tmp115_), ((void*)0)))); |
| 1772 | _tmp117_ = self->root_symbol; |
| 1773 | _tmp118_ = bala_symbol_get_scope (_tmp117_); |
| 1774 | _tmp119_ = _tmp118_; |
| 1775 | _tmp120_ = bala_scope_lookup (_tmp119_, "double"); |
| 1776 | _tmp121_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp120_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp120_), ((bala_struct_get_type ()))))); |
| 1777 | _tmp122_ = bala_floating_type_new (_tmp121_); |
| 1778 | _bala_code_node_unref0 (self->double_type)((self->double_type == ((void*)0)) ? ((void*)0) : (self-> double_type = (bala_code_node_unref (self->double_type), ( (void*)0)))); |
| 1779 | self->double_type = (BalaDataType*) _tmp122_; |
| 1780 | _bala_code_node_unref0 (_tmp121_)((_tmp121_ == ((void*)0)) ? ((void*)0) : (_tmp121_ = (bala_code_node_unref (_tmp121_), ((void*)0)))); |
| 1781 | _tmp123_ = self->root_symbol; |
| 1782 | _tmp124_ = bala_symbol_get_scope (_tmp123_); |
| 1783 | _tmp125_ = _tmp124_; |
| 1784 | _tmp126_ = bala_scope_lookup (_tmp125_, "string"); |
| 1785 | _tmp127_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp126_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp126_), ((bala_class_get_type ()))))); |
| 1786 | _tmp128_ = bala_object_type_new ((BalaObjectTypeSymbol*) _tmp127_); |
| 1787 | _bala_code_node_unref0 (self->string_type)((self->string_type == ((void*)0)) ? ((void*)0) : (self-> string_type = (bala_code_node_unref (self->string_type), ( (void*)0)))); |
| 1788 | self->string_type = (BalaDataType*) _tmp128_; |
| 1789 | _bala_code_node_unref0 (_tmp127_)((_tmp127_ == ((void*)0)) ? ((void*)0) : (_tmp127_ = (bala_code_node_unref (_tmp127_), ((void*)0)))); |
| 1790 | _tmp129_ = self->root_symbol; |
| 1791 | _tmp130_ = bala_symbol_get_scope (_tmp129_); |
| 1792 | _tmp131_ = _tmp130_; |
| 1793 | _tmp132_ = bala_scope_lookup (_tmp131_, "unichar"); |
| 1794 | unichar_struct = G_TYPE_CHECK_INSTANCE_CAST (_tmp132_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp132_), ((bala_struct_get_type ()))))); |
| 1795 | _tmp133_ = unichar_struct; |
| 1796 | if (_tmp133_ != NULL((void*)0)) { |
| 1797 | BalaStruct* _tmp134_; |
| 1798 | BalaIntegerType* _tmp135_; |
| 1799 | _tmp134_ = unichar_struct; |
| 1800 | _tmp135_ = bala_integer_type_new (_tmp134_, NULL((void*)0), NULL((void*)0)); |
| 1801 | _bala_code_node_unref0 (self->unichar_type)((self->unichar_type == ((void*)0)) ? ((void*)0) : (self-> unichar_type = (bala_code_node_unref (self->unichar_type), ((void*)0)))); |
| 1802 | self->unichar_type = (BalaDataType*) _tmp135_; |
| 1803 | } |
| 1804 | _tmp136_ = bala_code_context_get_profile (context); |
| 1805 | _tmp137_ = _tmp136_; |
| 1806 | if (_tmp137_ == BALA_PROFILE_GOBJECT) { |
| 1807 | BalaSymbol* glib_ns = NULL((void*)0); |
| 1808 | BalaSymbol* _tmp138_; |
| 1809 | BalaScope* _tmp139_; |
| 1810 | BalaScope* _tmp140_; |
| 1811 | BalaSymbol* _tmp141_; |
| 1812 | BalaSymbol* _tmp142_; |
| 1813 | BalaScope* _tmp143_; |
| 1814 | BalaScope* _tmp144_; |
| 1815 | BalaSymbol* _tmp145_; |
| 1816 | BalaSymbol* _tmp146_; |
| 1817 | BalaScope* _tmp147_; |
| 1818 | BalaScope* _tmp148_; |
| 1819 | BalaSymbol* _tmp149_; |
| 1820 | BalaErrorType* _tmp150_; |
| 1821 | BalaSymbol* _tmp151_; |
| 1822 | BalaScope* _tmp152_; |
| 1823 | BalaScope* _tmp153_; |
| 1824 | BalaSymbol* _tmp154_; |
| 1825 | BalaSymbol* _tmp155_; |
| 1826 | BalaScope* _tmp156_; |
| 1827 | BalaScope* _tmp157_; |
| 1828 | BalaSymbol* _tmp158_; |
| 1829 | BalaSymbol* _tmp159_; |
| 1830 | BalaScope* _tmp160_; |
| 1831 | BalaScope* _tmp161_; |
| 1832 | BalaSymbol* _tmp162_; |
| 1833 | BalaSymbol* _tmp163_; |
| 1834 | BalaScope* _tmp164_; |
| 1835 | BalaScope* _tmp165_; |
| 1836 | BalaSymbol* _tmp166_; |
| 1837 | BalaSymbol* _tmp167_; |
| 1838 | BalaScope* _tmp168_; |
| 1839 | BalaScope* _tmp169_; |
| 1840 | BalaSymbol* _tmp170_; |
| 1841 | BalaSymbol* _tmp171_; |
| 1842 | BalaScope* _tmp172_; |
| 1843 | BalaScope* _tmp173_; |
| 1844 | BalaSymbol* _tmp174_; |
| 1845 | BalaSymbol* _tmp175_; |
| 1846 | BalaScope* _tmp176_; |
| 1847 | BalaScope* _tmp177_; |
| 1848 | BalaSymbol* _tmp178_; |
| 1849 | BalaSymbol* _tmp179_; |
| 1850 | BalaScope* _tmp180_; |
| 1851 | BalaScope* _tmp181_; |
| 1852 | BalaSymbol* _tmp182_; |
| 1853 | BalaSymbol* _tmp183_; |
| 1854 | BalaScope* _tmp184_; |
| 1855 | BalaScope* _tmp185_; |
| 1856 | BalaSymbol* _tmp186_; |
| 1857 | BalaSymbol* _tmp187_; |
| 1858 | BalaScope* _tmp188_; |
| 1859 | BalaScope* _tmp189_; |
| 1860 | BalaSymbol* _tmp190_; |
| 1861 | BalaSymbol* _tmp191_; |
| 1862 | BalaScope* _tmp192_; |
| 1863 | BalaScope* _tmp193_; |
| 1864 | BalaSymbol* _tmp194_; |
| 1865 | BalaSymbol* _tmp195_; |
| 1866 | BalaScope* _tmp196_; |
| 1867 | BalaScope* _tmp197_; |
| 1868 | BalaSymbol* _tmp198_; |
| 1869 | BalaSymbol* _tmp199_; |
| 1870 | BalaScope* _tmp200_; |
| 1871 | BalaScope* _tmp201_; |
| 1872 | BalaSymbol* _tmp202_; |
| 1873 | BalaStruct* _tmp203_; |
| 1874 | BalaIntegerType* _tmp204_; |
| 1875 | BalaSymbol* _tmp205_; |
| 1876 | BalaScope* _tmp206_; |
| 1877 | BalaScope* _tmp207_; |
| 1878 | BalaSymbol* _tmp208_; |
| 1879 | BalaSymbol* _tmp209_; |
| 1880 | BalaScope* _tmp210_; |
| 1881 | BalaScope* _tmp211_; |
| 1882 | BalaSymbol* _tmp212_; |
| 1883 | BalaSymbol* _tmp213_; |
| 1884 | BalaScope* _tmp214_; |
| 1885 | BalaScope* _tmp215_; |
| 1886 | BalaSymbol* _tmp216_; |
| 1887 | BalaSymbol* _tmp217_; |
| 1888 | BalaScope* _tmp218_; |
| 1889 | BalaScope* _tmp219_; |
| 1890 | BalaSymbol* _tmp220_; |
| 1891 | BalaSymbol* _tmp221_; |
| 1892 | BalaScope* _tmp222_; |
| 1893 | BalaScope* _tmp223_; |
| 1894 | BalaSymbol* _tmp224_; |
| 1895 | BalaSymbol* _tmp225_; |
| 1896 | BalaScope* _tmp226_; |
| 1897 | BalaScope* _tmp227_; |
| 1898 | BalaSymbol* _tmp228_; |
| 1899 | BalaSymbol* _tmp229_; |
| 1900 | BalaScope* _tmp230_; |
| 1901 | BalaScope* _tmp231_; |
| 1902 | BalaSymbol* _tmp232_; |
| 1903 | BalaStruct* _tmp233_; |
| 1904 | BalaStruct* _tmp234_; |
| 1905 | BalaSymbol* _tmp235_; |
| 1906 | BalaScope* _tmp236_; |
| 1907 | BalaScope* _tmp237_; |
| 1908 | BalaSymbol* _tmp238_; |
| 1909 | BalaSymbol* _tmp239_; |
| 1910 | BalaScope* _tmp240_; |
| 1911 | BalaScope* _tmp241_; |
| 1912 | BalaSymbol* _tmp242_; |
| 1913 | BalaSymbol* _tmp243_; |
| 1914 | BalaScope* _tmp244_; |
| 1915 | BalaScope* _tmp245_; |
| 1916 | BalaSymbol* _tmp246_; |
| 1917 | BalaClass* _tmp247_; |
| 1918 | BalaObjectType* _tmp248_; |
| 1919 | BalaMethod* _tmp249_; |
| 1920 | BalaMethod* _tmp250_; |
| 1921 | BalaSymbol* _tmp272_; |
| 1922 | BalaScope* _tmp273_; |
| 1923 | BalaScope* _tmp274_; |
| 1924 | BalaSymbol* _tmp275_; |
| 1925 | BalaSymbol* _tmp276_; |
| 1926 | BalaScope* _tmp277_; |
| 1927 | BalaScope* _tmp278_; |
| 1928 | BalaSymbol* _tmp279_; |
| 1929 | BalaStruct* _tmp280_; |
| 1930 | BalaStructValueType* _tmp281_; |
| 1931 | BalaDataType* _tmp282_; |
| 1932 | BalaDataType* _tmp283_; |
| 1933 | BalaSymbol* _tmp284_; |
| 1934 | BalaScope* _tmp285_; |
| 1935 | BalaScope* _tmp286_; |
| 1936 | BalaSymbol* _tmp287_; |
| 1937 | BalaDelegate* _tmp288_; |
| 1938 | BalaDelegateType* _tmp289_; |
| 1939 | _tmp138_ = self->root_symbol; |
| 1940 | _tmp139_ = bala_symbol_get_scope (_tmp138_); |
| 1941 | _tmp140_ = _tmp139_; |
| 1942 | _tmp141_ = bala_scope_lookup (_tmp140_, "GLib"); |
| 1943 | glib_ns = _tmp141_; |
| 1944 | _tmp142_ = glib_ns; |
| 1945 | _tmp143_ = bala_symbol_get_scope (_tmp142_); |
| 1946 | _tmp144_ = _tmp143_; |
| 1947 | _tmp145_ = bala_scope_lookup (_tmp144_, "Type"); |
| 1948 | _bala_code_node_unref0 (self->gtype_type)((self->gtype_type == ((void*)0)) ? ((void*)0) : (self-> gtype_type = (bala_code_node_unref (self->gtype_type), ((void *)0)))); |
| 1949 | self->gtype_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp145_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp145_), ((bala_typesymbol_get_type ()))))); |
| 1950 | _tmp146_ = glib_ns; |
| 1951 | _tmp147_ = bala_symbol_get_scope (_tmp146_); |
| 1952 | _tmp148_ = _tmp147_; |
| 1953 | _tmp149_ = bala_scope_lookup (_tmp148_, "Object"); |
| 1954 | _bala_code_node_unref0 (self->gobject_type)((self->gobject_type == ((void*)0)) ? ((void*)0) : (self-> gobject_type = (bala_code_node_unref (self->gobject_type), ((void*)0)))); |
| 1955 | self->gobject_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp149_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp149_), ((bala_typesymbol_get_type ()))))); |
| 1956 | _tmp150_ = bala_error_type_new (NULL((void*)0), NULL((void*)0), NULL((void*)0)); |
| 1957 | _bala_code_node_unref0 (self->gerror_type)((self->gerror_type == ((void*)0)) ? ((void*)0) : (self-> gerror_type = (bala_code_node_unref (self->gerror_type), ( (void*)0)))); |
| 1958 | self->gerror_type = _tmp150_; |
| 1959 | _tmp151_ = glib_ns; |
| 1960 | _tmp152_ = bala_symbol_get_scope (_tmp151_); |
| 1961 | _tmp153_ = _tmp152_; |
| 1962 | _tmp154_ = bala_scope_lookup (_tmp153_, "List"); |
| 1963 | _bala_code_node_unref0 (self->glist_type)((self->glist_type == ((void*)0)) ? ((void*)0) : (self-> glist_type = (bala_code_node_unref (self->glist_type), ((void *)0)))); |
| 1964 | self->glist_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp154_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp154_), ((bala_class_get_type ()))))); |
| 1965 | _tmp155_ = glib_ns; |
| 1966 | _tmp156_ = bala_symbol_get_scope (_tmp155_); |
| 1967 | _tmp157_ = _tmp156_; |
| 1968 | _tmp158_ = bala_scope_lookup (_tmp157_, "SList"); |
| 1969 | _bala_code_node_unref0 (self->gslist_type)((self->gslist_type == ((void*)0)) ? ((void*)0) : (self-> gslist_type = (bala_code_node_unref (self->gslist_type), ( (void*)0)))); |
| 1970 | self->gslist_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp158_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp158_), ((bala_class_get_type ()))))); |
| 1971 | _tmp159_ = glib_ns; |
| 1972 | _tmp160_ = bala_symbol_get_scope (_tmp159_); |
| 1973 | _tmp161_ = _tmp160_; |
| 1974 | _tmp162_ = bala_scope_lookup (_tmp161_, "Node"); |
| 1975 | _bala_code_node_unref0 (self->gnode_type)((self->gnode_type == ((void*)0)) ? ((void*)0) : (self-> gnode_type = (bala_code_node_unref (self->gnode_type), ((void *)0)))); |
| 1976 | self->gnode_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp162_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp162_), ((bala_class_get_type ()))))); |
| 1977 | _tmp163_ = glib_ns; |
| 1978 | _tmp164_ = bala_symbol_get_scope (_tmp163_); |
| 1979 | _tmp165_ = _tmp164_; |
| 1980 | _tmp166_ = bala_scope_lookup (_tmp165_, "Queue"); |
| 1981 | _bala_code_node_unref0 (self->gqueue_type)((self->gqueue_type == ((void*)0)) ? ((void*)0) : (self-> gqueue_type = (bala_code_node_unref (self->gqueue_type), ( (void*)0)))); |
| 1982 | self->gqueue_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp166_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp166_), ((bala_class_get_type ()))))); |
| 1983 | _tmp167_ = glib_ns; |
| 1984 | _tmp168_ = bala_symbol_get_scope (_tmp167_); |
| 1985 | _tmp169_ = _tmp168_; |
| 1986 | _tmp170_ = bala_scope_lookup (_tmp169_, "ValueArray"); |
| 1987 | _bala_code_node_unref0 (self->gvaluearray_type)((self->gvaluearray_type == ((void*)0)) ? ((void*)0) : (self ->gvaluearray_type = (bala_code_node_unref (self->gvaluearray_type ), ((void*)0)))); |
| 1988 | self->gvaluearray_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp170_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp170_), ((bala_class_get_type ()))))); |
| 1989 | _tmp171_ = glib_ns; |
| 1990 | _tmp172_ = bala_symbol_get_scope (_tmp171_); |
| 1991 | _tmp173_ = _tmp172_; |
| 1992 | _tmp174_ = bala_scope_lookup (_tmp173_, "StringBuilder"); |
| 1993 | _bala_code_node_unref0 (self->gstringbuilder_type)((self->gstringbuilder_type == ((void*)0)) ? ((void*)0) : ( self->gstringbuilder_type = (bala_code_node_unref (self-> gstringbuilder_type), ((void*)0)))); |
| 1994 | self->gstringbuilder_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp174_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp174_), ((bala_typesymbol_get_type ()))))); |
| 1995 | _tmp175_ = glib_ns; |
| 1996 | _tmp176_ = bala_symbol_get_scope (_tmp175_); |
| 1997 | _tmp177_ = _tmp176_; |
| 1998 | _tmp178_ = bala_scope_lookup (_tmp177_, "Array"); |
| 1999 | _bala_code_node_unref0 (self->garray_type)((self->garray_type == ((void*)0)) ? ((void*)0) : (self-> garray_type = (bala_code_node_unref (self->garray_type), ( (void*)0)))); |
| 2000 | self->garray_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp178_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp178_), ((bala_typesymbol_get_type ()))))); |
| 2001 | _tmp179_ = glib_ns; |
| 2002 | _tmp180_ = bala_symbol_get_scope (_tmp179_); |
| 2003 | _tmp181_ = _tmp180_; |
| 2004 | _tmp182_ = bala_scope_lookup (_tmp181_, "ByteArray"); |
| 2005 | _bala_code_node_unref0 (self->gbytearray_type)((self->gbytearray_type == ((void*)0)) ? ((void*)0) : (self ->gbytearray_type = (bala_code_node_unref (self->gbytearray_type ), ((void*)0)))); |
| 2006 | self->gbytearray_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp182_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp182_), ((bala_typesymbol_get_type ()))))); |
| 2007 | _tmp183_ = glib_ns; |
| 2008 | _tmp184_ = bala_symbol_get_scope (_tmp183_); |
| 2009 | _tmp185_ = _tmp184_; |
| 2010 | _tmp186_ = bala_scope_lookup (_tmp185_, "PtrArray"); |
| 2011 | _bala_code_node_unref0 (self->gptrarray_type)((self->gptrarray_type == ((void*)0)) ? ((void*)0) : (self ->gptrarray_type = (bala_code_node_unref (self->gptrarray_type ), ((void*)0)))); |
| 2012 | self->gptrarray_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp186_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp186_), ((bala_typesymbol_get_type ()))))); |
| 2013 | _tmp187_ = glib_ns; |
| 2014 | _tmp188_ = bala_symbol_get_scope (_tmp187_); |
| 2015 | _tmp189_ = _tmp188_; |
| 2016 | _tmp190_ = bala_scope_lookup (_tmp189_, "ThreadPool"); |
| 2017 | _bala_code_node_unref0 (self->gthreadpool_type)((self->gthreadpool_type == ((void*)0)) ? ((void*)0) : (self ->gthreadpool_type = (bala_code_node_unref (self->gthreadpool_type ), ((void*)0)))); |
| 2018 | self->gthreadpool_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp190_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp190_), ((bala_typesymbol_get_type ()))))); |
| 2019 | _tmp191_ = self->root_symbol; |
| 2020 | _tmp192_ = bala_symbol_get_scope (_tmp191_); |
| 2021 | _tmp193_ = _tmp192_; |
| 2022 | _tmp194_ = bala_scope_lookup (_tmp193_, "GLib"); |
| 2023 | _tmp195_ = _tmp194_; |
| 2024 | _tmp196_ = bala_symbol_get_scope (_tmp195_); |
| 2025 | _tmp197_ = _tmp196_; |
| 2026 | _tmp198_ = bala_scope_lookup (_tmp197_, "Error"); |
| 2027 | _bala_code_node_unref0 (self->priv->gerror)((self->priv->gerror == ((void*)0)) ? ((void*)0) : (self ->priv->gerror = (bala_code_node_unref (self->priv-> gerror), ((void*)0)))); |
| 2028 | self->priv->gerror = G_TYPE_CHECK_INSTANCE_CAST (_tmp198_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp198_), ((bala_class_get_type ()))))); |
| 2029 | _bala_code_node_unref0 (_tmp195_)((_tmp195_ == ((void*)0)) ? ((void*)0) : (_tmp195_ = (bala_code_node_unref (_tmp195_), ((void*)0)))); |
| 2030 | _tmp199_ = glib_ns; |
| 2031 | _tmp200_ = bala_symbol_get_scope (_tmp199_); |
| 2032 | _tmp201_ = _tmp200_; |
| 2033 | _tmp202_ = bala_scope_lookup (_tmp201_, "Quark"); |
| 2034 | _tmp203_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp202_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp202_), ((bala_struct_get_type ()))))); |
| 2035 | _tmp204_ = bala_integer_type_new (_tmp203_, NULL((void*)0), NULL((void*)0)); |
| 2036 | _bala_code_node_unref0 (self->gquark_type)((self->gquark_type == ((void*)0)) ? ((void*)0) : (self-> gquark_type = (bala_code_node_unref (self->gquark_type), ( (void*)0)))); |
| 2037 | self->gquark_type = (BalaDataType*) _tmp204_; |
| 2038 | _bala_code_node_unref0 (_tmp203_)((_tmp203_ == ((void*)0)) ? ((void*)0) : (_tmp203_ = (bala_code_node_unref (_tmp203_), ((void*)0)))); |
| 2039 | _tmp205_ = glib_ns; |
| 2040 | _tmp206_ = bala_symbol_get_scope (_tmp205_); |
| 2041 | _tmp207_ = _tmp206_; |
| 2042 | _tmp208_ = bala_scope_lookup (_tmp207_, "Value"); |
| 2043 | _bala_code_node_unref0 (self->gvalue_type)((self->gvalue_type == ((void*)0)) ? ((void*)0) : (self-> gvalue_type = (bala_code_node_unref (self->gvalue_type), ( (void*)0)))); |
| 2044 | self->gvalue_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp208_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp208_), ((bala_struct_get_type ()))))); |
| 2045 | _tmp209_ = glib_ns; |
| 2046 | _tmp210_ = bala_symbol_get_scope (_tmp209_); |
| 2047 | _tmp211_ = _tmp210_; |
| 2048 | _tmp212_ = bala_scope_lookup (_tmp211_, "Variant"); |
| 2049 | _bala_code_node_unref0 (self->gvariant_type)((self->gvariant_type == ((void*)0)) ? ((void*)0) : (self-> gvariant_type = (bala_code_node_unref (self->gvariant_type ), ((void*)0)))); |
| 2050 | self->gvariant_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp212_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp212_), ((bala_class_get_type ()))))); |
| 2051 | _tmp213_ = glib_ns; |
| 2052 | _tmp214_ = bala_symbol_get_scope (_tmp213_); |
| 2053 | _tmp215_ = _tmp214_; |
| 2054 | _tmp216_ = bala_scope_lookup (_tmp215_, "Source"); |
| 2055 | _bala_code_node_unref0 (self->gsource_type)((self->gsource_type == ((void*)0)) ? ((void*)0) : (self-> gsource_type = (bala_code_node_unref (self->gsource_type), ((void*)0)))); |
| 2056 | self->gsource_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp216_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp216_), ((bala_class_get_type ()))))); |
| 2057 | _tmp217_ = glib_ns; |
| 2058 | _tmp218_ = bala_symbol_get_scope (_tmp217_); |
| 2059 | _tmp219_ = _tmp218_; |
| 2060 | _tmp220_ = bala_scope_lookup (_tmp219_, "Mutex"); |
| 2061 | _bala_code_node_unref0 (self->gmutex_type)((self->gmutex_type == ((void*)0)) ? ((void*)0) : (self-> gmutex_type = (bala_code_node_unref (self->gmutex_type), ( (void*)0)))); |
| 2062 | self->gmutex_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp220_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp220_), ((bala_struct_get_type ()))))); |
| 2063 | _tmp221_ = glib_ns; |
| 2064 | _tmp222_ = bala_symbol_get_scope (_tmp221_); |
| 2065 | _tmp223_ = _tmp222_; |
| 2066 | _tmp224_ = bala_scope_lookup (_tmp223_, "RecMutex"); |
| 2067 | _bala_code_node_unref0 (self->grecmutex_type)((self->grecmutex_type == ((void*)0)) ? ((void*)0) : (self ->grecmutex_type = (bala_code_node_unref (self->grecmutex_type ), ((void*)0)))); |
| 2068 | self->grecmutex_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp224_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp224_), ((bala_struct_get_type ()))))); |
| 2069 | _tmp225_ = glib_ns; |
| 2070 | _tmp226_ = bala_symbol_get_scope (_tmp225_); |
| 2071 | _tmp227_ = _tmp226_; |
| 2072 | _tmp228_ = bala_scope_lookup (_tmp227_, "RWLock"); |
| 2073 | _bala_code_node_unref0 (self->grwlock_type)((self->grwlock_type == ((void*)0)) ? ((void*)0) : (self-> grwlock_type = (bala_code_node_unref (self->grwlock_type), ((void*)0)))); |
| 2074 | self->grwlock_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp228_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp228_), ((bala_struct_get_type ()))))); |
| 2075 | _tmp229_ = glib_ns; |
| 2076 | _tmp230_ = bala_symbol_get_scope (_tmp229_); |
| 2077 | _tmp231_ = _tmp230_; |
| 2078 | _tmp232_ = bala_scope_lookup (_tmp231_, "Cond"); |
| 2079 | _bala_code_node_unref0 (self->gcond_type)((self->gcond_type == ((void*)0)) ? ((void*)0) : (self-> gcond_type = (bala_code_node_unref (self->gcond_type), ((void *)0)))); |
| 2080 | self->gcond_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp232_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp232_), ((bala_struct_get_type ()))))); |
| 2081 | _tmp233_ = self->grecmutex_type; |
| 2082 | _tmp234_ = _bala_code_node_ref0 (_tmp233_); |
| 2083 | _bala_code_node_unref0 (self->mutex_type)((self->mutex_type == ((void*)0)) ? ((void*)0) : (self-> mutex_type = (bala_code_node_unref (self->mutex_type), ((void *)0)))); |
| 2084 | self->mutex_type = _tmp234_; |
| 2085 | _tmp235_ = glib_ns; |
| 2086 | _tmp236_ = bala_symbol_get_scope (_tmp235_); |
| 2087 | _tmp237_ = _tmp236_; |
| 2088 | _tmp238_ = bala_scope_lookup (_tmp237_, "TypeModule"); |
| 2089 | _bala_code_node_unref0 (self->type_module_type)((self->type_module_type == ((void*)0)) ? ((void*)0) : (self ->type_module_type = (bala_code_node_unref (self->type_module_type ), ((void*)0)))); |
| 2090 | self->type_module_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp238_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp238_), ((bala_typesymbol_get_type ()))))); |
| 2091 | _tmp239_ = self->root_symbol; |
| 2092 | _tmp240_ = bala_symbol_get_scope (_tmp239_); |
| 2093 | _tmp241_ = _tmp240_; |
| 2094 | _tmp242_ = bala_scope_lookup (_tmp241_, "GLib"); |
| 2095 | _tmp243_ = _tmp242_; |
| 2096 | _tmp244_ = bala_symbol_get_scope (_tmp243_); |
| 2097 | _tmp245_ = _tmp244_; |
| 2098 | _tmp246_ = bala_scope_lookup (_tmp245_, "Regex"); |
| 2099 | _tmp247_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp246_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp246_), ((bala_class_get_type ()))))); |
| 2100 | _tmp248_ = bala_object_type_new ((BalaObjectTypeSymbol*) _tmp247_); |
| 2101 | _bala_code_node_unref0 (self->regex_type)((self->regex_type == ((void*)0)) ? ((void*)0) : (self-> regex_type = (bala_code_node_unref (self->regex_type), ((void *)0)))); |
| 2102 | self->regex_type = (BalaDataType*) _tmp248_; |
| 2103 | _bala_code_node_unref0 (_tmp247_)((_tmp247_ == ((void*)0)) ? ((void*)0) : (_tmp247_ = (bala_code_node_unref (_tmp247_), ((void*)0)))); |
| 2104 | _bala_code_node_unref0 (_tmp243_)((_tmp243_ == ((void*)0)) ? ((void*)0) : (_tmp243_ = (bala_code_node_unref (_tmp243_), ((void*)0)))); |
| 2105 | _tmp249_ = bala_code_context_get_module_init_method (context); |
| 2106 | _tmp250_ = _tmp249_; |
| 2107 | if (_tmp250_ != NULL((void*)0)) { |
| 2108 | { |
| 2109 | BalaList* _parameter_list = NULL((void*)0); |
| 2110 | BalaMethod* _tmp251_; |
| 2111 | BalaMethod* _tmp252_; |
| 2112 | BalaList* _tmp253_; |
| 2113 | BalaList* _tmp254_; |
| 2114 | gint _parameter_size = 0; |
| 2115 | BalaList* _tmp255_; |
| 2116 | gint _tmp256_; |
| 2117 | gint _tmp257_; |
| 2118 | gint _parameter_index = 0; |
| 2119 | _tmp251_ = bala_code_context_get_module_init_method (context); |
| 2120 | _tmp252_ = _tmp251_; |
| 2121 | _tmp253_ = bala_callable_get_parameters ((BalaCallable*) _tmp252_); |
| 2122 | _tmp254_ = _bala_iterable_ref0 (_tmp253_); |
| 2123 | _parameter_list = _tmp254_; |
| 2124 | _tmp255_ = _parameter_list; |
| 2125 | _tmp256_ = bala_collection_get_size ((BalaCollection*) _tmp255_); |
| 2126 | _tmp257_ = _tmp256_; |
| 2127 | _parameter_size = _tmp257_; |
| 2128 | _parameter_index = -1; |
| 2129 | while (TRUE(!(0))) { |
| 2130 | gint _tmp258_; |
| 2131 | gint _tmp259_; |
| 2132 | BalaParameter* parameter = NULL((void*)0); |
| 2133 | BalaList* _tmp260_; |
| 2134 | gpointer _tmp261_; |
| 2135 | BalaParameter* _tmp262_; |
| 2136 | BalaDataType* _tmp263_; |
| 2137 | BalaDataType* _tmp264_; |
| 2138 | BalaTypeSymbol* _tmp265_; |
| 2139 | BalaTypeSymbol* _tmp266_; |
| 2140 | BalaTypeSymbol* _tmp267_; |
| 2141 | _parameter_index = _parameter_index + 1; |
| 2142 | _tmp258_ = _parameter_index; |
| 2143 | _tmp259_ = _parameter_size; |
| 2144 | if (!(_tmp258_ < _tmp259_)) { |
| 2145 | break; |
| 2146 | } |
| 2147 | _tmp260_ = _parameter_list; |
| 2148 | _tmp261_ = bala_list_get (_tmp260_, _parameter_index); |
| 2149 | parameter = (BalaParameter*) _tmp261_; |
| 2150 | _tmp262_ = parameter; |
| 2151 | _tmp263_ = bala_variable_get_variable_type ((BalaVariable*) _tmp262_); |
| 2152 | _tmp264_ = _tmp263_; |
| 2153 | _tmp265_ = bala_data_type_get_type_symbol (_tmp264_); |
| 2154 | _tmp266_ = _tmp265_; |
| 2155 | _tmp267_ = self->type_module_type; |
| 2156 | if (bala_typesymbol_is_subtype_of (_tmp266_, _tmp267_)) { |
| 2157 | BalaParameter* _tmp268_; |
| 2158 | const gchar* _tmp269_; |
| 2159 | const gchar* _tmp270_; |
| 2160 | gchar* _tmp271_; |
| 2161 | self->in_plugin = TRUE(!(0)); |
| 2162 | _tmp268_ = parameter; |
| 2163 | _tmp269_ = bala_symbol_get_name ((BalaSymbol*) _tmp268_); |
| 2164 | _tmp270_ = _tmp269_; |
| 2165 | _tmp271_ = g_strdup (_tmp270_); |
| 2166 | _g_free0 (self->module_init_param_name)(self->module_init_param_name = (g_free (self->module_init_param_name ), ((void*)0))); |
| 2167 | self->module_init_param_name = _tmp271_; |
| 2168 | _bala_code_node_unref0 (parameter)((parameter == ((void*)0)) ? ((void*)0) : (parameter = (bala_code_node_unref (parameter), ((void*)0)))); |
| 2169 | break; |
| 2170 | } |
| 2171 | _bala_code_node_unref0 (parameter)((parameter == ((void*)0)) ? ((void*)0) : (parameter = (bala_code_node_unref (parameter), ((void*)0)))); |
| 2172 | } |
| 2173 | _bala_iterable_unref0 (_parameter_list)((_parameter_list == ((void*)0)) ? ((void*)0) : (_parameter_list = (bala_iterable_unref (_parameter_list), ((void*)0)))); |
| 2174 | } |
| 2175 | } |
| 2176 | _tmp272_ = glib_ns; |
| 2177 | _tmp273_ = bala_symbol_get_scope (_tmp272_); |
| 2178 | _tmp274_ = _tmp273_; |
| 2179 | _tmp275_ = bala_scope_lookup (_tmp274_, "DBusProxy"); |
| 2180 | _bala_code_node_unref0 (self->dbus_proxy_type)((self->dbus_proxy_type == ((void*)0)) ? ((void*)0) : (self ->dbus_proxy_type = (bala_code_node_unref (self->dbus_proxy_type ), ((void*)0)))); |
| 2181 | self->dbus_proxy_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp275_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp275_), ((bala_typesymbol_get_type ()))))); |
| 2182 | _tmp276_ = glib_ns; |
| 2183 | _tmp277_ = bala_symbol_get_scope (_tmp276_); |
| 2184 | _tmp278_ = _tmp277_; |
| 2185 | _tmp279_ = bala_scope_lookup (_tmp278_, "pointer"); |
| 2186 | _tmp280_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp279_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp279_), ((bala_struct_get_type ()))))); |
| 2187 | _tmp281_ = bala_struct_value_type_new (_tmp280_); |
| 2188 | _bala_code_node_unref0 (self->pointer_type)((self->pointer_type == ((void*)0)) ? ((void*)0) : (self-> pointer_type = (bala_code_node_unref (self->pointer_type), ((void*)0)))); |
| 2189 | self->pointer_type = (BalaDataType*) _tmp281_; |
| 2190 | _bala_code_node_unref0 (_tmp280_)((_tmp280_ == ((void*)0)) ? ((void*)0) : (_tmp280_ = (bala_code_node_unref (_tmp280_), ((void*)0)))); |
| 2191 | _tmp282_ = self->pointer_type; |
| 2192 | _tmp283_ = _bala_code_node_ref0 (_tmp282_); |
| 2193 | _bala_code_node_unref0 (self->delegate_target_type)((self->delegate_target_type == ((void*)0)) ? ((void*)0) : (self->delegate_target_type = (bala_code_node_unref (self ->delegate_target_type), ((void*)0)))); |
| 2194 | self->delegate_target_type = _tmp283_; |
| 2195 | _tmp284_ = glib_ns; |
| 2196 | _tmp285_ = bala_symbol_get_scope (_tmp284_); |
| 2197 | _tmp286_ = _tmp285_; |
| 2198 | _tmp287_ = bala_scope_lookup (_tmp286_, "DestroyNotify"); |
| 2199 | _bala_code_node_unref0 (self->priv->destroy_notify)((self->priv->destroy_notify == ((void*)0)) ? ((void*)0 ) : (self->priv->destroy_notify = (bala_code_node_unref (self->priv->destroy_notify), ((void*)0)))); |
| 2200 | self->priv->destroy_notify = G_TYPE_CHECK_INSTANCE_CAST (_tmp287_, BALA_TYPE_DELEGATE, BalaDelegate)(((BalaDelegate*) g_type_check_instance_cast ((GTypeInstance* ) (_tmp287_), ((bala_delegate_get_type ()))))); |
| 2201 | _tmp288_ = self->priv->destroy_notify; |
| 2202 | _tmp289_ = bala_delegate_type_new (_tmp288_); |
| 2203 | _bala_code_node_unref0 (self->delegate_target_destroy_type)((self->delegate_target_destroy_type == ((void*)0)) ? ((void *)0) : (self->delegate_target_destroy_type = (bala_code_node_unref (self->delegate_target_destroy_type), ((void*)0)))); |
| 2204 | self->delegate_target_destroy_type = _tmp289_; |
| 2205 | _bala_code_node_unref0 (glib_ns)((glib_ns == ((void*)0)) ? ((void*)0) : (glib_ns = (bala_code_node_unref (glib_ns), ((void*)0)))); |
| 2206 | } else { |
| 2207 | BalaVoidType* _tmp290_; |
| 2208 | BalaVoidType* _tmp291_; |
| 2209 | BalaPointerType* _tmp292_; |
| 2210 | BalaDataType* _tmp293_; |
| 2211 | BalaDataType* _tmp294_; |
| 2212 | BalaVoidType* _tmp295_; |
| 2213 | BalaVoidType* _tmp296_; |
| 2214 | BalaDelegate* _tmp297_; |
| 2215 | BalaDelegate* _tmp298_; |
| 2216 | BalaVoidType* _tmp299_; |
| 2217 | BalaVoidType* _tmp300_; |
| 2218 | BalaPointerType* _tmp301_; |
| 2219 | BalaPointerType* _tmp302_; |
| 2220 | BalaParameter* _tmp303_; |
| 2221 | BalaParameter* _tmp304_; |
| 2222 | BalaDelegate* _tmp305_; |
| 2223 | BalaDelegate* _tmp306_; |
| 2224 | BalaSymbol* _tmp307_; |
| 2225 | BalaScope* _tmp308_; |
| 2226 | BalaScope* _tmp309_; |
| 2227 | BalaDelegate* _tmp310_; |
| 2228 | BalaDelegateType* _tmp311_; |
| 2229 | _tmp290_ = bala_void_type_new (NULL((void*)0)); |
| 2230 | _tmp291_ = _tmp290_; |
| 2231 | _tmp292_ = bala_pointer_type_new ((BalaDataType*) _tmp291_, NULL((void*)0)); |
| 2232 | _bala_code_node_unref0 (self->pointer_type)((self->pointer_type == ((void*)0)) ? ((void*)0) : (self-> pointer_type = (bala_code_node_unref (self->pointer_type), ((void*)0)))); |
| 2233 | self->pointer_type = (BalaDataType*) _tmp292_; |
| 2234 | _bala_code_node_unref0 (_tmp291_)((_tmp291_ == ((void*)0)) ? ((void*)0) : (_tmp291_ = (bala_code_node_unref (_tmp291_), ((void*)0)))); |
| 2235 | _tmp293_ = self->pointer_type; |
| 2236 | _tmp294_ = _bala_code_node_ref0 (_tmp293_); |
| 2237 | _bala_code_node_unref0 (self->delegate_target_type)((self->delegate_target_type == ((void*)0)) ? ((void*)0) : (self->delegate_target_type = (bala_code_node_unref (self ->delegate_target_type), ((void*)0)))); |
| 2238 | self->delegate_target_type = _tmp294_; |
| 2239 | _tmp295_ = bala_void_type_new (NULL((void*)0)); |
| 2240 | _tmp296_ = _tmp295_; |
| 2241 | _tmp297_ = bala_delegate_new ("BalaDestroyNotify", (BalaDataType*) _tmp296_, NULL((void*)0), NULL((void*)0)); |
| 2242 | _bala_code_node_unref0 (self->priv->destroy_notify)((self->priv->destroy_notify == ((void*)0)) ? ((void*)0 ) : (self->priv->destroy_notify = (bala_code_node_unref (self->priv->destroy_notify), ((void*)0)))); |
| 2243 | self->priv->destroy_notify = _tmp297_; |
| 2244 | _bala_code_node_unref0 (_tmp296_)((_tmp296_ == ((void*)0)) ? ((void*)0) : (_tmp296_ = (bala_code_node_unref (_tmp296_), ((void*)0)))); |
| 2245 | _tmp298_ = self->priv->destroy_notify; |
| 2246 | _tmp299_ = bala_void_type_new (NULL((void*)0)); |
| 2247 | _tmp300_ = _tmp299_; |
| 2248 | _tmp301_ = bala_pointer_type_new ((BalaDataType*) _tmp300_, NULL((void*)0)); |
| 2249 | _tmp302_ = _tmp301_; |
| 2250 | _tmp303_ = bala_parameter_new ("data", (BalaDataType*) _tmp302_, NULL((void*)0)); |
| 2251 | _tmp304_ = _tmp303_; |
| 2252 | bala_callable_add_parameter ((BalaCallable*) _tmp298_, _tmp304_); |
| 2253 | _bala_code_node_unref0 (_tmp304_)((_tmp304_ == ((void*)0)) ? ((void*)0) : (_tmp304_ = (bala_code_node_unref (_tmp304_), ((void*)0)))); |
| 2254 | _bala_code_node_unref0 (_tmp302_)((_tmp302_ == ((void*)0)) ? ((void*)0) : (_tmp302_ = (bala_code_node_unref (_tmp302_), ((void*)0)))); |
| 2255 | _bala_code_node_unref0 (_tmp300_)((_tmp300_ == ((void*)0)) ? ((void*)0) : (_tmp300_ = (bala_code_node_unref (_tmp300_), ((void*)0)))); |
| 2256 | _tmp305_ = self->priv->destroy_notify; |
| 2257 | bala_delegate_set_has_target (_tmp305_, FALSE(0)); |
| 2258 | _tmp306_ = self->priv->destroy_notify; |
| 2259 | _tmp307_ = self->root_symbol; |
| 2260 | _tmp308_ = bala_symbol_get_scope (_tmp307_); |
| 2261 | _tmp309_ = _tmp308_; |
| 2262 | bala_symbol_set_owner ((BalaSymbol*) _tmp306_, _tmp309_); |
| 2263 | _tmp310_ = self->priv->destroy_notify; |
| 2264 | _tmp311_ = bala_delegate_type_new (_tmp310_); |
| 2265 | _bala_code_node_unref0 (self->delegate_target_destroy_type)((self->delegate_target_destroy_type == ((void*)0)) ? ((void *)0) : (self->delegate_target_destroy_type = (bala_code_node_unref (self->delegate_target_destroy_type), ((void*)0)))); |
| 2266 | self->delegate_target_destroy_type = _tmp311_; |
| 2267 | } |
| 2268 | _tmp312_ = self->root_symbol; |
| 2269 | _tmp313_ = bala_symbol_get_scope (_tmp312_); |
| 2270 | _tmp314_ = _tmp313_; |
| 2271 | _tmp315_ = bala_scope_lookup (_tmp314_, "Gtk"); |
| 2272 | gtk_ns = _tmp315_; |
| 2273 | _tmp316_ = gtk_ns; |
| 2274 | if (_tmp316_ != NULL((void*)0)) { |
| 2275 | BalaSymbol* _tmp317_; |
| 2276 | BalaScope* _tmp318_; |
| 2277 | BalaScope* _tmp319_; |
| 2278 | BalaSymbol* _tmp320_; |
| 2279 | _tmp317_ = gtk_ns; |
| 2280 | _tmp318_ = bala_symbol_get_scope (_tmp317_); |
| 2281 | _tmp319_ = _tmp318_; |
| 2282 | _tmp320_ = bala_scope_lookup (_tmp319_, "Widget"); |
| 2283 | _bala_code_node_unref0 (self->gtk_widget_type)((self->gtk_widget_type == ((void*)0)) ? ((void*)0) : (self ->gtk_widget_type = (bala_code_node_unref (self->gtk_widget_type ), ((void*)0)))); |
| 2284 | self->gtk_widget_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp320_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp320_), ((bala_class_get_type ()))))); |
| 2285 | } |
| 2286 | _tmp321_ = bala_ccode_file_new (NULL((void*)0)); |
| 2287 | _bala_ccode_file_unref0 (self->header_file)((self->header_file == ((void*)0)) ? ((void*)0) : (self-> header_file = (bala_ccode_file_unref (self->header_file), ( (void*)0)))); |
| 2288 | self->header_file = _tmp321_; |
| 2289 | _tmp322_ = self->header_file; |
| 2290 | bala_ccode_file_set_is_header (_tmp322_, TRUE(!(0))); |
| 2291 | _tmp323_ = bala_ccode_file_new (NULL((void*)0)); |
| 2292 | _bala_ccode_file_unref0 (self->internal_header_file)((self->internal_header_file == ((void*)0)) ? ((void*)0) : (self->internal_header_file = (bala_ccode_file_unref (self ->internal_header_file), ((void*)0)))); |
| 2293 | self->internal_header_file = _tmp323_; |
| 2294 | _tmp324_ = self->internal_header_file; |
| 2295 | bala_ccode_file_set_is_header (_tmp324_, TRUE(!(0))); |
| 2296 | _tmp325_ = bala_code_context_get_source_files (context); |
| 2297 | _tmp326_ = _bala_iterable_ref0 (_tmp325_); |
| 2298 | source_files = _tmp326_; |
| 2299 | { |
| 2300 | BalaList* _file_list = NULL((void*)0); |
| 2301 | BalaList* _tmp327_; |
| 2302 | BalaList* _tmp328_; |
| 2303 | gint _file_size = 0; |
| 2304 | BalaList* _tmp329_; |
| 2305 | gint _tmp330_; |
| 2306 | gint _tmp331_; |
| 2307 | gint _file_index = 0; |
| 2308 | _tmp327_ = source_files; |
| 2309 | _tmp328_ = _bala_iterable_ref0 (_tmp327_); |
| 2310 | _file_list = _tmp328_; |
| 2311 | _tmp329_ = _file_list; |
| 2312 | _tmp330_ = bala_collection_get_size ((BalaCollection*) _tmp329_); |
| 2313 | _tmp331_ = _tmp330_; |
| 2314 | _file_size = _tmp331_; |
| 2315 | _file_index = -1; |
| 2316 | while (TRUE(!(0))) { |
| 2317 | gint _tmp332_; |
| 2318 | gint _tmp333_; |
| 2319 | BalaSourceFile* file = NULL((void*)0); |
| 2320 | BalaList* _tmp334_; |
| 2321 | gpointer _tmp335_; |
| 2322 | gboolean _tmp336_ = FALSE(0); |
| 2323 | BalaSourceFile* _tmp337_; |
| 2324 | BalaSourceFileType _tmp338_; |
| 2325 | BalaSourceFileType _tmp339_; |
| 2326 | _file_index = _file_index + 1; |
| 2327 | _tmp332_ = _file_index; |
| 2328 | _tmp333_ = _file_size; |
| 2329 | if (!(_tmp332_ < _tmp333_)) { |
| 2330 | break; |
| 2331 | } |
| 2332 | _tmp334_ = _file_list; |
| 2333 | _tmp335_ = bala_list_get (_tmp334_, _file_index); |
| 2334 | file = (BalaSourceFile*) _tmp335_; |
| 2335 | _tmp337_ = file; |
| 2336 | _tmp338_ = bala_source_file_get_file_type (_tmp337_); |
| 2337 | _tmp339_ = _tmp338_; |
| 2338 | if (_tmp339_ == BALA_SOURCE_FILE_TYPE_SOURCE) { |
| 2339 | _tmp336_ = TRUE(!(0)); |
| 2340 | } else { |
| 2341 | gboolean _tmp340_ = FALSE(0); |
| 2342 | const gchar* _tmp341_; |
| 2343 | const gchar* _tmp342_; |
| 2344 | _tmp341_ = bala_code_context_get_header_filename (context); |
| 2345 | _tmp342_ = _tmp341_; |
| 2346 | if (_tmp342_ != NULL((void*)0)) { |
| 2347 | BalaSourceFile* _tmp343_; |
| 2348 | BalaSourceFileType _tmp344_; |
| 2349 | BalaSourceFileType _tmp345_; |
| 2350 | _tmp343_ = file; |
| 2351 | _tmp344_ = bala_source_file_get_file_type (_tmp343_); |
| 2352 | _tmp345_ = _tmp344_; |
| 2353 | _tmp340_ = _tmp345_ == BALA_SOURCE_FILE_TYPE_FAST; |
| 2354 | } else { |
| 2355 | _tmp340_ = FALSE(0); |
| 2356 | } |
| 2357 | _tmp336_ = _tmp340_; |
| 2358 | } |
| 2359 | if (_tmp336_) { |
| 2360 | BalaSourceFile* _tmp346_; |
| 2361 | _tmp346_ = file; |
| 2362 | bala_source_file_accept (_tmp346_, (BalaCodeVisitor*) self); |
| 2363 | } |
| 2364 | _bala_source_file_unref0 (file)((file == ((void*)0)) ? ((void*)0) : (file = (bala_source_file_unref (file), ((void*)0)))); |
| 2365 | } |
| 2366 | _bala_iterable_unref0 (_file_list)((_file_list == ((void*)0)) ? ((void*)0) : (_file_list = (bala_iterable_unref (_file_list), ((void*)0)))); |
| 2367 | } |
| 2368 | _tmp347_ = bala_code_context_get_symbols_filename (context); |
| 2369 | _tmp348_ = _tmp347_; |
| 2370 | if (_tmp348_ != NULL((void*)0)) { |
| 2371 | FILE* stream = NULL((void*)0); |
| 2372 | const gchar* _tmp349_; |
| 2373 | const gchar* _tmp350_; |
| 2374 | FILE* _tmp351_; |
| 2375 | FILE* _tmp352_; |
| 2376 | _tmp349_ = bala_code_context_get_symbols_filename (context); |
| 2377 | _tmp350_ = _tmp349_; |
| 2378 | _tmp351_ = g_fopenfopen (_tmp350_, "w"); |
| 2379 | stream = _tmp351_; |
| 2380 | _tmp352_ = stream; |
| 2381 | if (_tmp352_ == NULL((void*)0)) { |
| 2382 | const gchar* _tmp353_; |
| 2383 | const gchar* _tmp354_; |
| 2384 | gchar* _tmp355_; |
| 2385 | gchar* _tmp356_; |
| 2386 | _tmp353_ = bala_code_context_get_symbols_filename (context); |
| 2387 | _tmp354_ = _tmp353_; |
| 2388 | _tmp355_ = g_strdup_printf ("unable to open `%s' for writing", _tmp354_); |
| 2389 | _tmp356_ = _tmp355_; |
| 2390 | bala_report_error (NULL((void*)0), _tmp356_); |
| 2391 | _g_free0 (_tmp356_)(_tmp356_ = (g_free (_tmp356_), ((void*)0))); |
| 2392 | bala_ccode_base_module_set_context (self, NULL((void*)0)); |
| 2393 | _fclose0 (stream)((stream == ((void*)0)) ? ((void*)0) : (stream = (fclose (stream ), ((void*)0)))); |
| 2394 | _bala_iterable_unref0 (source_files)((source_files == ((void*)0)) ? ((void*)0) : (source_files = ( bala_iterable_unref (source_files), ((void*)0)))); |
| 2395 | _bala_code_node_unref0 (gtk_ns)((gtk_ns == ((void*)0)) ? ((void*)0) : (gtk_ns = (bala_code_node_unref (gtk_ns), ((void*)0)))); |
| 2396 | _bala_code_node_unref0 (unichar_struct)((unichar_struct == ((void*)0)) ? ((void*)0) : (unichar_struct = (bala_code_node_unref (unichar_struct), ((void*)0)))); |
| 2397 | return; |
| 2398 | } |
| 2399 | { |
| 2400 | BalaList* _symbol_list = NULL((void*)0); |
| 2401 | BalaCCodeFile* _tmp357_; |
| 2402 | BalaList* _tmp358_; |
| 2403 | gint _symbol_size = 0; |
| 2404 | BalaList* _tmp359_; |
| 2405 | gint _tmp360_; |
| 2406 | gint _tmp361_; |
| 2407 | gint _symbol_index = 0; |
| 2408 | _tmp357_ = self->header_file; |
| 2409 | _tmp358_ = bala_ccode_file_get_symbols (_tmp357_); |
| 2410 | _symbol_list = _tmp358_; |
| 2411 | _tmp359_ = _symbol_list; |
| 2412 | _tmp360_ = bala_collection_get_size ((BalaCollection*) _tmp359_); |
| 2413 | _tmp361_ = _tmp360_; |
| 2414 | _symbol_size = _tmp361_; |
| 2415 | _symbol_index = -1; |
| 2416 | while (TRUE(!(0))) { |
| 2417 | gint _tmp362_; |
| 2418 | gint _tmp363_; |
| 2419 | gchar* symbol = NULL((void*)0); |
| 2420 | BalaList* _tmp364_; |
| 2421 | gpointer _tmp365_; |
| 2422 | FILE* _tmp366_; |
| 2423 | const gchar* _tmp367_; |
| 2424 | FILE* _tmp368_; |
| 2425 | _symbol_index = _symbol_index + 1; |
| 2426 | _tmp362_ = _symbol_index; |
| 2427 | _tmp363_ = _symbol_size; |
| 2428 | if (!(_tmp362_ < _tmp363_)) { |
| 2429 | break; |
| 2430 | } |
| 2431 | _tmp364_ = _symbol_list; |
| 2432 | _tmp365_ = bala_list_get (_tmp364_, _symbol_index); |
| 2433 | symbol = (gchar*) _tmp365_; |
| 2434 | _tmp366_ = stream; |
| 2435 | _tmp367_ = symbol; |
| 2436 | fputs (_tmp367_, _tmp366_); |
| 2437 | _tmp368_ = stream; |
| 2438 | fputc ('\n', _tmp368_); |
| 2439 | _g_free0 (symbol)(symbol = (g_free (symbol), ((void*)0))); |
| 2440 | } |
| 2441 | _bala_iterable_unref0 (_symbol_list)((_symbol_list == ((void*)0)) ? ((void*)0) : (_symbol_list = ( bala_iterable_unref (_symbol_list), ((void*)0)))); |
| 2442 | } |
| 2443 | _fclose0 (stream)((stream == ((void*)0)) ? ((void*)0) : (stream = (fclose (stream ), ((void*)0)))); |
| 2444 | stream = NULL((void*)0); |
| 2445 | _fclose0 (stream)((stream == ((void*)0)) ? ((void*)0) : (stream = (fclose (stream ), ((void*)0)))); |
| 2446 | } |
| 2447 | _tmp369_ = bala_code_context_get_header_filename (context); |
| 2448 | _tmp370_ = _tmp369_; |
| 2449 | if (_tmp370_ != NULL((void*)0)) { |
| 2450 | gboolean ret = FALSE(0); |
| 2451 | BalaProfile _tmp371_; |
| 2452 | BalaProfile _tmp372_; |
| 2453 | _tmp371_ = bala_code_context_get_profile (context); |
| 2454 | _tmp372_ = _tmp371_; |
| 2455 | if (_tmp372_ == BALA_PROFILE_GOBJECT) { |
| 2456 | BalaCCodeFile* _tmp373_; |
| 2457 | BalaCCodeFile* _tmp374_; |
| 2458 | const gchar* _tmp375_; |
| 2459 | const gchar* _tmp376_; |
| 2460 | gboolean _tmp377_; |
| 2461 | gboolean _tmp378_; |
| 2462 | _tmp373_ = self->header_file; |
| 2463 | bala_ccode_file_add_include (_tmp373_, "glib.h", FALSE(0)); |
| 2464 | _tmp374_ = self->header_file; |
| 2465 | _tmp375_ = bala_code_context_get_header_filename (context); |
| 2466 | _tmp376_ = _tmp375_; |
| 2467 | _tmp377_ = bala_code_context_get_version_header (context); |
| 2468 | _tmp378_ = _tmp377_; |
| 2469 | ret = bala_ccode_file_store (_tmp374_, _tmp376_, NULL((void*)0), _tmp378_, FALSE(0), "G_BEGIN_DECLS", "G_END_DECLS"); |
| 2470 | } else { |
| 2471 | BalaCCodeFile* _tmp379_; |
| 2472 | const gchar* _tmp380_; |
| 2473 | const gchar* _tmp381_; |
| 2474 | gboolean _tmp382_; |
| 2475 | gboolean _tmp383_; |
| 2476 | _tmp379_ = self->header_file; |
| 2477 | _tmp380_ = bala_code_context_get_header_filename (context); |
| 2478 | _tmp381_ = _tmp380_; |
| 2479 | _tmp382_ = bala_code_context_get_version_header (context); |
| 2480 | _tmp383_ = _tmp382_; |
| 2481 | ret = bala_ccode_file_store (_tmp379_, _tmp381_, NULL((void*)0), _tmp383_, FALSE(0), "#ifdef __cplusplus\nextern \"C\" {\n#endif", "#ifdef __cplusplus\n}\n#endif"); |
| 2482 | } |
| 2483 | if (!ret) { |
| 2484 | const gchar* _tmp384_; |
| 2485 | const gchar* _tmp385_; |
| 2486 | gchar* _tmp386_; |
| 2487 | gchar* _tmp387_; |
| 2488 | _tmp384_ = bala_code_context_get_header_filename (context); |
| 2489 | _tmp385_ = _tmp384_; |
| 2490 | _tmp386_ = g_strdup_printf ("unable to open `%s' for writing", _tmp385_); |
| 2491 | _tmp387_ = _tmp386_; |
| 2492 | bala_report_error (NULL((void*)0), _tmp387_); |
| 2493 | _g_free0 (_tmp387_)(_tmp387_ = (g_free (_tmp387_), ((void*)0))); |
| 2494 | } |
| 2495 | } |
| 2496 | _tmp388_ = bala_code_context_get_internal_header_filename (context); |
| 2497 | _tmp389_ = _tmp388_; |
| 2498 | if (_tmp389_ != NULL((void*)0)) { |
| 2499 | gboolean ret = FALSE(0); |
| 2500 | BalaProfile _tmp390_; |
| 2501 | BalaProfile _tmp391_; |
| 2502 | _tmp390_ = bala_code_context_get_profile (context); |
| 2503 | _tmp391_ = _tmp390_; |
| 2504 | if (_tmp391_ == BALA_PROFILE_GOBJECT) { |
| 2505 | BalaCCodeFile* _tmp392_; |
| 2506 | BalaCCodeFile* _tmp393_; |
| 2507 | const gchar* _tmp394_; |
| 2508 | const gchar* _tmp395_; |
| 2509 | gboolean _tmp396_; |
| 2510 | gboolean _tmp397_; |
| 2511 | _tmp392_ = self->internal_header_file; |
| 2512 | bala_ccode_file_add_include (_tmp392_, "glib.h", FALSE(0)); |
| 2513 | _tmp393_ = self->internal_header_file; |
| 2514 | _tmp394_ = bala_code_context_get_internal_header_filename (context); |
| 2515 | _tmp395_ = _tmp394_; |
| 2516 | _tmp396_ = bala_code_context_get_version_header (context); |
| 2517 | _tmp397_ = _tmp396_; |
| 2518 | ret = bala_ccode_file_store (_tmp393_, _tmp395_, NULL((void*)0), _tmp397_, FALSE(0), "G_BEGIN_DECLS", "G_END_DECLS"); |
| 2519 | } else { |
| 2520 | BalaCCodeFile* _tmp398_; |
| 2521 | const gchar* _tmp399_; |
| 2522 | const gchar* _tmp400_; |
| 2523 | gboolean _tmp401_; |
| 2524 | gboolean _tmp402_; |
| 2525 | _tmp398_ = self->internal_header_file; |
| 2526 | _tmp399_ = bala_code_context_get_internal_header_filename (context); |
| 2527 | _tmp400_ = _tmp399_; |
| 2528 | _tmp401_ = bala_code_context_get_version_header (context); |
| 2529 | _tmp402_ = _tmp401_; |
| 2530 | ret = bala_ccode_file_store (_tmp398_, _tmp400_, NULL((void*)0), _tmp402_, FALSE(0), "#ifdef __cplusplus\nextern \"C\" {\n#endif", "#ifdef __cplusplus\n}\n#endif"); |
| 2531 | } |
| 2532 | if (!ret) { |
| 2533 | const gchar* _tmp403_; |
| 2534 | const gchar* _tmp404_; |
| 2535 | gchar* _tmp405_; |
| 2536 | gchar* _tmp406_; |
| 2537 | _tmp403_ = bala_code_context_get_internal_header_filename (context); |
| 2538 | _tmp404_ = _tmp403_; |
| 2539 | _tmp405_ = g_strdup_printf ("unable to open `%s' for writing", _tmp404_); |
| 2540 | _tmp406_ = _tmp405_; |
| 2541 | bala_report_error (NULL((void*)0), _tmp406_); |
| 2542 | _g_free0 (_tmp406_)(_tmp406_ = (g_free (_tmp406_), ((void*)0))); |
| 2543 | } |
| 2544 | } |
| 2545 | bala_ccode_base_module_set_context (self, NULL((void*)0)); |
| 2546 | _bala_iterable_unref0 (source_files)((source_files == ((void*)0)) ? ((void*)0) : (source_files = ( bala_iterable_unref (source_files), ((void*)0)))); |
| 2547 | _bala_code_node_unref0 (gtk_ns)((gtk_ns == ((void*)0)) ? ((void*)0) : (gtk_ns = (bala_code_node_unref (gtk_ns), ((void*)0)))); |
| 2548 | _bala_code_node_unref0 (unichar_struct)((unichar_struct == ((void*)0)) ? ((void*)0) : (unichar_struct = (bala_code_node_unref (unichar_struct), ((void*)0)))); |
| 2549 | } |
| 2550 | |
| 2551 | static gpointer |
| 2552 | _bala_ccode_base_module_emit_context_ref0 (gpointer self) |
| 2553 | { |
| 2554 | return self ? bala_ccode_base_module_emit_context_ref (self) : NULL((void*)0); |
| 2555 | } |
| 2556 | |
| 2557 | void |
| 2558 | bala_ccode_base_module_push_context (BalaCCodeBaseModule* self, |
| 2559 | BalaCCodeBaseModuleEmitContext* emit_context) |
| 2560 | { |
| 2561 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 2562 | BalaCCodeBaseModuleEmitContext* _tmp3_; |
| 2563 | BalaCCodeFunction* _tmp4_; |
| 2564 | BalaCCodeFunction* _tmp5_; |
| 2565 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 2566 | g_return_if_fail (emit_context != NULL)do { if ((emit_context != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "emit_context != NULL" ); return; } } while (0); |
| 2567 | _tmp0_ = self->emit_context; |
| 2568 | if (_tmp0_ != NULL((void*)0)) { |
| 2569 | BalaList* _tmp1_; |
| 2570 | BalaCCodeBaseModuleEmitContext* _tmp2_; |
| 2571 | _tmp1_ = self->priv->emit_context_stack; |
| 2572 | _tmp2_ = self->emit_context; |
| 2573 | bala_collection_add ((BalaCollection*) _tmp1_, _tmp2_); |
| 2574 | } |
| 2575 | _tmp3_ = _bala_ccode_base_module_emit_context_ref0 (emit_context); |
| 2576 | _bala_ccode_base_module_emit_context_unref0 (self->emit_context)((self->emit_context == ((void*)0)) ? ((void*)0) : (self-> emit_context = (bala_ccode_base_module_emit_context_unref (self ->emit_context), ((void*)0)))); |
| 2577 | self->emit_context = _tmp3_; |
| 2578 | _tmp4_ = bala_ccode_base_module_get_ccode (self); |
| 2579 | _tmp5_ = _tmp4_; |
| 2580 | if (_tmp5_ != NULL((void*)0)) { |
| 2581 | BalaCCodeFunction* _tmp6_; |
| 2582 | BalaCCodeFunction* _tmp7_; |
| 2583 | BalaCCodeLineDirective* _tmp8_; |
| 2584 | _tmp6_ = bala_ccode_base_module_get_ccode (self); |
| 2585 | _tmp7_ = _tmp6_; |
| 2586 | _tmp8_ = self->current_line; |
| 2587 | bala_ccode_function_set_current_line (_tmp7_, _tmp8_); |
| 2588 | } |
| 2589 | } |
| 2590 | |
| 2591 | void |
| 2592 | bala_ccode_base_module_pop_context (BalaCCodeBaseModule* self) |
| 2593 | { |
| 2594 | BalaList* _tmp0_; |
| 2595 | gint _tmp1_; |
| 2596 | gint _tmp2_; |
| 2597 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 2598 | _tmp0_ = self->priv->emit_context_stack; |
| 2599 | _tmp1_ = bala_collection_get_size ((BalaCollection*) _tmp0_); |
| 2600 | _tmp2_ = _tmp1_; |
| 2601 | if (_tmp2_ > 0) { |
| 2602 | BalaList* _tmp3_; |
| 2603 | BalaList* _tmp4_; |
| 2604 | gint _tmp5_; |
| 2605 | gint _tmp6_; |
| 2606 | gpointer _tmp7_; |
| 2607 | BalaCCodeFunction* _tmp8_; |
| 2608 | BalaCCodeFunction* _tmp9_; |
| 2609 | _tmp3_ = self->priv->emit_context_stack; |
| 2610 | _tmp4_ = self->priv->emit_context_stack; |
| 2611 | _tmp5_ = bala_collection_get_size ((BalaCollection*) _tmp4_); |
| 2612 | _tmp6_ = _tmp5_; |
| 2613 | _tmp7_ = bala_list_remove_at (_tmp3_, _tmp6_ - 1); |
| 2614 | _bala_ccode_base_module_emit_context_unref0 (self->emit_context)((self->emit_context == ((void*)0)) ? ((void*)0) : (self-> emit_context = (bala_ccode_base_module_emit_context_unref (self ->emit_context), ((void*)0)))); |
| 2615 | self->emit_context = (BalaCCodeBaseModuleEmitContext*) _tmp7_; |
| 2616 | _tmp8_ = bala_ccode_base_module_get_ccode (self); |
| 2617 | _tmp9_ = _tmp8_; |
| 2618 | if (_tmp9_ != NULL((void*)0)) { |
| 2619 | BalaCCodeFunction* _tmp10_; |
| 2620 | BalaCCodeFunction* _tmp11_; |
| 2621 | BalaCCodeLineDirective* _tmp12_; |
| 2622 | _tmp10_ = bala_ccode_base_module_get_ccode (self); |
| 2623 | _tmp11_ = _tmp10_; |
| 2624 | _tmp12_ = self->current_line; |
| 2625 | bala_ccode_function_set_current_line (_tmp11_, _tmp12_); |
| 2626 | } |
| 2627 | } else { |
| 2628 | _bala_ccode_base_module_emit_context_unref0 (self->emit_context)((self->emit_context == ((void*)0)) ? ((void*)0) : (self-> emit_context = (bala_ccode_base_module_emit_context_unref (self ->emit_context), ((void*)0)))); |
| 2629 | self->emit_context = NULL((void*)0); |
| 2630 | } |
| 2631 | } |
| 2632 | |
| 2633 | void |
| 2634 | bala_ccode_base_module_push_line (BalaCCodeBaseModule* self, |
| 2635 | BalaSourceReference* source_reference) |
| 2636 | { |
| 2637 | BalaList* _tmp0_; |
| 2638 | BalaCCodeLineDirective* _tmp1_; |
| 2639 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 2640 | _tmp0_ = self->priv->line_directive_stack; |
| 2641 | _tmp1_ = self->current_line; |
| 2642 | bala_collection_add ((BalaCollection*) _tmp0_, _tmp1_); |
| 2643 | if (source_reference != NULL((void*)0)) { |
| 2644 | BalaSourceFile* _tmp2_; |
| 2645 | BalaSourceFile* _tmp3_; |
| 2646 | gchar* _tmp4_; |
| 2647 | gchar* _tmp5_; |
| 2648 | BalaSourceLocation _tmp6_ = {0}; |
| 2649 | BalaSourceLocation _tmp7_; |
| 2650 | BalaCCodeLineDirective* _tmp8_; |
| 2651 | BalaCCodeFunction* _tmp9_; |
| 2652 | BalaCCodeFunction* _tmp10_; |
| 2653 | _tmp2_ = bala_source_reference_get_file (source_reference); |
| 2654 | _tmp3_ = _tmp2_; |
| 2655 | _tmp4_ = bala_source_file_get_relative_filename (_tmp3_); |
| 2656 | _tmp5_ = _tmp4_; |
| 2657 | bala_source_reference_get_begin (source_reference, &_tmp6_); |
| 2658 | _tmp7_ = _tmp6_; |
| 2659 | _tmp8_ = bala_ccode_line_directive_new (_tmp5_, _tmp7_.line); |
| 2660 | _bala_ccode_node_unref0 (self->current_line)((self->current_line == ((void*)0)) ? ((void*)0) : (self-> current_line = (bala_ccode_node_unref (self->current_line) , ((void*)0)))); |
| 2661 | self->current_line = _tmp8_; |
| 2662 | _g_free0 (_tmp5_)(_tmp5_ = (g_free (_tmp5_), ((void*)0))); |
| 2663 | _tmp9_ = bala_ccode_base_module_get_ccode (self); |
| 2664 | _tmp10_ = _tmp9_; |
| 2665 | if (_tmp10_ != NULL((void*)0)) { |
| 2666 | BalaCCodeFunction* _tmp11_; |
| 2667 | BalaCCodeFunction* _tmp12_; |
| 2668 | BalaCCodeLineDirective* _tmp13_; |
| 2669 | _tmp11_ = bala_ccode_base_module_get_ccode (self); |
| 2670 | _tmp12_ = _tmp11_; |
| 2671 | _tmp13_ = self->current_line; |
| 2672 | bala_ccode_function_set_current_line (_tmp12_, _tmp13_); |
| 2673 | } |
| 2674 | } |
| 2675 | } |
| 2676 | |
| 2677 | void |
| 2678 | bala_ccode_base_module_pop_line (BalaCCodeBaseModule* self) |
| 2679 | { |
| 2680 | BalaList* _tmp0_; |
| 2681 | BalaList* _tmp1_; |
| 2682 | gint _tmp2_; |
| 2683 | gint _tmp3_; |
| 2684 | gpointer _tmp4_; |
| 2685 | BalaCCodeFunction* _tmp5_; |
| 2686 | BalaCCodeFunction* _tmp6_; |
| 2687 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 2688 | _tmp0_ = self->priv->line_directive_stack; |
| 2689 | _tmp1_ = self->priv->line_directive_stack; |
| 2690 | _tmp2_ = bala_collection_get_size ((BalaCollection*) _tmp1_); |
| 2691 | _tmp3_ = _tmp2_; |
| 2692 | _tmp4_ = bala_list_remove_at (_tmp0_, _tmp3_ - 1); |
| 2693 | _bala_ccode_node_unref0 (self->current_line)((self->current_line == ((void*)0)) ? ((void*)0) : (self-> current_line = (bala_ccode_node_unref (self->current_line) , ((void*)0)))); |
| 2694 | self->current_line = (BalaCCodeLineDirective*) _tmp4_; |
| 2695 | _tmp5_ = bala_ccode_base_module_get_ccode (self); |
| 2696 | _tmp6_ = _tmp5_; |
| 2697 | if (_tmp6_ != NULL((void*)0)) { |
| 2698 | BalaCCodeFunction* _tmp7_; |
| 2699 | BalaCCodeFunction* _tmp8_; |
| 2700 | BalaCCodeLineDirective* _tmp9_; |
| 2701 | _tmp7_ = bala_ccode_base_module_get_ccode (self); |
| 2702 | _tmp8_ = _tmp7_; |
| 2703 | _tmp9_ = self->current_line; |
| 2704 | bala_ccode_function_set_current_line (_tmp8_, _tmp9_); |
| 2705 | } |
| 2706 | } |
| 2707 | |
| 2708 | static gpointer |
| 2709 | _bala_ccode_node_ref0 (gpointer self) |
| 2710 | { |
| 2711 | return self ? bala_ccode_node_ref (self) : NULL((void*)0); |
| 2712 | } |
| 2713 | |
| 2714 | void |
| 2715 | bala_ccode_base_module_push_function (BalaCCodeBaseModule* self, |
| 2716 | BalaCCodeFunction* func) |
| 2717 | { |
| 2718 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 2719 | BalaArrayList* _tmp1_; |
| 2720 | BalaCCodeFunction* _tmp2_; |
| 2721 | BalaCCodeFunction* _tmp3_; |
| 2722 | BalaCCodeBaseModuleEmitContext* _tmp4_; |
| 2723 | BalaCCodeFunction* _tmp5_; |
| 2724 | BalaCCodeFunction* _tmp6_; |
| 2725 | BalaCCodeFunction* _tmp7_; |
| 2726 | BalaCCodeLineDirective* _tmp8_; |
| 2727 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 2728 | g_return_if_fail (func != NULL)do { if ((func != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "func != NULL" ); return; } } while (0); |
| 2729 | _tmp0_ = self->emit_context; |
| 2730 | _tmp1_ = _tmp0_->ccode_stack; |
| 2731 | _tmp2_ = bala_ccode_base_module_get_ccode (self); |
| 2732 | _tmp3_ = _tmp2_; |
| 2733 | bala_collection_add ((BalaCollection*) _tmp1_, _tmp3_); |
| 2734 | _tmp4_ = self->emit_context; |
| 2735 | _tmp5_ = _bala_ccode_node_ref0 (func); |
| 2736 | _bala_ccode_node_unref0 (_tmp4_->ccode)((_tmp4_->ccode == ((void*)0)) ? ((void*)0) : (_tmp4_-> ccode = (bala_ccode_node_unref (_tmp4_->ccode), ((void*)0) ))); |
| 2737 | _tmp4_->ccode = _tmp5_; |
| 2738 | _tmp6_ = bala_ccode_base_module_get_ccode (self); |
| 2739 | _tmp7_ = _tmp6_; |
| 2740 | _tmp8_ = self->current_line; |
| 2741 | bala_ccode_function_set_current_line (_tmp7_, _tmp8_); |
| 2742 | } |
| 2743 | |
| 2744 | void |
| 2745 | bala_ccode_base_module_pop_function (BalaCCodeBaseModule* self) |
| 2746 | { |
| 2747 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 2748 | BalaCCodeBaseModuleEmitContext* _tmp1_; |
| 2749 | BalaArrayList* _tmp2_; |
| 2750 | BalaCCodeBaseModuleEmitContext* _tmp3_; |
| 2751 | BalaArrayList* _tmp4_; |
| 2752 | gint _tmp5_; |
| 2753 | gint _tmp6_; |
| 2754 | gpointer _tmp7_; |
| 2755 | BalaCCodeFunction* _tmp8_; |
| 2756 | BalaCCodeFunction* _tmp9_; |
| 2757 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 2758 | _tmp0_ = self->emit_context; |
| 2759 | _tmp1_ = self->emit_context; |
| 2760 | _tmp2_ = _tmp1_->ccode_stack; |
| 2761 | _tmp3_ = self->emit_context; |
| 2762 | _tmp4_ = _tmp3_->ccode_stack; |
| 2763 | _tmp5_ = bala_collection_get_size ((BalaCollection*) _tmp4_); |
| 2764 | _tmp6_ = _tmp5_; |
| 2765 | _tmp7_ = bala_list_remove_at ((BalaList*) _tmp2_, _tmp6_ - 1); |
| 2766 | _bala_ccode_node_unref0 (_tmp0_->ccode)((_tmp0_->ccode == ((void*)0)) ? ((void*)0) : (_tmp0_-> ccode = (bala_ccode_node_unref (_tmp0_->ccode), ((void*)0) ))); |
| 2767 | _tmp0_->ccode = (BalaCCodeFunction*) _tmp7_; |
| 2768 | _tmp8_ = bala_ccode_base_module_get_ccode (self); |
| 2769 | _tmp9_ = _tmp8_; |
| 2770 | if (_tmp9_ != NULL((void*)0)) { |
| 2771 | BalaCCodeFunction* _tmp10_; |
| 2772 | BalaCCodeFunction* _tmp11_; |
| 2773 | BalaCCodeLineDirective* _tmp12_; |
| 2774 | _tmp10_ = bala_ccode_base_module_get_ccode (self); |
| 2775 | _tmp11_ = _tmp10_; |
| 2776 | _tmp12_ = self->current_line; |
| 2777 | bala_ccode_function_set_current_line (_tmp11_, _tmp12_); |
| 2778 | } |
| 2779 | } |
| 2780 | |
| 2781 | gboolean |
| 2782 | bala_ccode_base_module_add_symbol_declaration (BalaCCodeBaseModule* self, |
| 2783 | BalaCCodeFile* decl_space, |
| 2784 | BalaSymbol* sym, |
| 2785 | const gchar* name) |
| 2786 | { |
| 2787 | BalaSourceReference* _tmp0_; |
| 2788 | BalaSourceReference* _tmp1_; |
| 2789 | gboolean _tmp6_; |
| 2790 | gboolean _tmp7_; |
| 2791 | gboolean _tmp15_ = FALSE(0); |
| 2792 | gboolean _tmp18_ = FALSE(0); |
| 2793 | gboolean _tmp19_ = FALSE(0); |
| 2794 | gboolean _tmp20_; |
| 2795 | gboolean _tmp21_; |
| 2796 | gboolean result = FALSE(0); |
| 2797 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 2798 | g_return_val_if_fail (decl_space != NULL, FALSE)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return ((0)); } } while (0); |
| 2799 | g_return_val_if_fail (sym != NULL, FALSE)do { if ((sym != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "sym != NULL") ; return ((0)); } } while (0); |
| 2800 | g_return_val_if_fail (name != NULL, FALSE)do { if ((name != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "name != NULL" ); return ((0)); } } while (0); |
| 2801 | if (bala_ccode_file_add_declaration (decl_space, name)) { |
| 2802 | result = TRUE(!(0)); |
| 2803 | return result; |
| 2804 | } |
| 2805 | _tmp0_ = bala_code_node_get_source_reference ((BalaCodeNode*) sym); |
| 2806 | _tmp1_ = _tmp0_; |
| 2807 | if (_tmp1_ != NULL((void*)0)) { |
| 2808 | BalaSourceReference* _tmp2_; |
| 2809 | BalaSourceReference* _tmp3_; |
| 2810 | BalaSourceFile* _tmp4_; |
| 2811 | BalaSourceFile* _tmp5_; |
| 2812 | _tmp2_ = bala_code_node_get_source_reference ((BalaCodeNode*) sym); |
| 2813 | _tmp3_ = _tmp2_; |
| 2814 | _tmp4_ = bala_source_reference_get_file (_tmp3_); |
| 2815 | _tmp5_ = _tmp4_; |
| 2816 | bala_source_file_set_used (_tmp5_, TRUE(!(0))); |
| 2817 | } |
| 2818 | _tmp6_ = bala_symbol_get_anonymous (sym); |
| 2819 | _tmp7_ = _tmp6_; |
| 2820 | if (_tmp7_) { |
| 2821 | gboolean _tmp8_ = FALSE(0); |
| 2822 | gboolean _tmp9_; |
| 2823 | gboolean _tmp10_; |
| 2824 | _tmp9_ = bala_ccode_file_get_is_header (decl_space); |
| 2825 | _tmp10_ = _tmp9_; |
| 2826 | if (!_tmp10_) { |
| 2827 | BalaCodeContext* _tmp11_; |
| 2828 | BalaCodeContext* _tmp12_; |
| 2829 | gboolean _tmp13_; |
| 2830 | gboolean _tmp14_; |
| 2831 | _tmp11_ = bala_code_context_get (); |
| 2832 | _tmp12_ = _tmp11_; |
| 2833 | _tmp13_ = bala_code_context_get_use_header (_tmp12_); |
| 2834 | _tmp14_ = _tmp13_; |
| 2835 | _tmp8_ = _tmp14_; |
| 2836 | _bala_code_context_unref0 (_tmp12_)((_tmp12_ == ((void*)0)) ? ((void*)0) : (_tmp12_ = (bala_code_context_unref (_tmp12_), ((void*)0)))); |
| 2837 | } else { |
| 2838 | _tmp8_ = FALSE(0); |
| 2839 | } |
| 2840 | result = _tmp8_; |
| 2841 | return result; |
| 2842 | } |
| 2843 | if (G_TYPE_CHECK_INSTANCE_TYPE (sym, BALA_TYPE_CONSTANT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( sym); GType __t = ((bala_constant_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 2844 | BalaExpression* _tmp16_; |
| 2845 | BalaExpression* _tmp17_; |
| 2846 | _tmp16_ = bala_constant_get_value (G_TYPE_CHECK_INSTANCE_CAST (sym, BALA_TYPE_CONSTANT, BalaConstant)(((BalaConstant*) g_type_check_instance_cast ((GTypeInstance* ) (sym), ((bala_constant_get_type ())))))); |
| 2847 | _tmp17_ = _tmp16_; |
| 2848 | _tmp15_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, BALA_TYPE_INITIALIZER_LIST)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp17_); GType __t = ((bala_initializer_list_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 2849 | } else { |
| 2850 | _tmp15_ = FALSE(0); |
| 2851 | } |
| 2852 | if (_tmp15_) { |
| 2853 | result = FALSE(0); |
| 2854 | return result; |
| 2855 | } |
| 2856 | _tmp20_ = bala_symbol_get_external_package (sym); |
| 2857 | _tmp21_ = _tmp20_; |
| 2858 | if (_tmp21_) { |
| 2859 | _tmp19_ = TRUE(!(0)); |
| 2860 | } else { |
| 2861 | gboolean _tmp22_ = FALSE(0); |
| 2862 | gboolean _tmp23_ = FALSE(0); |
| 2863 | gboolean _tmp24_; |
| 2864 | gboolean _tmp25_; |
| 2865 | _tmp24_ = bala_ccode_file_get_is_header (decl_space); |
| 2866 | _tmp25_ = _tmp24_; |
| 2867 | if (!_tmp25_) { |
| 2868 | BalaCodeContext* _tmp26_; |
| 2869 | BalaCodeContext* _tmp27_; |
| 2870 | gboolean _tmp28_; |
| 2871 | gboolean _tmp29_; |
| 2872 | _tmp26_ = bala_code_context_get (); |
| 2873 | _tmp27_ = _tmp26_; |
| 2874 | _tmp28_ = bala_code_context_get_use_header (_tmp27_); |
| 2875 | _tmp29_ = _tmp28_; |
| 2876 | _tmp23_ = _tmp29_; |
| 2877 | _bala_code_context_unref0 (_tmp27_)((_tmp27_ == ((void*)0)) ? ((void*)0) : (_tmp27_ = (bala_code_context_unref (_tmp27_), ((void*)0)))); |
| 2878 | } else { |
| 2879 | _tmp23_ = FALSE(0); |
| 2880 | } |
| 2881 | if (_tmp23_) { |
| 2882 | _tmp22_ = !bala_symbol_is_internal_symbol (sym); |
| 2883 | } else { |
| 2884 | _tmp22_ = FALSE(0); |
| 2885 | } |
| 2886 | _tmp19_ = _tmp22_; |
| 2887 | } |
| 2888 | if (_tmp19_) { |
| 2889 | _tmp18_ = TRUE(!(0)); |
| 2890 | } else { |
| 2891 | gboolean _tmp30_ = FALSE(0); |
| 2892 | gboolean _tmp31_; |
| 2893 | gboolean _tmp32_; |
| 2894 | _tmp31_ = bala_symbol_get_is_extern (sym); |
| 2895 | _tmp32_ = _tmp31_; |
| 2896 | if (_tmp32_) { |
| 2897 | gchar* _tmp33_; |
| 2898 | gchar* _tmp34_; |
| 2899 | gint _tmp35_; |
| 2900 | gint _tmp36_; |
| 2901 | _tmp33_ = bala_get_ccode_header_filenames (sym); |
| 2902 | _tmp34_ = _tmp33_; |
| 2903 | _tmp35_ = strlen (_tmp34_); |
| 2904 | _tmp36_ = _tmp35_; |
| 2905 | _tmp30_ = _tmp36_ > 0; |
| 2906 | _g_free0 (_tmp34_)(_tmp34_ = (g_free (_tmp34_), ((void*)0))); |
| 2907 | } else { |
| 2908 | _tmp30_ = FALSE(0); |
| 2909 | } |
| 2910 | _tmp18_ = _tmp30_; |
| 2911 | } |
| 2912 | if (_tmp18_) { |
| 2913 | gchar* _tmp37_; |
| 2914 | gchar* _tmp38_; |
| 2915 | gchar** _tmp39_; |
| 2916 | gchar** _tmp40_; |
| 2917 | gchar** _tmp41_; |
| 2918 | gint _tmp41__length1; |
| 2919 | gchar* _tmp43_; |
| 2920 | gchar* _tmp44_; |
| 2921 | gchar** _tmp45_; |
| 2922 | gchar** _tmp46_; |
| 2923 | gchar** _tmp47_; |
| 2924 | gint _tmp47__length1; |
| 2925 | _tmp37_ = bala_get_ccode_feature_test_macros (sym); |
| 2926 | _tmp38_ = _tmp37_; |
| 2927 | _tmp40_ = _tmp39_ = g_strsplit (_tmp38_, ",", 0); |
| 2928 | _tmp41_ = _tmp40_; |
| 2929 | _tmp41__length1 = _bala_array_length (_tmp39_); |
| 2930 | _g_free0 (_tmp38_)(_tmp38_ = (g_free (_tmp38_), ((void*)0))); |
| 2931 | { |
| 2932 | gchar** feature_test_macro_collection = NULL((void*)0); |
| 2933 | gint feature_test_macro_collection_length1 = 0; |
| 2934 | gint _feature_test_macro_collection_size_ = 0; |
| 2935 | gint feature_test_macro_it = 0; |
| 2936 | feature_test_macro_collection = _tmp41_; |
| 2937 | feature_test_macro_collection_length1 = _tmp41__length1; |
| 2938 | for (feature_test_macro_it = 0; feature_test_macro_it < feature_test_macro_collection_length1; feature_test_macro_it = feature_test_macro_it + 1) { |
| 2939 | const gchar* feature_test_macro = NULL((void*)0); |
| 2940 | feature_test_macro = feature_test_macro_collection[feature_test_macro_it]; |
| 2941 | { |
| 2942 | const gchar* _tmp42_; |
| 2943 | _tmp42_ = feature_test_macro; |
| 2944 | bala_ccode_file_add_feature_test_macro (decl_space, _tmp42_); |
| 2945 | } |
| 2946 | } |
| 2947 | feature_test_macro_collection = (_bala_array_free (feature_test_macro_collection, feature_test_macro_collection_length1, (GDestroyNotify) g_free), NULL((void*)0)); |
| 2948 | } |
| 2949 | _tmp43_ = bala_get_ccode_header_filenames (sym); |
| 2950 | _tmp44_ = _tmp43_; |
| 2951 | _tmp46_ = _tmp45_ = g_strsplit (_tmp44_, ",", 0); |
| 2952 | _tmp47_ = _tmp46_; |
| 2953 | _tmp47__length1 = _bala_array_length (_tmp45_); |
| 2954 | _g_free0 (_tmp44_)(_tmp44_ = (g_free (_tmp44_), ((void*)0))); |
| 2955 | { |
| 2956 | gchar** header_filename_collection = NULL((void*)0); |
| 2957 | gint header_filename_collection_length1 = 0; |
| 2958 | gint _header_filename_collection_size_ = 0; |
| 2959 | gint header_filename_it = 0; |
| 2960 | header_filename_collection = _tmp47_; |
| 2961 | header_filename_collection_length1 = _tmp47__length1; |
| 2962 | for (header_filename_it = 0; header_filename_it < header_filename_collection_length1; header_filename_it = header_filename_it + 1) { |
| 2963 | const gchar* header_filename = NULL((void*)0); |
| 2964 | header_filename = header_filename_collection[header_filename_it]; |
| 2965 | { |
| 2966 | gboolean _tmp48_ = FALSE(0); |
| 2967 | gboolean _tmp49_; |
| 2968 | gboolean _tmp50_; |
| 2969 | const gchar* _tmp59_; |
| 2970 | _tmp49_ = bala_symbol_get_is_extern (sym); |
| 2971 | _tmp50_ = _tmp49_; |
| 2972 | if (!_tmp50_) { |
| 2973 | gboolean _tmp51_ = FALSE(0); |
| 2974 | gboolean _tmp52_; |
| 2975 | gboolean _tmp53_; |
| 2976 | _tmp52_ = bala_symbol_get_external_package (sym); |
| 2977 | _tmp53_ = _tmp52_; |
| 2978 | if (!_tmp53_) { |
| 2979 | _tmp51_ = TRUE(!(0)); |
| 2980 | } else { |
| 2981 | gboolean _tmp54_ = FALSE(0); |
| 2982 | gboolean _tmp55_; |
| 2983 | gboolean _tmp56_; |
| 2984 | _tmp55_ = bala_symbol_get_external_package (sym); |
| 2985 | _tmp56_ = _tmp55_; |
| 2986 | if (_tmp56_) { |
| 2987 | gboolean _tmp57_; |
| 2988 | gboolean _tmp58_; |
| 2989 | _tmp57_ = bala_symbol_get_from_commandline (sym); |
| 2990 | _tmp58_ = _tmp57_; |
| 2991 | _tmp54_ = _tmp58_; |
| 2992 | } else { |
| 2993 | _tmp54_ = FALSE(0); |
| 2994 | } |
| 2995 | _tmp51_ = _tmp54_; |
| 2996 | } |
| 2997 | _tmp48_ = _tmp51_; |
| 2998 | } else { |
| 2999 | _tmp48_ = FALSE(0); |
| 3000 | } |
| 3001 | _tmp59_ = header_filename; |
| 3002 | bala_ccode_file_add_include (decl_space, _tmp59_, _tmp48_); |
| 3003 | } |
| 3004 | } |
| 3005 | header_filename_collection = (_bala_array_free (header_filename_collection, header_filename_collection_length1, (GDestroyNotify) g_free), NULL((void*)0)); |
| 3006 | } |
| 3007 | result = TRUE(!(0)); |
| 3008 | return result; |
| 3009 | } else { |
| 3010 | result = FALSE(0); |
| 3011 | return result; |
| 3012 | } |
| 3013 | } |
| 3014 | |
| 3015 | static void |
| 3016 | bala_ccode_base_module_real_append_bala_array_free (BalaCCodeBaseModule* self) |
| 3017 | { |
| 3018 | } |
| 3019 | |
| 3020 | void |
| 3021 | bala_ccode_base_module_append_bala_array_free (BalaCCodeBaseModule* self) |
| 3022 | { |
| 3023 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 3024 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->append_bala_array_free (self); |
| 3025 | } |
| 3026 | |
| 3027 | static void |
| 3028 | bala_ccode_base_module_real_append_bala_array_move (BalaCCodeBaseModule* self) |
| 3029 | { |
| 3030 | } |
| 3031 | |
| 3032 | void |
| 3033 | bala_ccode_base_module_append_bala_array_move (BalaCCodeBaseModule* self) |
| 3034 | { |
| 3035 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 3036 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->append_bala_array_move (self); |
| 3037 | } |
| 3038 | |
| 3039 | static void |
| 3040 | bala_ccode_base_module_real_append_bala_array_length (BalaCCodeBaseModule* self) |
| 3041 | { |
| 3042 | } |
| 3043 | |
| 3044 | void |
| 3045 | bala_ccode_base_module_append_bala_array_length (BalaCCodeBaseModule* self) |
| 3046 | { |
| 3047 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 3048 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->append_bala_array_length (self); |
| 3049 | } |
| 3050 | |
| 3051 | static void |
| 3052 | bala_ccode_base_module_real_append_params_array (BalaCCodeBaseModule* self, |
| 3053 | BalaMethod* m) |
| 3054 | { |
| 3055 | g_return_if_fail (m != NULL)do { if ((m != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "m != NULL"); return ; } } while (0); |
| 3056 | } |
| 3057 | |
| 3058 | void |
| 3059 | bala_ccode_base_module_append_params_array (BalaCCodeBaseModule* self, |
| 3060 | BalaMethod* m) |
| 3061 | { |
| 3062 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 3063 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->append_params_array (self, m); |
| 3064 | } |
| 3065 | |
| 3066 | void |
| 3067 | bala_ccode_base_module_append_bala_clear_mutex (BalaCCodeBaseModule* self, |
| 3068 | const gchar* typename, |
| 3069 | const gchar* funcprefix) |
| 3070 | { |
| 3071 | BalaCCodeFile* _tmp0_; |
| 3072 | BalaCCodeFunction* fun = NULL((void*)0); |
| 3073 | gchar* _tmp1_; |
| 3074 | gchar* _tmp2_; |
| 3075 | BalaCCodeFunction* _tmp3_; |
| 3076 | BalaCCodeFunction* _tmp4_; |
| 3077 | gchar* _tmp5_; |
| 3078 | gchar* _tmp6_; |
| 3079 | BalaCCodeParameter* _tmp7_; |
| 3080 | BalaCCodeParameter* _tmp8_; |
| 3081 | BalaCCodeFunction* _tmp9_; |
| 3082 | BalaCCodeFunction* _tmp10_; |
| 3083 | BalaCCodeConstant* _tmp11_; |
| 3084 | BalaCCodeConstant* _tmp12_; |
| 3085 | BalaCCodeVariableDeclarator* _tmp13_; |
| 3086 | BalaCCodeVariableDeclarator* _tmp14_; |
| 3087 | BalaCCodeFunctionCall* cmp = NULL((void*)0); |
| 3088 | BalaCCodeIdentifier* _tmp15_; |
| 3089 | BalaCCodeIdentifier* _tmp16_; |
| 3090 | BalaCCodeFunctionCall* _tmp17_; |
| 3091 | BalaCCodeFunctionCall* _tmp18_; |
| 3092 | BalaCCodeIdentifier* _tmp19_; |
| 3093 | BalaCCodeIdentifier* _tmp20_; |
| 3094 | BalaCCodeIdentifier* _tmp21_; |
| 3095 | BalaCCodeIdentifier* _tmp22_; |
| 3096 | BalaCCodeUnaryExpression* _tmp23_; |
| 3097 | BalaCCodeUnaryExpression* _tmp24_; |
| 3098 | gchar* _tmp25_; |
| 3099 | gchar* _tmp26_; |
| 3100 | gchar* _tmp27_; |
| 3101 | gchar* _tmp28_; |
| 3102 | BalaCCodeIdentifier* _tmp29_; |
| 3103 | BalaCCodeIdentifier* _tmp30_; |
| 3104 | BalaCCodeFunction* _tmp31_; |
| 3105 | BalaCCodeFunction* _tmp32_; |
| 3106 | BalaCCodeFunctionCall* mutex_clear = NULL((void*)0); |
| 3107 | gchar* _tmp33_; |
| 3108 | gchar* _tmp34_; |
| 3109 | BalaCCodeIdentifier* _tmp35_; |
| 3110 | BalaCCodeIdentifier* _tmp36_; |
| 3111 | BalaCCodeFunctionCall* _tmp37_; |
| 3112 | BalaCCodeFunctionCall* _tmp38_; |
| 3113 | BalaCCodeIdentifier* _tmp39_; |
| 3114 | BalaCCodeIdentifier* _tmp40_; |
| 3115 | BalaCCodeFunction* _tmp41_; |
| 3116 | BalaCCodeFunction* _tmp42_; |
| 3117 | BalaCCodeFunctionCall* mset = NULL((void*)0); |
| 3118 | BalaCCodeIdentifier* _tmp43_; |
| 3119 | BalaCCodeIdentifier* _tmp44_; |
| 3120 | BalaCCodeFunctionCall* _tmp45_; |
| 3121 | BalaCCodeFunctionCall* _tmp46_; |
| 3122 | BalaCCodeIdentifier* _tmp47_; |
| 3123 | BalaCCodeIdentifier* _tmp48_; |
| 3124 | BalaCCodeConstant* _tmp49_; |
| 3125 | BalaCCodeConstant* _tmp50_; |
| 3126 | gchar* _tmp51_; |
| 3127 | gchar* _tmp52_; |
| 3128 | gchar* _tmp53_; |
| 3129 | gchar* _tmp54_; |
| 3130 | BalaCCodeIdentifier* _tmp55_; |
| 3131 | BalaCCodeIdentifier* _tmp56_; |
| 3132 | BalaCCodeFunction* _tmp57_; |
| 3133 | BalaCCodeFunction* _tmp58_; |
| 3134 | BalaCCodeFunction* _tmp59_; |
| 3135 | BalaCCodeFunction* _tmp60_; |
| 3136 | BalaCCodeFile* _tmp61_; |
| 3137 | BalaCCodeFile* _tmp62_; |
| 3138 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 3139 | g_return_if_fail (typename != NULL)do { if ((typename != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "typename != NULL" ); return; } } while (0); |
| 3140 | g_return_if_fail (funcprefix != NULL)do { if ((funcprefix != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "funcprefix != NULL" ); return; } } while (0); |
| 3141 | _tmp0_ = self->cfile; |
| 3142 | bala_ccode_file_add_include (_tmp0_, "string.h", FALSE(0)); |
| 3143 | _tmp1_ = g_strconcat ("_bala_clear_", typename, NULL((void*)0)); |
| 3144 | _tmp2_ = _tmp1_; |
| 3145 | _tmp3_ = bala_ccode_function_new (_tmp2_, "void"); |
| 3146 | _tmp4_ = _tmp3_; |
| 3147 | _g_free0 (_tmp2_)(_tmp2_ = (g_free (_tmp2_), ((void*)0))); |
| 3148 | fun = _tmp4_; |
| 3149 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) fun, BALA_CCODE_MODIFIERS_STATIC); |
| 3150 | _tmp5_ = g_strconcat (typename, " *", NULL((void*)0)); |
| 3151 | _tmp6_ = _tmp5_; |
| 3152 | _tmp7_ = bala_ccode_parameter_new ("mutex", _tmp6_); |
| 3153 | _tmp8_ = _tmp7_; |
| 3154 | bala_ccode_function_add_parameter (fun, _tmp8_); |
| 3155 | _bala_ccode_node_unref0 (_tmp8_)((_tmp8_ == ((void*)0)) ? ((void*)0) : (_tmp8_ = (bala_ccode_node_unref (_tmp8_), ((void*)0)))); |
| 3156 | _g_free0 (_tmp6_)(_tmp6_ = (g_free (_tmp6_), ((void*)0))); |
| 3157 | bala_ccode_base_module_push_function (self, fun); |
| 3158 | _tmp9_ = bala_ccode_base_module_get_ccode (self); |
| 3159 | _tmp10_ = _tmp9_; |
| 3160 | _tmp11_ = bala_ccode_constant_new ("{ 0 }"); |
| 3161 | _tmp12_ = _tmp11_; |
| 3162 | _tmp13_ = bala_ccode_variable_declarator_new_zero ("zero_mutex", (BalaCCodeExpression*) _tmp12_, NULL((void*)0)); |
| 3163 | _tmp14_ = _tmp13_; |
| 3164 | bala_ccode_function_add_declaration (_tmp10_, typename, (BalaCCodeDeclarator*) _tmp14_, 0); |
| 3165 | _bala_ccode_node_unref0 (_tmp14_)((_tmp14_ == ((void*)0)) ? ((void*)0) : (_tmp14_ = (bala_ccode_node_unref (_tmp14_), ((void*)0)))); |
| 3166 | _bala_ccode_node_unref0 (_tmp12_)((_tmp12_ == ((void*)0)) ? ((void*)0) : (_tmp12_ = (bala_ccode_node_unref (_tmp12_), ((void*)0)))); |
| 3167 | _tmp15_ = bala_ccode_identifier_new ("memcmp"); |
| 3168 | _tmp16_ = _tmp15_; |
| 3169 | _tmp17_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp16_); |
| 3170 | _tmp18_ = _tmp17_; |
| 3171 | _bala_ccode_node_unref0 (_tmp16_)((_tmp16_ == ((void*)0)) ? ((void*)0) : (_tmp16_ = (bala_ccode_node_unref (_tmp16_), ((void*)0)))); |
| 3172 | cmp = _tmp18_; |
| 3173 | _tmp19_ = bala_ccode_identifier_new ("mutex"); |
| 3174 | _tmp20_ = _tmp19_; |
| 3175 | bala_ccode_function_call_add_argument (cmp, (BalaCCodeExpression*) _tmp20_); |
| 3176 | _bala_ccode_node_unref0 (_tmp20_)((_tmp20_ == ((void*)0)) ? ((void*)0) : (_tmp20_ = (bala_ccode_node_unref (_tmp20_), ((void*)0)))); |
| 3177 | _tmp21_ = bala_ccode_identifier_new ("zero_mutex"); |
| 3178 | _tmp22_ = _tmp21_; |
| 3179 | _tmp23_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, (BalaCCodeExpression*) _tmp22_); |
| 3180 | _tmp24_ = _tmp23_; |
| 3181 | bala_ccode_function_call_add_argument (cmp, (BalaCCodeExpression*) _tmp24_); |
| 3182 | _bala_ccode_node_unref0 (_tmp24_)((_tmp24_ == ((void*)0)) ? ((void*)0) : (_tmp24_ = (bala_ccode_node_unref (_tmp24_), ((void*)0)))); |
| 3183 | _bala_ccode_node_unref0 (_tmp22_)((_tmp22_ == ((void*)0)) ? ((void*)0) : (_tmp22_ = (bala_ccode_node_unref (_tmp22_), ((void*)0)))); |
| 3184 | _tmp25_ = g_strconcat ("sizeof (", typename, NULL((void*)0)); |
| 3185 | _tmp26_ = _tmp25_; |
| 3186 | _tmp27_ = g_strconcat (_tmp26_, ")", NULL((void*)0)); |
| 3187 | _tmp28_ = _tmp27_; |
| 3188 | _tmp29_ = bala_ccode_identifier_new (_tmp28_); |
| 3189 | _tmp30_ = _tmp29_; |
| 3190 | bala_ccode_function_call_add_argument (cmp, (BalaCCodeExpression*) _tmp30_); |
| 3191 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 3192 | _g_free0 (_tmp28_)(_tmp28_ = (g_free (_tmp28_), ((void*)0))); |
| 3193 | _g_free0 (_tmp26_)(_tmp26_ = (g_free (_tmp26_), ((void*)0))); |
| 3194 | _tmp31_ = bala_ccode_base_module_get_ccode (self); |
| 3195 | _tmp32_ = _tmp31_; |
| 3196 | bala_ccode_function_open_if (_tmp32_, (BalaCCodeExpression*) cmp); |
| 3197 | _tmp33_ = g_strconcat (funcprefix, "_clear", NULL((void*)0)); |
| 3198 | _tmp34_ = _tmp33_; |
| 3199 | _tmp35_ = bala_ccode_identifier_new (_tmp34_); |
| 3200 | _tmp36_ = _tmp35_; |
| 3201 | _tmp37_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp36_); |
| 3202 | _tmp38_ = _tmp37_; |
| 3203 | _bala_ccode_node_unref0 (_tmp36_)((_tmp36_ == ((void*)0)) ? ((void*)0) : (_tmp36_ = (bala_ccode_node_unref (_tmp36_), ((void*)0)))); |
| 3204 | _g_free0 (_tmp34_)(_tmp34_ = (g_free (_tmp34_), ((void*)0))); |
| 3205 | mutex_clear = _tmp38_; |
| 3206 | _tmp39_ = bala_ccode_identifier_new ("mutex"); |
| 3207 | _tmp40_ = _tmp39_; |
| 3208 | bala_ccode_function_call_add_argument (mutex_clear, (BalaCCodeExpression*) _tmp40_); |
| 3209 | _bala_ccode_node_unref0 (_tmp40_)((_tmp40_ == ((void*)0)) ? ((void*)0) : (_tmp40_ = (bala_ccode_node_unref (_tmp40_), ((void*)0)))); |
| 3210 | _tmp41_ = bala_ccode_base_module_get_ccode (self); |
| 3211 | _tmp42_ = _tmp41_; |
| 3212 | bala_ccode_function_add_expression (_tmp42_, (BalaCCodeExpression*) mutex_clear); |
| 3213 | _tmp43_ = bala_ccode_identifier_new ("memset"); |
| 3214 | _tmp44_ = _tmp43_; |
| 3215 | _tmp45_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp44_); |
| 3216 | _tmp46_ = _tmp45_; |
| 3217 | _bala_ccode_node_unref0 (_tmp44_)((_tmp44_ == ((void*)0)) ? ((void*)0) : (_tmp44_ = (bala_ccode_node_unref (_tmp44_), ((void*)0)))); |
| 3218 | mset = _tmp46_; |
| 3219 | _tmp47_ = bala_ccode_identifier_new ("mutex"); |
| 3220 | _tmp48_ = _tmp47_; |
| 3221 | bala_ccode_function_call_add_argument (mset, (BalaCCodeExpression*) _tmp48_); |
| 3222 | _bala_ccode_node_unref0 (_tmp48_)((_tmp48_ == ((void*)0)) ? ((void*)0) : (_tmp48_ = (bala_ccode_node_unref (_tmp48_), ((void*)0)))); |
| 3223 | _tmp49_ = bala_ccode_constant_new ("0"); |
| 3224 | _tmp50_ = _tmp49_; |
| 3225 | bala_ccode_function_call_add_argument (mset, (BalaCCodeExpression*) _tmp50_); |
| 3226 | _bala_ccode_node_unref0 (_tmp50_)((_tmp50_ == ((void*)0)) ? ((void*)0) : (_tmp50_ = (bala_ccode_node_unref (_tmp50_), ((void*)0)))); |
| 3227 | _tmp51_ = g_strconcat ("sizeof (", typename, NULL((void*)0)); |
| 3228 | _tmp52_ = _tmp51_; |
| 3229 | _tmp53_ = g_strconcat (_tmp52_, ")", NULL((void*)0)); |
| 3230 | _tmp54_ = _tmp53_; |
| 3231 | _tmp55_ = bala_ccode_identifier_new (_tmp54_); |
| 3232 | _tmp56_ = _tmp55_; |
| 3233 | bala_ccode_function_call_add_argument (mset, (BalaCCodeExpression*) _tmp56_); |
| 3234 | _bala_ccode_node_unref0 (_tmp56_)((_tmp56_ == ((void*)0)) ? ((void*)0) : (_tmp56_ = (bala_ccode_node_unref (_tmp56_), ((void*)0)))); |
| 3235 | _g_free0 (_tmp54_)(_tmp54_ = (g_free (_tmp54_), ((void*)0))); |
| 3236 | _g_free0 (_tmp52_)(_tmp52_ = (g_free (_tmp52_), ((void*)0))); |
| 3237 | _tmp57_ = bala_ccode_base_module_get_ccode (self); |
| 3238 | _tmp58_ = _tmp57_; |
| 3239 | bala_ccode_function_add_expression (_tmp58_, (BalaCCodeExpression*) mset); |
| 3240 | _tmp59_ = bala_ccode_base_module_get_ccode (self); |
| 3241 | _tmp60_ = _tmp59_; |
| 3242 | bala_ccode_function_close (_tmp60_); |
| 3243 | bala_ccode_base_module_pop_function (self); |
| 3244 | _tmp61_ = self->cfile; |
| 3245 | bala_ccode_file_add_function_declaration (_tmp61_, fun); |
| 3246 | _tmp62_ = self->cfile; |
| 3247 | bala_ccode_file_add_function (_tmp62_, fun); |
| 3248 | _bala_ccode_node_unref0 (mset)((mset == ((void*)0)) ? ((void*)0) : (mset = (bala_ccode_node_unref (mset), ((void*)0)))); |
| 3249 | _bala_ccode_node_unref0 (mutex_clear)((mutex_clear == ((void*)0)) ? ((void*)0) : (mutex_clear = (bala_ccode_node_unref (mutex_clear), ((void*)0)))); |
| 3250 | _bala_ccode_node_unref0 (cmp)((cmp == ((void*)0)) ? ((void*)0) : (cmp = (bala_ccode_node_unref (cmp), ((void*)0)))); |
| 3251 | _bala_ccode_node_unref0 (fun)((fun == ((void*)0)) ? ((void*)0) : (fun = (bala_ccode_node_unref (fun), ((void*)0)))); |
| 3252 | } |
| 3253 | |
| 3254 | static void |
| 3255 | bala_ccode_base_module_real_visit_source_file (BalaCodeVisitor* base, |
| 3256 | BalaSourceFile* source_file) |
| 3257 | { |
| 3258 | BalaCCodeBaseModule * self; |
| 3259 | BalaCCodeFile* _tmp0_; |
| 3260 | GHashFunc _tmp1_; |
| 3261 | GEqualFunc _tmp2_; |
| 3262 | BalaHashSet* _tmp3_; |
| 3263 | GHashFunc _tmp4_; |
| 3264 | GEqualFunc _tmp5_; |
| 3265 | BalaHashSet* _tmp6_; |
| 3266 | GHashFunc _tmp7_; |
| 3267 | GEqualFunc _tmp8_; |
| 3268 | BalaHashSet* _tmp9_; |
| 3269 | BalaCodeContext* _tmp10_; |
| 3270 | BalaReport* _tmp11_; |
| 3271 | BalaReport* _tmp12_; |
| 3272 | BalaSourceFileType _tmp13_; |
| 3273 | BalaSourceFileType _tmp14_; |
| 3274 | BalaList* comments = NULL((void*)0); |
| 3275 | BalaList* _tmp40_; |
| 3276 | BalaList* _tmp41_; |
| 3277 | BalaList* _tmp42_; |
| 3278 | BalaCCodeFile* _tmp58_; |
| 3279 | gchar* _tmp59_; |
| 3280 | gchar* _tmp60_; |
| 3281 | const gchar* _tmp61_; |
| 3282 | const gchar* _tmp62_; |
| 3283 | BalaCodeContext* _tmp63_; |
| 3284 | gboolean _tmp64_; |
| 3285 | gboolean _tmp65_; |
| 3286 | BalaCodeContext* _tmp66_; |
| 3287 | gboolean _tmp67_; |
| 3288 | gboolean _tmp68_; |
| 3289 | gboolean _tmp69_; |
| 3290 | self = (BalaCCodeBaseModule*) base; |
| 3291 | g_return_if_fail (source_file != NULL)do { if ((source_file != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "source_file != NULL" ); return; } } while (0); |
| 3292 | _tmp0_ = bala_ccode_file_new (source_file); |
| 3293 | _bala_ccode_file_unref0 (self->cfile)((self->cfile == ((void*)0)) ? ((void*)0) : (self->cfile = (bala_ccode_file_unref (self->cfile), ((void*)0)))); |
| 3294 | self->cfile = _tmp0_; |
| 3295 | _tmp1_ = g_str_hash; |
| 3296 | _tmp2_ = g_str_equal; |
| 3297 | _tmp3_ = bala_hash_set_new (G_TYPE_STRING((GType) ((16) << (2))), (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp1_, _tmp2_); |
| 3298 | _bala_iterable_unref0 (self->user_marshal_set)((self->user_marshal_set == ((void*)0)) ? ((void*)0) : (self ->user_marshal_set = (bala_iterable_unref (self->user_marshal_set ), ((void*)0)))); |
| 3299 | self->user_marshal_set = (BalaSet*) _tmp3_; |
| 3300 | self->next_regex_id = 0; |
| 3301 | self->requires_assert = FALSE(0); |
| 3302 | self->requires_array_free = FALSE(0); |
| 3303 | self->requires_array_move = FALSE(0); |
| 3304 | self->requires_array_length = FALSE(0); |
| 3305 | self->requires_array_n_elements = FALSE(0); |
| 3306 | self->requires_clear_mutex = FALSE(0); |
| 3307 | _tmp4_ = g_str_hash; |
| 3308 | _tmp5_ = g_str_equal; |
| 3309 | _tmp6_ = bala_hash_set_new (G_TYPE_STRING((GType) ((16) << (2))), (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp4_, _tmp5_); |
| 3310 | _bala_iterable_unref0 (self->wrappers)((self->wrappers == ((void*)0)) ? ((void*)0) : (self->wrappers = (bala_iterable_unref (self->wrappers), ((void*)0)))); |
| 3311 | self->wrappers = (BalaSet*) _tmp6_; |
| 3312 | _tmp7_ = g_direct_hash; |
| 3313 | _tmp8_ = g_direct_equal; |
| 3314 | _tmp9_ = bala_hash_set_new (BALA_TYPE_SYMBOL(bala_symbol_get_type ()), (GBoxedCopyFunc) bala_code_node_ref, (GDestroyNotify) bala_code_node_unref, _tmp7_, _tmp8_); |
| 3315 | _bala_iterable_unref0 (self->priv->generated_external_symbols)((self->priv->generated_external_symbols == ((void*)0)) ? ((void*)0) : (self->priv->generated_external_symbols = (bala_iterable_unref (self->priv->generated_external_symbols ), ((void*)0)))); |
| 3316 | self->priv->generated_external_symbols = (BalaSet*) _tmp9_; |
| 3317 | bala_source_file_accept_children (source_file, (BalaCodeVisitor*) self); |
| 3318 | _tmp10_ = self->priv->_context; |
| 3319 | _tmp11_ = bala_code_context_get_report (_tmp10_); |
| 3320 | _tmp12_ = _tmp11_; |
| 3321 | if (bala_report_get_errors (_tmp12_) > 0) { |
| 3322 | return; |
| 3323 | } |
| 3324 | _tmp13_ = bala_source_file_get_file_type (source_file); |
| 3325 | _tmp14_ = _tmp13_; |
| 3326 | if (_tmp14_ == BALA_SOURCE_FILE_TYPE_FAST) { |
| 3327 | return; |
| 3328 | } |
| 3329 | if (self->requires_assert) { |
| 3330 | BalaCCodeFile* _tmp15_; |
| 3331 | BalaCCodeConstant* _tmp16_; |
| 3332 | BalaCCodeConstant* _tmp17_; |
| 3333 | BalaCCodeMacroReplacement* _tmp18_; |
| 3334 | BalaCCodeMacroReplacement* _tmp19_; |
| 3335 | BalaCCodeFile* _tmp20_; |
| 3336 | BalaCCodeConstant* _tmp21_; |
| 3337 | BalaCCodeConstant* _tmp22_; |
| 3338 | BalaCCodeMacroReplacement* _tmp23_; |
| 3339 | BalaCCodeMacroReplacement* _tmp24_; |
| 3340 | BalaCCodeFile* _tmp25_; |
| 3341 | BalaCCodeConstant* _tmp26_; |
| 3342 | BalaCCodeConstant* _tmp27_; |
| 3343 | BalaCCodeMacroReplacement* _tmp28_; |
| 3344 | BalaCCodeMacroReplacement* _tmp29_; |
| 3345 | BalaCCodeFile* _tmp30_; |
| 3346 | BalaCCodeConstant* _tmp31_; |
| 3347 | BalaCCodeConstant* _tmp32_; |
| 3348 | BalaCCodeMacroReplacement* _tmp33_; |
| 3349 | BalaCCodeMacroReplacement* _tmp34_; |
| 3350 | _tmp15_ = self->cfile; |
| 3351 | _tmp16_ = bala_ccode_constant_new ("if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FI" \ |
| 3352 | "LE__, __LINE__, G_STRFUNC, msg);"); |
| 3353 | _tmp17_ = _tmp16_; |
| 3354 | _tmp18_ = bala_ccode_macro_replacement_new_with_expression ("_bala_assert(expr, msg)", (BalaCCodeExpression*) _tmp17_); |
| 3355 | _tmp19_ = _tmp18_; |
| 3356 | bala_ccode_file_add_type_declaration (_tmp15_, (BalaCCodeNode*) _tmp19_); |
| 3357 | _bala_ccode_node_unref0 (_tmp19_)((_tmp19_ == ((void*)0)) ? ((void*)0) : (_tmp19_ = (bala_ccode_node_unref (_tmp19_), ((void*)0)))); |
| 3358 | _bala_ccode_node_unref0 (_tmp17_)((_tmp17_ == ((void*)0)) ? ((void*)0) : (_tmp17_ = (bala_ccode_node_unref (_tmp17_), ((void*)0)))); |
| 3359 | _tmp20_ = self->cfile; |
| 3360 | _tmp21_ = bala_ccode_constant_new ("if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_" \ |
| 3361 | "STRFUNC, msg); return; }"); |
| 3362 | _tmp22_ = _tmp21_; |
| 3363 | _tmp23_ = bala_ccode_macro_replacement_new_with_expression ("_bala_return_if_fail(expr, msg)", (BalaCCodeExpression*) _tmp22_); |
| 3364 | _tmp24_ = _tmp23_; |
| 3365 | bala_ccode_file_add_type_declaration (_tmp20_, (BalaCCodeNode*) _tmp24_); |
| 3366 | _bala_ccode_node_unref0 (_tmp24_)((_tmp24_ == ((void*)0)) ? ((void*)0) : (_tmp24_ = (bala_ccode_node_unref (_tmp24_), ((void*)0)))); |
| 3367 | _bala_ccode_node_unref0 (_tmp22_)((_tmp22_ == ((void*)0)) ? ((void*)0) : (_tmp22_ = (bala_ccode_node_unref (_tmp22_), ((void*)0)))); |
| 3368 | _tmp25_ = self->cfile; |
| 3369 | _tmp26_ = bala_ccode_constant_new ("if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_" \ |
| 3370 | "STRFUNC, msg); return val; }"); |
| 3371 | _tmp27_ = _tmp26_; |
| 3372 | _tmp28_ = bala_ccode_macro_replacement_new_with_expression ("_bala_return_val_if_fail(expr, msg, val)", (BalaCCodeExpression*) _tmp27_); |
| 3373 | _tmp29_ = _tmp28_; |
| 3374 | bala_ccode_file_add_type_declaration (_tmp25_, (BalaCCodeNode*) _tmp29_); |
| 3375 | _bala_ccode_node_unref0 (_tmp29_)((_tmp29_ == ((void*)0)) ? ((void*)0) : (_tmp29_ = (bala_ccode_node_unref (_tmp29_), ((void*)0)))); |
| 3376 | _bala_ccode_node_unref0 (_tmp27_)((_tmp27_ == ((void*)0)) ? ((void*)0) : (_tmp27_ = (bala_ccode_node_unref (_tmp27_), ((void*)0)))); |
| 3377 | _tmp30_ = self->cfile; |
| 3378 | _tmp31_ = bala_ccode_constant_new ("if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LI" \ |
| 3379 | "NE__, G_STRFUNC, msg);"); |
| 3380 | _tmp32_ = _tmp31_; |
| 3381 | _tmp33_ = bala_ccode_macro_replacement_new_with_expression ("_bala_warn_if_fail(expr, msg)", (BalaCCodeExpression*) _tmp32_); |
| 3382 | _tmp34_ = _tmp33_; |
| 3383 | bala_ccode_file_add_type_declaration (_tmp30_, (BalaCCodeNode*) _tmp34_); |
| 3384 | _bala_ccode_node_unref0 (_tmp34_)((_tmp34_ == ((void*)0)) ? ((void*)0) : (_tmp34_ = (bala_ccode_node_unref (_tmp34_), ((void*)0)))); |
| 3385 | _bala_ccode_node_unref0 (_tmp32_)((_tmp32_ == ((void*)0)) ? ((void*)0) : (_tmp32_ = (bala_ccode_node_unref (_tmp32_), ((void*)0)))); |
| 3386 | } |
| 3387 | if (self->requires_array_free) { |
| 3388 | bala_ccode_base_module_append_bala_array_free (self); |
| 3389 | } |
| 3390 | if (self->requires_array_move) { |
| 3391 | bala_ccode_base_module_append_bala_array_move (self); |
| 3392 | } |
| 3393 | if (self->requires_array_length) { |
| 3394 | bala_ccode_base_module_append_bala_array_length (self); |
| 3395 | } |
| 3396 | if (self->requires_array_n_elements) { |
| 3397 | BalaCCodeFile* _tmp35_; |
| 3398 | BalaCCodeConstant* _tmp36_; |
| 3399 | BalaCCodeConstant* _tmp37_; |
| 3400 | BalaCCodeMacroReplacement* _tmp38_; |
| 3401 | BalaCCodeMacroReplacement* _tmp39_; |
| 3402 | _tmp35_ = self->cfile; |
| 3403 | _tmp36_ = bala_ccode_constant_new ("(sizeof (arr) / sizeof ((arr)[0]))"); |
| 3404 | _tmp37_ = _tmp36_; |
| 3405 | _tmp38_ = bala_ccode_macro_replacement_new_with_expression ("BALA_N_ELEMENTS(arr)", (BalaCCodeExpression*) _tmp37_); |
| 3406 | _tmp39_ = _tmp38_; |
| 3407 | bala_ccode_file_add_type_declaration (_tmp35_, (BalaCCodeNode*) _tmp39_); |
| 3408 | _bala_ccode_node_unref0 (_tmp39_)((_tmp39_ == ((void*)0)) ? ((void*)0) : (_tmp39_ = (bala_ccode_node_unref (_tmp39_), ((void*)0)))); |
| 3409 | _bala_ccode_node_unref0 (_tmp37_)((_tmp37_ == ((void*)0)) ? ((void*)0) : (_tmp37_ = (bala_ccode_node_unref (_tmp37_), ((void*)0)))); |
| 3410 | } |
| 3411 | if (self->requires_clear_mutex) { |
| 3412 | bala_ccode_base_module_append_bala_clear_mutex (self, "GMutex", "g_mutex"); |
| 3413 | bala_ccode_base_module_append_bala_clear_mutex (self, "GRecMutex", "g_rec_mutex"); |
| 3414 | bala_ccode_base_module_append_bala_clear_mutex (self, "GRWLock", "g_rw_lock"); |
| 3415 | bala_ccode_base_module_append_bala_clear_mutex (self, "GCond", "g_cond"); |
| 3416 | } |
| 3417 | _tmp40_ = bala_source_file_get_comments (source_file); |
| 3418 | _tmp41_ = _bala_iterable_ref0 (_tmp40_); |
| 3419 | comments = _tmp41_; |
| 3420 | _tmp42_ = comments; |
| 3421 | if (_tmp42_ != NULL((void*)0)) { |
| 3422 | { |
| 3423 | BalaList* _comment_list = NULL((void*)0); |
| 3424 | BalaList* _tmp43_; |
| 3425 | BalaList* _tmp44_; |
| 3426 | gint _comment_size = 0; |
| 3427 | BalaList* _tmp45_; |
| 3428 | gint _tmp46_; |
| 3429 | gint _tmp47_; |
| 3430 | gint _comment_index = 0; |
| 3431 | _tmp43_ = comments; |
| 3432 | _tmp44_ = _bala_iterable_ref0 (_tmp43_); |
| 3433 | _comment_list = _tmp44_; |
| 3434 | _tmp45_ = _comment_list; |
| 3435 | _tmp46_ = bala_collection_get_size ((BalaCollection*) _tmp45_); |
| 3436 | _tmp47_ = _tmp46_; |
| 3437 | _comment_size = _tmp47_; |
| 3438 | _comment_index = -1; |
| 3439 | while (TRUE(!(0))) { |
| 3440 | gint _tmp48_; |
| 3441 | gint _tmp49_; |
| 3442 | BalaComment* comment = NULL((void*)0); |
| 3443 | BalaList* _tmp50_; |
| 3444 | gpointer _tmp51_; |
| 3445 | BalaCCodeComment* ccomment = NULL((void*)0); |
| 3446 | BalaComment* _tmp52_; |
| 3447 | const gchar* _tmp53_; |
| 3448 | const gchar* _tmp54_; |
| 3449 | BalaCCodeComment* _tmp55_; |
| 3450 | BalaCCodeFile* _tmp56_; |
| 3451 | BalaCCodeComment* _tmp57_; |
| 3452 | _comment_index = _comment_index + 1; |
| 3453 | _tmp48_ = _comment_index; |
| 3454 | _tmp49_ = _comment_size; |
| 3455 | if (!(_tmp48_ < _tmp49_)) { |
| 3456 | break; |
| 3457 | } |
| 3458 | _tmp50_ = _comment_list; |
| 3459 | _tmp51_ = bala_list_get (_tmp50_, _comment_index); |
| 3460 | comment = (BalaComment*) _tmp51_; |
| 3461 | _tmp52_ = comment; |
| 3462 | _tmp53_ = bala_comment_get_content (_tmp52_); |
| 3463 | _tmp54_ = _tmp53_; |
| 3464 | _tmp55_ = bala_ccode_comment_new (_tmp54_); |
| 3465 | ccomment = _tmp55_; |
| 3466 | _tmp56_ = self->cfile; |
| 3467 | _tmp57_ = ccomment; |
| 3468 | bala_ccode_file_add_comment (_tmp56_, _tmp57_); |
| 3469 | _bala_ccode_node_unref0 (ccomment)((ccomment == ((void*)0)) ? ((void*)0) : (ccomment = (bala_ccode_node_unref (ccomment), ((void*)0)))); |
| 3470 | _bala_comment_unref0 (comment)((comment == ((void*)0)) ? ((void*)0) : (comment = (bala_comment_unref (comment), ((void*)0)))); |
| 3471 | } |
| 3472 | _bala_iterable_unref0 (_comment_list)((_comment_list == ((void*)0)) ? ((void*)0) : (_comment_list = (bala_iterable_unref (_comment_list), ((void*)0)))); |
| 3473 | } |
| 3474 | } |
| 3475 | _tmp58_ = self->cfile; |
| 3476 | _tmp59_ = bala_source_file_get_csource_filename (source_file); |
| 3477 | _tmp60_ = _tmp59_; |
| 3478 | _tmp61_ = bala_source_file_get_filename (source_file); |
| 3479 | _tmp62_ = _tmp61_; |
| 3480 | _tmp63_ = self->priv->_context; |
| 3481 | _tmp64_ = bala_code_context_get_version_header (_tmp63_); |
| 3482 | _tmp65_ = _tmp64_; |
| 3483 | _tmp66_ = self->priv->_context; |
| 3484 | _tmp67_ = bala_code_context_get_debug (_tmp66_); |
| 3485 | _tmp68_ = _tmp67_; |
| 3486 | _tmp69_ = !bala_ccode_file_store (_tmp58_, _tmp60_, _tmp62_, _tmp65_, _tmp68_, NULL((void*)0), NULL((void*)0)); |
| 3487 | _g_free0 (_tmp60_)(_tmp60_ = (g_free (_tmp60_), ((void*)0))); |
| 3488 | if (_tmp69_) { |
| 3489 | gchar* _tmp70_; |
| 3490 | gchar* _tmp71_; |
| 3491 | gchar* _tmp72_; |
| 3492 | gchar* _tmp73_; |
| 3493 | _tmp70_ = bala_source_file_get_csource_filename (source_file); |
| 3494 | _tmp71_ = _tmp70_; |
| 3495 | _tmp72_ = g_strdup_printf ("unable to open `%s' for writing", _tmp71_); |
| 3496 | _tmp73_ = _tmp72_; |
| 3497 | bala_report_error (NULL((void*)0), _tmp73_); |
| 3498 | _g_free0 (_tmp73_)(_tmp73_ = (g_free (_tmp73_), ((void*)0))); |
| 3499 | _g_free0 (_tmp71_)(_tmp71_ = (g_free (_tmp71_), ((void*)0))); |
| 3500 | } |
| 3501 | _bala_ccode_file_unref0 (self->cfile)((self->cfile == ((void*)0)) ? ((void*)0) : (self->cfile = (bala_ccode_file_unref (self->cfile), ((void*)0)))); |
| 3502 | self->cfile = NULL((void*)0); |
| 3503 | _bala_iterable_unref0 (comments)((comments == ((void*)0)) ? ((void*)0) : (comments = (bala_iterable_unref (comments), ((void*)0)))); |
| 3504 | } |
| 3505 | |
| 3506 | static gpointer |
| 3507 | _bala_ccode_file_ref0 (gpointer self) |
| 3508 | { |
| 3509 | return self ? bala_ccode_file_ref (self) : NULL((void*)0); |
| 3510 | } |
| 3511 | |
| 3512 | static gboolean |
| 3513 | bala_ccode_base_module_real_generate_enum_declaration (BalaCCodeBaseModule* self, |
| 3514 | BalaEnum* en, |
| 3515 | BalaCCodeFile* decl_space) |
| 3516 | { |
| 3517 | gchar* _tmp0_; |
| 3518 | gchar* _tmp1_; |
| 3519 | gboolean _tmp2_; |
| 3520 | BalaCCodeEnum* cenum = NULL((void*)0); |
| 3521 | gchar* _tmp3_; |
| 3522 | gchar* _tmp4_; |
| 3523 | BalaCCodeEnum* _tmp5_; |
| 3524 | BalaCCodeEnum* _tmp6_; |
| 3525 | BalaVersionAttribute* _tmp7_; |
| 3526 | BalaVersionAttribute* _tmp8_; |
| 3527 | gboolean _tmp9_; |
| 3528 | gboolean _tmp10_; |
| 3529 | BalaCCodeFile* current_cfile = NULL((void*)0); |
| 3530 | BalaCCodeFile* _tmp18_; |
| 3531 | BalaCCodeFile* _tmp19_; |
| 3532 | BalaCCodeFile* _tmp20_; |
| 3533 | gint flag_shift = 0; |
| 3534 | BalaCCodeFile* _tmp67_; |
| 3535 | BalaCCodeFile* _tmp68_; |
| 3536 | BalaCCodeEnum* _tmp69_; |
| 3537 | BalaCCodeNewline* _tmp70_; |
| 3538 | BalaCCodeNewline* _tmp71_; |
| 3539 | gboolean _tmp72_ = FALSE(0); |
| 3540 | BalaCodeContext* _tmp73_; |
| 3541 | BalaProfile _tmp74_; |
| 3542 | BalaProfile _tmp75_; |
| 3543 | BalaCCodeNewline* _tmp76_; |
| 3544 | BalaCCodeNewline* _tmp77_; |
| 3545 | gchar* fun_name = NULL((void*)0); |
| 3546 | gchar* _tmp78_; |
| 3547 | gchar* macro = NULL((void*)0); |
| 3548 | const gchar* _tmp79_; |
| 3549 | gchar* _tmp80_; |
| 3550 | gchar* _tmp81_; |
| 3551 | gchar* _tmp82_; |
| 3552 | const gchar* _tmp83_; |
| 3553 | BalaCCodeMacroReplacement* _tmp84_; |
| 3554 | BalaCCodeMacroReplacement* _tmp85_; |
| 3555 | BalaCCodeFunction* regfun = NULL((void*)0); |
| 3556 | const gchar* _tmp86_; |
| 3557 | BalaCCodeFunction* _tmp87_; |
| 3558 | BalaCCodeFunction* _tmp88_; |
| 3559 | BalaCCodeFunction* _tmp101_; |
| 3560 | gboolean result = FALSE(0); |
| 3561 | g_return_val_if_fail (en != NULL, FALSE)do { if ((en != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "en != NULL"); return ((0)); } } while (0); |
| 3562 | g_return_val_if_fail (decl_space != NULL, FALSE)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return ((0)); } } while (0); |
| 3563 | _tmp0_ = bala_get_ccode_name ((BalaCodeNode*) en); |
| 3564 | _tmp1_ = _tmp0_; |
| 3565 | _tmp2_ = bala_ccode_base_module_add_symbol_declaration (self, decl_space, (BalaSymbol*) en, _tmp1_); |
| 3566 | _g_free0 (_tmp1_)(_tmp1_ = (g_free (_tmp1_), ((void*)0))); |
| 3567 | if (_tmp2_) { |
| 3568 | result = FALSE(0); |
| 3569 | return result; |
| 3570 | } |
| 3571 | _tmp3_ = bala_get_ccode_name ((BalaCodeNode*) en); |
| 3572 | _tmp4_ = _tmp3_; |
| 3573 | _tmp5_ = bala_ccode_enum_new (_tmp4_); |
| 3574 | _tmp6_ = _tmp5_; |
| 3575 | _g_free0 (_tmp4_)(_tmp4_ = (g_free (_tmp4_), ((void*)0))); |
| 3576 | cenum = _tmp6_; |
| 3577 | _tmp7_ = bala_symbol_get_version ((BalaSymbol*) en); |
| 3578 | _tmp8_ = _tmp7_; |
| 3579 | _tmp9_ = bala_version_attribute_get_deprecated (_tmp8_); |
| 3580 | _tmp10_ = _tmp9_; |
| 3581 | if (_tmp10_) { |
| 3582 | BalaCodeContext* _tmp11_; |
| 3583 | BalaProfile _tmp12_; |
| 3584 | BalaProfile _tmp13_; |
| 3585 | BalaCCodeEnum* _tmp14_; |
| 3586 | BalaCCodeEnum* _tmp15_; |
| 3587 | BalaCCodeModifiers _tmp16_; |
| 3588 | BalaCCodeModifiers _tmp17_; |
| 3589 | _tmp11_ = self->priv->_context; |
| 3590 | _tmp12_ = bala_code_context_get_profile (_tmp11_); |
| 3591 | _tmp13_ = _tmp12_; |
| 3592 | if (_tmp13_ == BALA_PROFILE_GOBJECT) { |
| 3593 | bala_ccode_file_add_include (decl_space, "glib.h", FALSE(0)); |
| 3594 | } |
| 3595 | _tmp14_ = cenum; |
| 3596 | _tmp15_ = cenum; |
| 3597 | _tmp16_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp15_); |
| 3598 | _tmp17_ = _tmp16_; |
| 3599 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp15_, _tmp17_ | BALA_CCODE_MODIFIERS_DEPRECATED); |
| 3600 | } |
| 3601 | _tmp18_ = self->cfile; |
| 3602 | _tmp19_ = _bala_ccode_file_ref0 (_tmp18_); |
| 3603 | current_cfile = _tmp19_; |
| 3604 | _tmp20_ = _bala_ccode_file_ref0 (decl_space); |
| 3605 | _bala_ccode_file_unref0 (self->cfile)((self->cfile == ((void*)0)) ? ((void*)0) : (self->cfile = (bala_ccode_file_unref (self->cfile), ((void*)0)))); |
| 3606 | self->cfile = _tmp20_; |
| 3607 | flag_shift = 0; |
| 3608 | { |
| 3609 | BalaList* _ev_list = NULL((void*)0); |
| 3610 | BalaList* _tmp21_; |
| 3611 | BalaList* _tmp22_; |
| 3612 | gint _ev_size = 0; |
| 3613 | BalaList* _tmp23_; |
| 3614 | gint _tmp24_; |
| 3615 | gint _tmp25_; |
| 3616 | gint _ev_index = 0; |
| 3617 | _tmp21_ = bala_enum_get_values (en); |
| 3618 | _tmp22_ = _bala_iterable_ref0 (_tmp21_); |
| 3619 | _ev_list = _tmp22_; |
| 3620 | _tmp23_ = _ev_list; |
| 3621 | _tmp24_ = bala_collection_get_size ((BalaCollection*) _tmp23_); |
| 3622 | _tmp25_ = _tmp24_; |
| 3623 | _ev_size = _tmp25_; |
| 3624 | _ev_index = -1; |
| 3625 | while (TRUE(!(0))) { |
| 3626 | gint _tmp26_; |
| 3627 | gint _tmp27_; |
| 3628 | BalaEnumValue* ev = NULL((void*)0); |
| 3629 | BalaList* _tmp28_; |
| 3630 | gpointer _tmp29_; |
| 3631 | BalaCCodeEnumValue* c_ev = NULL((void*)0); |
| 3632 | BalaEnumValue* _tmp30_; |
| 3633 | BalaExpression* _tmp31_; |
| 3634 | BalaExpression* _tmp32_; |
| 3635 | BalaCCodeModifiers _tmp55_ = 0U; |
| 3636 | BalaEnumValue* _tmp56_; |
| 3637 | BalaVersionAttribute* _tmp57_; |
| 3638 | BalaVersionAttribute* _tmp58_; |
| 3639 | gboolean _tmp59_; |
| 3640 | gboolean _tmp60_; |
| 3641 | BalaCCodeEnumValue* _tmp61_; |
| 3642 | BalaCCodeEnumValue* _tmp62_; |
| 3643 | BalaCCodeModifiers _tmp63_; |
| 3644 | BalaCCodeModifiers _tmp64_; |
| 3645 | BalaCCodeEnum* _tmp65_; |
| 3646 | BalaCCodeEnumValue* _tmp66_; |
| 3647 | _ev_index = _ev_index + 1; |
| 3648 | _tmp26_ = _ev_index; |
| 3649 | _tmp27_ = _ev_size; |
| 3650 | if (!(_tmp26_ < _tmp27_)) { |
| 3651 | break; |
| 3652 | } |
| 3653 | _tmp28_ = _ev_list; |
| 3654 | _tmp29_ = bala_list_get (_tmp28_, _ev_index); |
| 3655 | ev = (BalaEnumValue*) _tmp29_; |
| 3656 | _tmp30_ = ev; |
| 3657 | _tmp31_ = bala_constant_get_value ((BalaConstant*) _tmp30_); |
| 3658 | _tmp32_ = _tmp31_; |
| 3659 | if (_tmp32_ == NULL((void*)0)) { |
| 3660 | BalaEnumValue* _tmp33_; |
| 3661 | gchar* _tmp34_; |
| 3662 | gchar* _tmp35_; |
| 3663 | BalaCCodeEnumValue* _tmp36_; |
| 3664 | gboolean _tmp37_; |
| 3665 | gboolean _tmp38_; |
| 3666 | _tmp33_ = ev; |
| 3667 | _tmp34_ = bala_get_ccode_name ((BalaCodeNode*) _tmp33_); |
| 3668 | _tmp35_ = _tmp34_; |
| 3669 | _tmp36_ = bala_ccode_enum_value_new (_tmp35_, NULL((void*)0)); |
| 3670 | _bala_ccode_node_unref0 (c_ev)((c_ev == ((void*)0)) ? ((void*)0) : (c_ev = (bala_ccode_node_unref (c_ev), ((void*)0)))); |
| 3671 | c_ev = _tmp36_; |
| 3672 | _g_free0 (_tmp35_)(_tmp35_ = (g_free (_tmp35_), ((void*)0))); |
| 3673 | _tmp37_ = bala_enum_get_is_flags (en); |
| 3674 | _tmp38_ = _tmp37_; |
| 3675 | if (_tmp38_) { |
| 3676 | BalaCCodeEnumValue* _tmp39_; |
| 3677 | gchar* _tmp40_; |
| 3678 | gchar* _tmp41_; |
| 3679 | BalaCCodeConstant* _tmp42_; |
| 3680 | BalaCCodeConstant* _tmp43_; |
| 3681 | _tmp39_ = c_ev; |
| 3682 | _tmp40_ = g_strdup_printf ("1 << %d", flag_shift); |
| 3683 | _tmp41_ = _tmp40_; |
| 3684 | _tmp42_ = bala_ccode_constant_new (_tmp41_); |
| 3685 | _tmp43_ = _tmp42_; |
| 3686 | bala_ccode_enum_value_set_value (_tmp39_, (BalaCCodeExpression*) _tmp43_); |
| 3687 | _bala_ccode_node_unref0 (_tmp43_)((_tmp43_ == ((void*)0)) ? ((void*)0) : (_tmp43_ = (bala_ccode_node_unref (_tmp43_), ((void*)0)))); |
| 3688 | _g_free0 (_tmp41_)(_tmp41_ = (g_free (_tmp41_), ((void*)0))); |
| 3689 | flag_shift += 1; |
| 3690 | } |
| 3691 | } else { |
| 3692 | BalaEnumValue* _tmp44_; |
| 3693 | BalaExpression* _tmp45_; |
| 3694 | BalaExpression* _tmp46_; |
| 3695 | BalaEnumValue* _tmp47_; |
| 3696 | gchar* _tmp48_; |
| 3697 | gchar* _tmp49_; |
| 3698 | BalaEnumValue* _tmp50_; |
| 3699 | BalaExpression* _tmp51_; |
| 3700 | BalaExpression* _tmp52_; |
| 3701 | BalaCCodeExpression* _tmp53_; |
| 3702 | BalaCCodeEnumValue* _tmp54_; |
| 3703 | _tmp44_ = ev; |
| 3704 | _tmp45_ = bala_constant_get_value ((BalaConstant*) _tmp44_); |
| 3705 | _tmp46_ = _tmp45_; |
| 3706 | bala_code_node_emit ((BalaCodeNode*) _tmp46_, (BalaCodeGenerator*) self); |
| 3707 | _tmp47_ = ev; |
| 3708 | _tmp48_ = bala_get_ccode_name ((BalaCodeNode*) _tmp47_); |
| 3709 | _tmp49_ = _tmp48_; |
| 3710 | _tmp50_ = ev; |
| 3711 | _tmp51_ = bala_constant_get_value ((BalaConstant*) _tmp50_); |
| 3712 | _tmp52_ = _tmp51_; |
| 3713 | _tmp53_ = bala_get_cvalue (_tmp52_); |
| 3714 | _tmp54_ = bala_ccode_enum_value_new (_tmp49_, _tmp53_); |
| 3715 | _bala_ccode_node_unref0 (c_ev)((c_ev == ((void*)0)) ? ((void*)0) : (c_ev = (bala_ccode_node_unref (c_ev), ((void*)0)))); |
| 3716 | c_ev = _tmp54_; |
| 3717 | _g_free0 (_tmp49_)(_tmp49_ = (g_free (_tmp49_), ((void*)0))); |
| 3718 | } |
| 3719 | _tmp56_ = ev; |
| 3720 | _tmp57_ = bala_symbol_get_version ((BalaSymbol*) _tmp56_); |
| 3721 | _tmp58_ = _tmp57_; |
| 3722 | _tmp59_ = bala_version_attribute_get_deprecated (_tmp58_); |
| 3723 | _tmp60_ = _tmp59_; |
| 3724 | if (_tmp60_) { |
| 3725 | _tmp55_ = BALA_CCODE_MODIFIERS_DEPRECATED; |
| 3726 | } else { |
| 3727 | _tmp55_ = 0; |
| 3728 | } |
| 3729 | _tmp61_ = c_ev; |
| 3730 | _tmp62_ = c_ev; |
| 3731 | _tmp63_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp62_); |
| 3732 | _tmp64_ = _tmp63_; |
| 3733 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp62_, _tmp64_ | _tmp55_); |
| 3734 | _tmp65_ = cenum; |
| 3735 | _tmp66_ = c_ev; |
| 3736 | bala_ccode_enum_add_value (_tmp65_, _tmp66_); |
| 3737 | _bala_ccode_node_unref0 (c_ev)((c_ev == ((void*)0)) ? ((void*)0) : (c_ev = (bala_ccode_node_unref (c_ev), ((void*)0)))); |
| 3738 | _bala_code_node_unref0 (ev)((ev == ((void*)0)) ? ((void*)0) : (ev = (bala_code_node_unref (ev), ((void*)0)))); |
| 3739 | } |
| 3740 | _bala_iterable_unref0 (_ev_list)((_ev_list == ((void*)0)) ? ((void*)0) : (_ev_list = (bala_iterable_unref (_ev_list), ((void*)0)))); |
| 3741 | } |
| 3742 | _tmp67_ = current_cfile; |
| 3743 | _tmp68_ = _bala_ccode_file_ref0 (_tmp67_); |
| 3744 | _bala_ccode_file_unref0 (self->cfile)((self->cfile == ((void*)0)) ? ((void*)0) : (self->cfile = (bala_ccode_file_unref (self->cfile), ((void*)0)))); |
| 3745 | self->cfile = _tmp68_; |
| 3746 | _tmp69_ = cenum; |
| 3747 | bala_ccode_file_add_type_declaration (decl_space, (BalaCCodeNode*) _tmp69_); |
| 3748 | _tmp70_ = bala_ccode_newline_new (); |
| 3749 | _tmp71_ = _tmp70_; |
| 3750 | bala_ccode_file_add_type_declaration (decl_space, (BalaCCodeNode*) _tmp71_); |
| 3751 | _bala_ccode_node_unref0 (_tmp71_)((_tmp71_ == ((void*)0)) ? ((void*)0) : (_tmp71_ = (bala_ccode_node_unref (_tmp71_), ((void*)0)))); |
| 3752 | _tmp73_ = self->priv->_context; |
| 3753 | _tmp74_ = bala_code_context_get_profile (_tmp73_); |
| 3754 | _tmp75_ = _tmp74_; |
| 3755 | if (_tmp75_ != BALA_PROFILE_GOBJECT) { |
| 3756 | _tmp72_ = TRUE(!(0)); |
| 3757 | } else { |
| 3758 | _tmp72_ = !bala_get_ccode_has_type_id ((BalaTypeSymbol*) en); |
| 3759 | } |
| 3760 | if (_tmp72_) { |
| 3761 | result = TRUE(!(0)); |
| 3762 | _bala_ccode_file_unref0 (current_cfile)((current_cfile == ((void*)0)) ? ((void*)0) : (current_cfile = (bala_ccode_file_unref (current_cfile), ((void*)0)))); |
| 3763 | _bala_ccode_node_unref0 (cenum)((cenum == ((void*)0)) ? ((void*)0) : (cenum = (bala_ccode_node_unref (cenum), ((void*)0)))); |
| 3764 | return result; |
| 3765 | } |
| 3766 | bala_ccode_file_add_include (decl_space, "glib-object.h", FALSE(0)); |
| 3767 | _tmp76_ = bala_ccode_newline_new (); |
| 3768 | _tmp77_ = _tmp76_; |
| 3769 | bala_ccode_file_add_type_declaration (decl_space, (BalaCCodeNode*) _tmp77_); |
| 3770 | _bala_ccode_node_unref0 (_tmp77_)((_tmp77_ == ((void*)0)) ? ((void*)0) : (_tmp77_ = (bala_ccode_node_unref (_tmp77_), ((void*)0)))); |
| 3771 | _tmp78_ = bala_get_ccode_type_function ((BalaTypeSymbol*) en); |
| 3772 | fun_name = _tmp78_; |
| 3773 | _tmp79_ = fun_name; |
| 3774 | _tmp80_ = g_strdup_printf ("(%s ())", _tmp79_); |
| 3775 | macro = _tmp80_; |
| 3776 | _tmp81_ = bala_get_ccode_type_id ((BalaCodeNode*) en); |
| 3777 | _tmp82_ = _tmp81_; |
| 3778 | _tmp83_ = macro; |
| 3779 | _tmp84_ = bala_ccode_macro_replacement_new (_tmp82_, _tmp83_); |
| 3780 | _tmp85_ = _tmp84_; |
| 3781 | bala_ccode_file_add_type_declaration (decl_space, (BalaCCodeNode*) _tmp85_); |
| 3782 | _bala_ccode_node_unref0 (_tmp85_)((_tmp85_ == ((void*)0)) ? ((void*)0) : (_tmp85_ = (bala_ccode_node_unref (_tmp85_), ((void*)0)))); |
| 3783 | _g_free0 (_tmp82_)(_tmp82_ = (g_free (_tmp82_), ((void*)0))); |
| 3784 | _tmp86_ = fun_name; |
| 3785 | _tmp87_ = bala_ccode_function_new (_tmp86_, "GType"); |
| 3786 | regfun = _tmp87_; |
| 3787 | _tmp88_ = regfun; |
| 3788 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp88_, BALA_CCODE_MODIFIERS_CONST); |
| 3789 | if (bala_symbol_is_private_symbol ((BalaSymbol*) en)) { |
| 3790 | BalaCCodeFunction* _tmp89_; |
| 3791 | BalaCCodeFunction* _tmp90_; |
| 3792 | BalaCCodeModifiers _tmp91_; |
| 3793 | BalaCCodeModifiers _tmp92_; |
| 3794 | _tmp89_ = regfun; |
| 3795 | _tmp90_ = regfun; |
| 3796 | _tmp91_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp90_); |
| 3797 | _tmp92_ = _tmp91_; |
| 3798 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp90_, _tmp92_ | (BALA_CCODE_MODIFIERS_STATIC | BALA_CCODE_MODIFIERS_UNUSED)); |
| 3799 | } else { |
| 3800 | gboolean _tmp93_ = FALSE(0); |
| 3801 | BalaCodeContext* _tmp94_; |
| 3802 | gboolean _tmp95_; |
| 3803 | gboolean _tmp96_; |
| 3804 | _tmp94_ = self->priv->_context; |
| 3805 | _tmp95_ = bala_code_context_get_hide_internal (_tmp94_); |
| 3806 | _tmp96_ = _tmp95_; |
| 3807 | if (_tmp96_) { |
| 3808 | _tmp93_ = bala_symbol_is_internal_symbol ((BalaSymbol*) en); |
| 3809 | } else { |
| 3810 | _tmp93_ = FALSE(0); |
| 3811 | } |
| 3812 | if (_tmp93_) { |
| 3813 | BalaCCodeFunction* _tmp97_; |
| 3814 | BalaCCodeFunction* _tmp98_; |
| 3815 | BalaCCodeModifiers _tmp99_; |
| 3816 | BalaCCodeModifiers _tmp100_; |
| 3817 | _tmp97_ = regfun; |
| 3818 | _tmp98_ = regfun; |
| 3819 | _tmp99_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp98_); |
| 3820 | _tmp100_ = _tmp99_; |
| 3821 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp98_, _tmp100_ | BALA_CCODE_MODIFIERS_INTERNAL); |
| 3822 | } |
| 3823 | } |
| 3824 | _tmp101_ = regfun; |
| 3825 | bala_ccode_file_add_function_declaration (decl_space, _tmp101_); |
| 3826 | result = TRUE(!(0)); |
| 3827 | _bala_ccode_node_unref0 (regfun)((regfun == ((void*)0)) ? ((void*)0) : (regfun = (bala_ccode_node_unref (regfun), ((void*)0)))); |
| 3828 | _g_free0 (macro)(macro = (g_free (macro), ((void*)0))); |
| 3829 | _g_free0 (fun_name)(fun_name = (g_free (fun_name), ((void*)0))); |
| 3830 | _bala_ccode_file_unref0 (current_cfile)((current_cfile == ((void*)0)) ? ((void*)0) : (current_cfile = (bala_ccode_file_unref (current_cfile), ((void*)0)))); |
| 3831 | _bala_ccode_node_unref0 (cenum)((cenum == ((void*)0)) ? ((void*)0) : (cenum = (bala_ccode_node_unref (cenum), ((void*)0)))); |
| 3832 | return result; |
| 3833 | } |
| 3834 | |
| 3835 | gboolean |
| 3836 | bala_ccode_base_module_generate_enum_declaration (BalaCCodeBaseModule* self, |
| 3837 | BalaEnum* en, |
| 3838 | BalaCCodeFile* decl_space) |
| 3839 | { |
| 3840 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 3841 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->generate_enum_declaration (self, en, decl_space); |
| 3842 | } |
| 3843 | |
| 3844 | static void |
| 3845 | bala_ccode_base_module_real_visit_enum (BalaCodeVisitor* base, |
| 3846 | BalaEnum* en) |
| 3847 | { |
| 3848 | BalaCCodeBaseModule * self; |
| 3849 | BalaSourceReference* _tmp0_; |
| 3850 | BalaSourceReference* _tmp1_; |
| 3851 | BalaComment* _tmp2_; |
| 3852 | BalaComment* _tmp3_; |
| 3853 | BalaCCodeFile* _tmp11_; |
| 3854 | self = (BalaCCodeBaseModule*) base; |
| 3855 | g_return_if_fail (en != NULL)do { if ((en != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "en != NULL"); return; } } while (0); |
| 3856 | _tmp0_ = bala_code_node_get_source_reference ((BalaCodeNode*) en); |
| 3857 | _tmp1_ = _tmp0_; |
| 3858 | bala_ccode_base_module_push_line (self, _tmp1_); |
| 3859 | _tmp2_ = bala_symbol_get_comment ((BalaSymbol*) en); |
| 3860 | _tmp3_ = _tmp2_; |
| 3861 | if (_tmp3_ != NULL((void*)0)) { |
| 3862 | BalaCCodeFile* _tmp4_; |
| 3863 | BalaComment* _tmp5_; |
| 3864 | BalaComment* _tmp6_; |
| 3865 | const gchar* _tmp7_; |
| 3866 | const gchar* _tmp8_; |
| 3867 | BalaCCodeComment* _tmp9_; |
| 3868 | BalaCCodeComment* _tmp10_; |
| 3869 | _tmp4_ = self->cfile; |
| 3870 | _tmp5_ = bala_symbol_get_comment ((BalaSymbol*) en); |
| 3871 | _tmp6_ = _tmp5_; |
| 3872 | _tmp7_ = bala_comment_get_content (_tmp6_); |
| 3873 | _tmp8_ = _tmp7_; |
| 3874 | _tmp9_ = bala_ccode_comment_new (_tmp8_); |
| 3875 | _tmp10_ = _tmp9_; |
| 3876 | bala_ccode_file_add_type_member_definition (_tmp4_, (BalaCCodeNode*) _tmp10_); |
| 3877 | _bala_ccode_node_unref0 (_tmp10_)((_tmp10_ == ((void*)0)) ? ((void*)0) : (_tmp10_ = (bala_ccode_node_unref (_tmp10_), ((void*)0)))); |
| 3878 | } |
| 3879 | _tmp11_ = self->cfile; |
| 3880 | bala_ccode_base_module_generate_enum_declaration (self, en, _tmp11_); |
| 3881 | if (!bala_symbol_is_internal_symbol ((BalaSymbol*) en)) { |
| 3882 | BalaCCodeFile* _tmp12_; |
| 3883 | _tmp12_ = self->header_file; |
| 3884 | bala_ccode_base_module_generate_enum_declaration (self, en, _tmp12_); |
| 3885 | } |
| 3886 | if (!bala_symbol_is_private_symbol ((BalaSymbol*) en)) { |
| 3887 | BalaCCodeFile* _tmp13_; |
| 3888 | _tmp13_ = self->internal_header_file; |
| 3889 | bala_ccode_base_module_generate_enum_declaration (self, en, _tmp13_); |
| 3890 | } |
| 3891 | bala_code_node_accept_children ((BalaCodeNode*) en, (BalaCodeVisitor*) self); |
| 3892 | bala_ccode_base_module_pop_line (self); |
| 3893 | } |
| 3894 | |
| 3895 | void |
| 3896 | bala_ccode_base_module_visit_member (BalaCCodeBaseModule* self, |
| 3897 | BalaSymbol* m) |
| 3898 | { |
| 3899 | gboolean _tmp0_ = FALSE(0); |
| 3900 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 3901 | g_return_if_fail (m != NULL)do { if ((m != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "m != NULL"); return ; } } while (0); |
| 3902 | if (G_TYPE_CHECK_INSTANCE_TYPE (m, BALA_TYPE_LOCKABLE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( m); GType __t = ((bala_lockable_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst ->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 3903 | gboolean _tmp1_; |
| 3904 | gboolean _tmp2_; |
| 3905 | _tmp1_ = bala_lockable_get_lock_used (G_TYPE_CHECK_INSTANCE_CAST (m, BALA_TYPE_LOCKABLE, BalaLockable)(((BalaLockable*) g_type_check_instance_cast ((GTypeInstance* ) (m), ((bala_lockable_get_type ())))))); |
| 3906 | _tmp2_ = _tmp1_; |
| 3907 | _tmp0_ = _tmp2_; |
| 3908 | } else { |
| 3909 | _tmp0_ = FALSE(0); |
| 3910 | } |
| 3911 | if (_tmp0_) { |
| 3912 | BalaCCodeExpression* l = NULL((void*)0); |
| 3913 | BalaCCodeIdentifier* _tmp3_; |
| 3914 | BalaCCodeBaseModuleEmitContext* init_context = NULL((void*)0); |
| 3915 | BalaCCodeBaseModuleEmitContext* _tmp4_; |
| 3916 | BalaCCodeBaseModuleEmitContext* _tmp5_; |
| 3917 | BalaCCodeBaseModuleEmitContext* finalize_context = NULL((void*)0); |
| 3918 | BalaCCodeBaseModuleEmitContext* _tmp6_; |
| 3919 | BalaCCodeBaseModuleEmitContext* _tmp7_; |
| 3920 | BalaCCodeBaseModuleEmitContext* _tmp48_; |
| 3921 | BalaCCodeFunctionCall* initf = NULL((void*)0); |
| 3922 | BalaStruct* _tmp49_; |
| 3923 | BalaCreationMethod* _tmp50_; |
| 3924 | BalaCreationMethod* _tmp51_; |
| 3925 | gchar* _tmp52_; |
| 3926 | gchar* _tmp53_; |
| 3927 | BalaCCodeIdentifier* _tmp54_; |
| 3928 | BalaCCodeIdentifier* _tmp55_; |
| 3929 | BalaCCodeFunctionCall* _tmp56_; |
| 3930 | BalaCCodeFunctionCall* _tmp57_; |
| 3931 | BalaCCodeFunctionCall* _tmp58_; |
| 3932 | BalaCCodeExpression* _tmp59_; |
| 3933 | BalaCCodeUnaryExpression* _tmp60_; |
| 3934 | BalaCCodeUnaryExpression* _tmp61_; |
| 3935 | BalaCCodeFunction* _tmp62_; |
| 3936 | BalaCCodeFunction* _tmp63_; |
| 3937 | BalaCCodeFunctionCall* _tmp64_; |
| 3938 | BalaCCodeBaseModuleEmitContext* _tmp65_; |
| 3939 | _tmp3_ = bala_ccode_identifier_new ("self"); |
| 3940 | l = (BalaCCodeExpression*) _tmp3_; |
| 3941 | _tmp4_ = self->class_init_context; |
| 3942 | _tmp5_ = _bala_ccode_base_module_emit_context_ref0 (_tmp4_); |
| 3943 | init_context = _tmp5_; |
| 3944 | _tmp6_ = self->class_finalize_context; |
| 3945 | _tmp7_ = _bala_ccode_base_module_emit_context_ref0 (_tmp6_); |
| 3946 | finalize_context = _tmp7_; |
| 3947 | if (bala_symbol_is_instance_member (m)) { |
| 3948 | BalaCCodeExpression* _tmp8_; |
| 3949 | BalaCCodeMemberAccess* _tmp9_; |
| 3950 | BalaCCodeMemberAccess* _tmp10_; |
| 3951 | gchar* _tmp11_; |
| 3952 | gchar* _tmp12_; |
| 3953 | gchar* _tmp13_; |
| 3954 | gchar* _tmp14_; |
| 3955 | BalaCCodeMemberAccess* _tmp15_; |
| 3956 | BalaCCodeBaseModuleEmitContext* _tmp16_; |
| 3957 | BalaCCodeBaseModuleEmitContext* _tmp17_; |
| 3958 | BalaCCodeBaseModuleEmitContext* _tmp18_; |
| 3959 | BalaCCodeBaseModuleEmitContext* _tmp19_; |
| 3960 | _tmp8_ = l; |
| 3961 | _tmp9_ = bala_ccode_member_access_new_pointer (_tmp8_, "priv"); |
| 3962 | _tmp10_ = _tmp9_; |
| 3963 | _tmp11_ = bala_get_ccode_name ((BalaCodeNode*) m); |
| 3964 | _tmp12_ = _tmp11_; |
| 3965 | _tmp13_ = bala_ccode_base_module_get_symbol_lock_name (self, _tmp12_); |
| 3966 | _tmp14_ = _tmp13_; |
| 3967 | _tmp15_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp10_, _tmp14_); |
| 3968 | _bala_ccode_node_unref0 (l)((l == ((void*)0)) ? ((void*)0) : (l = (bala_ccode_node_unref (l), ((void*)0)))); |
| 3969 | l = (BalaCCodeExpression*) _tmp15_; |
| 3970 | _g_free0 (_tmp14_)(_tmp14_ = (g_free (_tmp14_), ((void*)0))); |
| 3971 | _g_free0 (_tmp12_)(_tmp12_ = (g_free (_tmp12_), ((void*)0))); |
| 3972 | _bala_ccode_node_unref0 (_tmp10_)((_tmp10_ == ((void*)0)) ? ((void*)0) : (_tmp10_ = (bala_ccode_node_unref (_tmp10_), ((void*)0)))); |
| 3973 | _tmp16_ = self->instance_init_context; |
| 3974 | _tmp17_ = _bala_ccode_base_module_emit_context_ref0 (_tmp16_); |
| 3975 | _bala_ccode_base_module_emit_context_unref0 (init_context)((init_context == ((void*)0)) ? ((void*)0) : (init_context = ( bala_ccode_base_module_emit_context_unref (init_context), ((void *)0)))); |
| 3976 | init_context = _tmp17_; |
| 3977 | _tmp18_ = self->instance_finalize_context; |
| 3978 | _tmp19_ = _bala_ccode_base_module_emit_context_ref0 (_tmp18_); |
| 3979 | _bala_ccode_base_module_emit_context_unref0 (finalize_context)((finalize_context == ((void*)0)) ? ((void*)0) : (finalize_context = (bala_ccode_base_module_emit_context_unref (finalize_context ), ((void*)0)))); |
| 3980 | finalize_context = _tmp19_; |
| 3981 | } else { |
| 3982 | if (bala_symbol_is_class_member (m)) { |
| 3983 | BalaCCodeFunctionCall* get_class_private_call = NULL((void*)0); |
| 3984 | BalaSymbol* _tmp20_; |
| 3985 | BalaSymbol* _tmp21_; |
| 3986 | gchar* _tmp22_; |
| 3987 | gchar* _tmp23_; |
| 3988 | BalaCCodeIdentifier* _tmp24_; |
| 3989 | BalaCCodeIdentifier* _tmp25_; |
| 3990 | BalaCCodeFunctionCall* _tmp26_; |
| 3991 | BalaCCodeFunctionCall* _tmp27_; |
| 3992 | BalaCCodeFunctionCall* _tmp28_; |
| 3993 | BalaCCodeIdentifier* _tmp29_; |
| 3994 | BalaCCodeIdentifier* _tmp30_; |
| 3995 | BalaCCodeFunctionCall* _tmp31_; |
| 3996 | gchar* _tmp32_; |
| 3997 | gchar* _tmp33_; |
| 3998 | gchar* _tmp34_; |
| 3999 | gchar* _tmp35_; |
| 4000 | BalaCCodeMemberAccess* _tmp36_; |
| 4001 | _tmp20_ = bala_symbol_get_parent_symbol (m); |
| 4002 | _tmp21_ = _tmp20_; |
| 4003 | _tmp22_ = bala_get_ccode_class_get_private_function (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp21_), ((bala_class_get_type ())))))); |
| 4004 | _tmp23_ = _tmp22_; |
| 4005 | _tmp24_ = bala_ccode_identifier_new (_tmp23_); |
| 4006 | _tmp25_ = _tmp24_; |
| 4007 | _tmp26_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp25_); |
| 4008 | _tmp27_ = _tmp26_; |
| 4009 | _bala_ccode_node_unref0 (_tmp25_)((_tmp25_ == ((void*)0)) ? ((void*)0) : (_tmp25_ = (bala_ccode_node_unref (_tmp25_), ((void*)0)))); |
| 4010 | _g_free0 (_tmp23_)(_tmp23_ = (g_free (_tmp23_), ((void*)0))); |
| 4011 | get_class_private_call = _tmp27_; |
| 4012 | _tmp28_ = get_class_private_call; |
| 4013 | _tmp29_ = bala_ccode_identifier_new ("klass"); |
| 4014 | _tmp30_ = _tmp29_; |
| 4015 | bala_ccode_function_call_add_argument (_tmp28_, (BalaCCodeExpression*) _tmp30_); |
| 4016 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 4017 | _tmp31_ = get_class_private_call; |
| 4018 | _tmp32_ = bala_get_ccode_name ((BalaCodeNode*) m); |
| 4019 | _tmp33_ = _tmp32_; |
| 4020 | _tmp34_ = bala_ccode_base_module_get_symbol_lock_name (self, _tmp33_); |
| 4021 | _tmp35_ = _tmp34_; |
| 4022 | _tmp36_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp31_, _tmp35_); |
| 4023 | _bala_ccode_node_unref0 (l)((l == ((void*)0)) ? ((void*)0) : (l = (bala_ccode_node_unref (l), ((void*)0)))); |
| 4024 | l = (BalaCCodeExpression*) _tmp36_; |
| 4025 | _g_free0 (_tmp35_)(_tmp35_ = (g_free (_tmp35_), ((void*)0))); |
| 4026 | _g_free0 (_tmp33_)(_tmp33_ = (g_free (_tmp33_), ((void*)0))); |
| 4027 | _bala_ccode_node_unref0 (get_class_private_call)((get_class_private_call == ((void*)0)) ? ((void*)0) : (get_class_private_call = (bala_ccode_node_unref (get_class_private_call), ((void*)0 )))); |
| 4028 | } else { |
| 4029 | BalaSymbol* _tmp37_; |
| 4030 | BalaSymbol* _tmp38_; |
| 4031 | gchar* _tmp39_; |
| 4032 | gchar* _tmp40_; |
| 4033 | gchar* _tmp41_; |
| 4034 | gchar* _tmp42_; |
| 4035 | gchar* _tmp43_; |
| 4036 | gchar* _tmp44_; |
| 4037 | gchar* _tmp45_; |
| 4038 | gchar* _tmp46_; |
| 4039 | BalaCCodeIdentifier* _tmp47_; |
| 4040 | _tmp37_ = bala_symbol_get_parent_symbol (m); |
| 4041 | _tmp38_ = _tmp37_; |
| 4042 | _tmp39_ = bala_get_ccode_lower_case_name ((BalaCodeNode*) _tmp38_, NULL((void*)0)); |
| 4043 | _tmp40_ = _tmp39_; |
| 4044 | _tmp41_ = bala_get_ccode_name ((BalaCodeNode*) m); |
| 4045 | _tmp42_ = _tmp41_; |
| 4046 | _tmp43_ = g_strdup_printf ("%s_%s", _tmp40_, _tmp42_); |
| 4047 | _tmp44_ = _tmp43_; |
| 4048 | _tmp45_ = bala_ccode_base_module_get_symbol_lock_name (self, _tmp44_); |
| 4049 | _tmp46_ = _tmp45_; |
| 4050 | _tmp47_ = bala_ccode_identifier_new (_tmp46_); |
| 4051 | _bala_ccode_node_unref0 (l)((l == ((void*)0)) ? ((void*)0) : (l = (bala_ccode_node_unref (l), ((void*)0)))); |
| 4052 | l = (BalaCCodeExpression*) _tmp47_; |
| 4053 | _g_free0 (_tmp46_)(_tmp46_ = (g_free (_tmp46_), ((void*)0))); |
| 4054 | _g_free0 (_tmp44_)(_tmp44_ = (g_free (_tmp44_), ((void*)0))); |
| 4055 | _g_free0 (_tmp42_)(_tmp42_ = (g_free (_tmp42_), ((void*)0))); |
| 4056 | _g_free0 (_tmp40_)(_tmp40_ = (g_free (_tmp40_), ((void*)0))); |
| 4057 | } |
| 4058 | } |
| 4059 | _tmp48_ = init_context; |
| 4060 | bala_ccode_base_module_push_context (self, _tmp48_); |
| 4061 | _tmp49_ = self->mutex_type; |
| 4062 | _tmp50_ = bala_struct_get_default_construction_method (_tmp49_); |
| 4063 | _tmp51_ = _tmp50_; |
| 4064 | _tmp52_ = bala_get_ccode_name ((BalaCodeNode*) _tmp51_); |
| 4065 | _tmp53_ = _tmp52_; |
| 4066 | _tmp54_ = bala_ccode_identifier_new (_tmp53_); |
| 4067 | _tmp55_ = _tmp54_; |
| 4068 | _tmp56_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp55_); |
| 4069 | _tmp57_ = _tmp56_; |
| 4070 | _bala_ccode_node_unref0 (_tmp55_)((_tmp55_ == ((void*)0)) ? ((void*)0) : (_tmp55_ = (bala_ccode_node_unref (_tmp55_), ((void*)0)))); |
| 4071 | _g_free0 (_tmp53_)(_tmp53_ = (g_free (_tmp53_), ((void*)0))); |
| 4072 | initf = _tmp57_; |
| 4073 | _tmp58_ = initf; |
| 4074 | _tmp59_ = l; |
| 4075 | _tmp60_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp59_); |
| 4076 | _tmp61_ = _tmp60_; |
| 4077 | bala_ccode_function_call_add_argument (_tmp58_, (BalaCCodeExpression*) _tmp61_); |
| 4078 | _bala_ccode_node_unref0 (_tmp61_)((_tmp61_ == ((void*)0)) ? ((void*)0) : (_tmp61_ = (bala_ccode_node_unref (_tmp61_), ((void*)0)))); |
| 4079 | _tmp62_ = bala_ccode_base_module_get_ccode (self); |
| 4080 | _tmp63_ = _tmp62_; |
| 4081 | _tmp64_ = initf; |
| 4082 | bala_ccode_function_add_expression (_tmp63_, (BalaCCodeExpression*) _tmp64_); |
| 4083 | bala_ccode_base_module_pop_context (self); |
| 4084 | _tmp65_ = finalize_context; |
| 4085 | if (_tmp65_ != NULL((void*)0)) { |
| 4086 | BalaCCodeBaseModuleEmitContext* _tmp66_; |
| 4087 | BalaCCodeFunctionCall* fc = NULL((void*)0); |
| 4088 | BalaCCodeIdentifier* _tmp67_; |
| 4089 | BalaCCodeIdentifier* _tmp68_; |
| 4090 | BalaCCodeFunctionCall* _tmp69_; |
| 4091 | BalaCCodeFunctionCall* _tmp70_; |
| 4092 | BalaCCodeFunctionCall* _tmp71_; |
| 4093 | BalaCCodeExpression* _tmp72_; |
| 4094 | BalaCCodeUnaryExpression* _tmp73_; |
| 4095 | BalaCCodeUnaryExpression* _tmp74_; |
| 4096 | BalaCCodeFunction* _tmp75_; |
| 4097 | BalaCCodeFunction* _tmp76_; |
| 4098 | BalaCCodeFunctionCall* _tmp77_; |
| 4099 | _tmp66_ = finalize_context; |
| 4100 | bala_ccode_base_module_push_context (self, _tmp66_); |
| 4101 | _tmp67_ = bala_ccode_identifier_new ("g_rec_mutex_clear"); |
| 4102 | _tmp68_ = _tmp67_; |
| 4103 | _tmp69_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp68_); |
| 4104 | _tmp70_ = _tmp69_; |
| 4105 | _bala_ccode_node_unref0 (_tmp68_)((_tmp68_ == ((void*)0)) ? ((void*)0) : (_tmp68_ = (bala_ccode_node_unref (_tmp68_), ((void*)0)))); |
| 4106 | fc = _tmp70_; |
| 4107 | _tmp71_ = fc; |
| 4108 | _tmp72_ = l; |
| 4109 | _tmp73_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp72_); |
| 4110 | _tmp74_ = _tmp73_; |
| 4111 | bala_ccode_function_call_add_argument (_tmp71_, (BalaCCodeExpression*) _tmp74_); |
| 4112 | _bala_ccode_node_unref0 (_tmp74_)((_tmp74_ == ((void*)0)) ? ((void*)0) : (_tmp74_ = (bala_ccode_node_unref (_tmp74_), ((void*)0)))); |
| 4113 | _tmp75_ = bala_ccode_base_module_get_ccode (self); |
| 4114 | _tmp76_ = _tmp75_; |
| 4115 | _tmp77_ = fc; |
| 4116 | bala_ccode_function_add_expression (_tmp76_, (BalaCCodeExpression*) _tmp77_); |
| 4117 | bala_ccode_base_module_pop_context (self); |
| 4118 | _bala_ccode_node_unref0 (fc)((fc == ((void*)0)) ? ((void*)0) : (fc = (bala_ccode_node_unref (fc), ((void*)0)))); |
| 4119 | } |
| 4120 | _bala_ccode_node_unref0 (initf)((initf == ((void*)0)) ? ((void*)0) : (initf = (bala_ccode_node_unref (initf), ((void*)0)))); |
| 4121 | _bala_ccode_base_module_emit_context_unref0 (finalize_context)((finalize_context == ((void*)0)) ? ((void*)0) : (finalize_context = (bala_ccode_base_module_emit_context_unref (finalize_context ), ((void*)0)))); |
| 4122 | _bala_ccode_base_module_emit_context_unref0 (init_context)((init_context == ((void*)0)) ? ((void*)0) : (init_context = ( bala_ccode_base_module_emit_context_unref (init_context), ((void *)0)))); |
| 4123 | _bala_ccode_node_unref0 (l)((l == ((void*)0)) ? ((void*)0) : (l = (bala_ccode_node_unref (l), ((void*)0)))); |
| 4124 | } |
| 4125 | } |
| 4126 | |
| 4127 | static void |
| 4128 | bala_ccode_base_module_constant_array_ranks_sizes (BalaInitializerList* initializer_list, |
| 4129 | gint* sizes, |
| 4130 | gint sizes_length1, |
| 4131 | gint rank) |
| 4132 | { |
| 4133 | gint _tmp0_; |
| 4134 | gint _tmp1_; |
| 4135 | gint _tmp2_; |
| 4136 | gint _tmp3_; |
| 4137 | g_return_if_fail (initializer_list != NULL)do { if ((initializer_list != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "initializer_list != NULL" ); return; } } while (0); |
| 4138 | _tmp0_ = sizes[rank]; |
| 4139 | _tmp1_ = bala_initializer_list_get_size (initializer_list); |
| 4140 | _tmp2_ = _tmp1_; |
| 4141 | sizes[rank] = MAX (_tmp0_, _tmp2_)(((_tmp0_) > (_tmp2_)) ? (_tmp0_) : (_tmp2_)); |
| 4142 | _tmp3_ = rank; |
| 4143 | rank = _tmp3_ + 1; |
| 4144 | { |
| 4145 | BalaList* _expr_list = NULL((void*)0); |
| 4146 | BalaList* _tmp4_; |
| 4147 | BalaList* _tmp5_; |
| 4148 | gint _expr_size = 0; |
| 4149 | BalaList* _tmp6_; |
| 4150 | gint _tmp7_; |
| 4151 | gint _tmp8_; |
| 4152 | gint _expr_index = 0; |
| 4153 | _tmp4_ = bala_initializer_list_get_initializers (initializer_list); |
| 4154 | _tmp5_ = _bala_iterable_ref0 (_tmp4_); |
| 4155 | _expr_list = _tmp5_; |
| 4156 | _tmp6_ = _expr_list; |
| 4157 | _tmp7_ = bala_collection_get_size ((BalaCollection*) _tmp6_); |
| 4158 | _tmp8_ = _tmp7_; |
| 4159 | _expr_size = _tmp8_; |
| 4160 | _expr_index = -1; |
| 4161 | while (TRUE(!(0))) { |
| 4162 | gint _tmp9_; |
| 4163 | gint _tmp10_; |
| 4164 | BalaExpression* expr = NULL((void*)0); |
| 4165 | BalaList* _tmp11_; |
| 4166 | gpointer _tmp12_; |
| 4167 | gboolean _tmp13_ = FALSE(0); |
| 4168 | BalaExpression* _tmp14_; |
| 4169 | _expr_index = _expr_index + 1; |
| 4170 | _tmp9_ = _expr_index; |
| 4171 | _tmp10_ = _expr_size; |
| 4172 | if (!(_tmp9_ < _tmp10_)) { |
| 4173 | break; |
| 4174 | } |
| 4175 | _tmp11_ = _expr_list; |
| 4176 | _tmp12_ = bala_list_get (_tmp11_, _expr_index); |
| 4177 | expr = (BalaExpression*) _tmp12_; |
| 4178 | _tmp14_ = expr; |
| 4179 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, BALA_TYPE_INITIALIZER_LIST)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp14_); GType __t = ((bala_initializer_list_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 4180 | BalaExpression* _tmp15_; |
| 4181 | BalaDataType* _tmp16_; |
| 4182 | BalaDataType* _tmp17_; |
| 4183 | _tmp15_ = expr; |
| 4184 | _tmp16_ = bala_expression_get_target_type ((BalaExpression*) G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, BALA_TYPE_INITIALIZER_LIST, BalaInitializerList)(((BalaInitializerList*) g_type_check_instance_cast ((GTypeInstance *) (_tmp15_), ((bala_initializer_list_get_type ())))))); |
| 4185 | _tmp17_ = _tmp16_; |
| 4186 | _tmp13_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp17_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 4187 | } else { |
| 4188 | _tmp13_ = FALSE(0); |
| 4189 | } |
| 4190 | if (_tmp13_) { |
| 4191 | BalaExpression* _tmp18_; |
| 4192 | _tmp18_ = expr; |
| 4193 | bala_ccode_base_module_constant_array_ranks_sizes (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, BALA_TYPE_INITIALIZER_LIST, BalaInitializerList)(((BalaInitializerList*) g_type_check_instance_cast ((GTypeInstance *) (_tmp18_), ((bala_initializer_list_get_type ()))))), sizes, (gint) sizes_length1, rank); |
| 4194 | } |
| 4195 | _bala_code_node_unref0 (expr)((expr == ((void*)0)) ? ((void*)0) : (expr = (bala_code_node_unref (expr), ((void*)0)))); |
| 4196 | } |
| 4197 | _bala_iterable_unref0 (_expr_list)((_expr_list == ((void*)0)) ? ((void*)0) : (_expr_list = (bala_iterable_unref (_expr_list), ((void*)0)))); |
| 4198 | } |
| 4199 | } |
| 4200 | |
| 4201 | static BalaCCodeDeclaratorSuffix* |
| 4202 | bala_ccode_base_module_get_constant_declarator_suffix (BalaCCodeBaseModule* self, |
| 4203 | BalaConstant* c) |
| 4204 | { |
| 4205 | BalaArrayType* array = NULL((void*)0); |
| 4206 | BalaDataType* _tmp0_; |
| 4207 | BalaDataType* _tmp1_; |
| 4208 | BalaInitializerList* initializer_list = NULL((void*)0); |
| 4209 | BalaExpression* _tmp2_; |
| 4210 | BalaExpression* _tmp3_; |
| 4211 | gboolean _tmp4_ = FALSE(0); |
| 4212 | BalaArrayType* _tmp5_; |
| 4213 | BalaArrayList* lengths = NULL((void*)0); |
| 4214 | GEqualFunc _tmp11_; |
| 4215 | BalaArrayList* _tmp12_; |
| 4216 | gint* sizes = NULL((void*)0); |
| 4217 | BalaArrayType* _tmp13_; |
| 4218 | gint _tmp14_; |
| 4219 | gint _tmp15_; |
| 4220 | gint* _tmp16_; |
| 4221 | gint sizes_length1; |
| 4222 | gint _sizes_size_; |
| 4223 | BalaInitializerList* _tmp17_; |
| 4224 | gint* _tmp18_; |
| 4225 | gint _tmp18__length1; |
| 4226 | BalaArrayList* _tmp31_; |
| 4227 | BalaCCodeDeclaratorSuffix* _tmp32_; |
| 4228 | BalaCCodeDeclaratorSuffix* result = NULL((void*)0); |
| 4229 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 4230 | g_return_val_if_fail (c != NULL, NULL)do { if ((c != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "c != NULL"); return (((void*)0)); } } while (0); |
| 4231 | _tmp0_ = bala_constant_get_type_reference (c); |
| 4232 | _tmp1_ = _tmp0_; |
| 4233 | array = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) _tmp1_) : NULL((void*)0); |
| 4234 | _tmp2_ = bala_constant_get_value (c); |
| 4235 | _tmp3_ = _tmp2_; |
| 4236 | initializer_list = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_INITIALIZER_LIST)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_initializer_list_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaInitializerList*) _tmp3_) : NULL((void*)0); |
| 4237 | _tmp5_ = array; |
| 4238 | if (_tmp5_ == NULL((void*)0)) { |
| 4239 | _tmp4_ = TRUE(!(0)); |
| 4240 | } else { |
| 4241 | BalaInitializerList* _tmp6_; |
| 4242 | _tmp6_ = initializer_list; |
| 4243 | _tmp4_ = _tmp6_ == NULL((void*)0); |
| 4244 | } |
| 4245 | if (_tmp4_) { |
| 4246 | BalaDataType* _tmp7_; |
| 4247 | BalaDataType* _tmp8_; |
| 4248 | BalaDataType* _tmp9_; |
| 4249 | _tmp7_ = bala_constant_get_type_reference (c); |
| 4250 | _tmp8_ = _tmp7_; |
| 4251 | _tmp9_ = self->string_type; |
| 4252 | if (bala_data_type_compatible (_tmp8_, _tmp9_)) { |
| 4253 | BalaCCodeDeclaratorSuffix* _tmp10_; |
| 4254 | _tmp10_ = bala_ccode_declarator_suffix_new_with_array (NULL((void*)0)); |
| 4255 | result = _tmp10_; |
| 4256 | return result; |
| 4257 | } |
| 4258 | result = NULL((void*)0); |
| 4259 | return result; |
| 4260 | } |
| 4261 | _tmp11_ = g_direct_equal; |
| 4262 | _tmp12_ = bala_array_list_new (BALA_TYPE_CCODE_EXPRESSION(bala_ccode_expression_get_type ()), (GBoxedCopyFunc) bala_ccode_node_ref, (GDestroyNotify) bala_ccode_node_unref, _tmp11_); |
| 4263 | lengths = _tmp12_; |
| 4264 | _tmp13_ = array; |
| 4265 | _tmp14_ = bala_array_type_get_rank (_tmp13_); |
| 4266 | _tmp15_ = _tmp14_; |
| 4267 | _tmp16_ = g_new0 (gint, _tmp15_)((gint *) g_malloc0_n ((_tmp15_), sizeof (gint))); |
| 4268 | sizes = _tmp16_; |
| 4269 | sizes_length1 = _tmp15_; |
| 4270 | _sizes_size_ = sizes_length1; |
| 4271 | _tmp17_ = initializer_list; |
| 4272 | _tmp18_ = sizes; |
| 4273 | _tmp18__length1 = sizes_length1; |
| 4274 | bala_ccode_base_module_constant_array_ranks_sizes (_tmp17_, _tmp18_, (gint) _tmp18__length1, 0); |
| 4275 | { |
| 4276 | gint i = 0; |
| 4277 | i = 0; |
| 4278 | { |
| 4279 | gboolean _tmp19_ = FALSE(0); |
| 4280 | _tmp19_ = TRUE(!(0)); |
| 4281 | while (TRUE(!(0))) { |
| 4282 | BalaArrayType* _tmp21_; |
| 4283 | gint _tmp22_; |
| 4284 | gint _tmp23_; |
| 4285 | BalaArrayList* _tmp24_; |
| 4286 | gint* _tmp25_; |
| 4287 | gint _tmp25__length1; |
| 4288 | gint _tmp26_; |
| 4289 | gchar* _tmp27_; |
| 4290 | gchar* _tmp28_; |
| 4291 | BalaCCodeConstant* _tmp29_; |
| 4292 | BalaCCodeConstant* _tmp30_; |
| 4293 | if (!_tmp19_) { |
| 4294 | gint _tmp20_; |
| 4295 | _tmp20_ = i; |
| 4296 | i = _tmp20_ + 1; |
| 4297 | } |
| 4298 | _tmp19_ = FALSE(0); |
| 4299 | _tmp21_ = array; |
| 4300 | _tmp22_ = bala_array_type_get_rank (_tmp21_); |
| 4301 | _tmp23_ = _tmp22_; |
| 4302 | if (!(i < _tmp23_)) { |
| 4303 | break; |
| 4304 | } |
| 4305 | _tmp24_ = lengths; |
| 4306 | _tmp25_ = sizes; |
| 4307 | _tmp25__length1 = sizes_length1; |
| 4308 | _tmp26_ = _tmp25_[i]; |
| 4309 | _tmp27_ = g_strdup_printf ("%d", _tmp26_); |
| 4310 | _tmp28_ = _tmp27_; |
| 4311 | _tmp29_ = bala_ccode_constant_new (_tmp28_); |
| 4312 | _tmp30_ = _tmp29_; |
| 4313 | bala_collection_add ((BalaCollection*) _tmp24_, (BalaCCodeExpression*) _tmp30_); |
| 4314 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 4315 | _g_free0 (_tmp28_)(_tmp28_ = (g_free (_tmp28_), ((void*)0))); |
| 4316 | } |
| 4317 | } |
| 4318 | } |
| 4319 | _tmp31_ = lengths; |
| 4320 | _tmp32_ = bala_ccode_declarator_suffix_new_with_multi_array ((BalaList*) _tmp31_); |
| 4321 | result = _tmp32_; |
| 4322 | sizes = (g_free (sizes), NULL((void*)0)); |
| 4323 | _bala_iterable_unref0 (lengths)((lengths == ((void*)0)) ? ((void*)0) : (lengths = (bala_iterable_unref (lengths), ((void*)0)))); |
| 4324 | return result; |
| 4325 | } |
| 4326 | |
| 4327 | void |
| 4328 | bala_ccode_base_module_generate_constant_declaration (BalaCCodeBaseModule* self, |
| 4329 | BalaConstant* c, |
| 4330 | BalaCCodeFile* decl_space, |
| 4331 | gboolean definition) |
| 4332 | { |
| 4333 | BalaSymbol* _tmp0_; |
| 4334 | BalaSymbol* _tmp1_; |
| 4335 | gchar* _tmp2_; |
| 4336 | gchar* _tmp3_; |
| 4337 | gboolean _tmp4_; |
| 4338 | gboolean _tmp5_ = FALSE(0); |
| 4339 | gboolean _tmp6_; |
| 4340 | gboolean _tmp7_; |
| 4341 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 4342 | g_return_if_fail (c != NULL)do { if ((c != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "c != NULL"); return ; } } while (0); |
| 4343 | g_return_if_fail (decl_space != NULL)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return; } } while (0); |
| 4344 | _tmp0_ = bala_symbol_get_parent_symbol ((BalaSymbol*) c); |
| 4345 | _tmp1_ = _tmp0_; |
| 4346 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BALA_TYPE_BLOCK)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1_); GType __t = ((bala_block_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 4347 | return; |
| 4348 | } |
| 4349 | _tmp2_ = bala_get_ccode_name ((BalaCodeNode*) c); |
| 4350 | _tmp3_ = _tmp2_; |
| 4351 | _tmp4_ = bala_ccode_base_module_add_symbol_declaration (self, decl_space, (BalaSymbol*) c, _tmp3_); |
| 4352 | _g_free0 (_tmp3_)(_tmp3_ = (g_free (_tmp3_), ((void*)0))); |
| 4353 | if (_tmp4_) { |
| 4354 | return; |
| 4355 | } |
| 4356 | _tmp6_ = bala_symbol_get_external ((BalaSymbol*) c); |
| 4357 | _tmp7_ = _tmp6_; |
| 4358 | if (!_tmp7_) { |
| 4359 | BalaExpression* _tmp8_; |
| 4360 | BalaExpression* _tmp9_; |
| 4361 | _tmp8_ = bala_constant_get_value (c); |
| 4362 | _tmp9_ = _tmp8_; |
| 4363 | _tmp5_ = _tmp9_ != NULL((void*)0); |
| 4364 | } else { |
| 4365 | _tmp5_ = FALSE(0); |
| 4366 | } |
| 4367 | if (_tmp5_) { |
| 4368 | BalaDataType* _tmp10_; |
| 4369 | BalaDataType* _tmp11_; |
| 4370 | BalaExpression* _tmp12_; |
| 4371 | BalaExpression* _tmp13_; |
| 4372 | BalaInitializerList* initializer_list = NULL((void*)0); |
| 4373 | BalaExpression* _tmp14_; |
| 4374 | BalaExpression* _tmp15_; |
| 4375 | BalaInitializerList* _tmp16_; |
| 4376 | BalaInitializerList* _tmp17_; |
| 4377 | _tmp10_ = bala_constant_get_type_reference (c); |
| 4378 | _tmp11_ = _tmp10_; |
| 4379 | bala_ccode_base_module_generate_type_declaration (self, _tmp11_, decl_space); |
| 4380 | _tmp12_ = bala_constant_get_value (c); |
| 4381 | _tmp13_ = _tmp12_; |
| 4382 | bala_code_node_emit ((BalaCodeNode*) _tmp13_, (BalaCodeGenerator*) self); |
| 4383 | _tmp14_ = bala_constant_get_value (c); |
| 4384 | _tmp15_ = _tmp14_; |
| 4385 | _tmp16_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, BALA_TYPE_INITIALIZER_LIST)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp15_); GType __t = ((bala_initializer_list_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaInitializerList*) _tmp15_) : NULL((void*)0)); |
| 4386 | initializer_list = _tmp16_; |
| 4387 | _tmp17_ = initializer_list; |
| 4388 | if (_tmp17_ != NULL((void*)0)) { |
| 4389 | BalaCCodeDeclaration* _cdecl_ = NULL((void*)0); |
| 4390 | BalaDataType* _tmp18_; |
| 4391 | BalaDataType* _tmp19_; |
| 4392 | gchar* _tmp20_; |
| 4393 | gchar* _tmp21_; |
| 4394 | BalaCCodeDeclaration* _tmp22_; |
| 4395 | BalaCCodeDeclaration* _tmp23_; |
| 4396 | BalaCCodeExpression* cinitializer = NULL((void*)0); |
| 4397 | BalaExpression* _tmp24_; |
| 4398 | BalaExpression* _tmp25_; |
| 4399 | BalaCCodeExpression* _tmp26_; |
| 4400 | BalaCCodeExpression* _tmp27_; |
| 4401 | BalaCCodeDeclaration* _tmp28_; |
| 4402 | gchar* _tmp29_; |
| 4403 | gchar* _tmp30_; |
| 4404 | BalaCCodeExpression* _tmp31_; |
| 4405 | BalaCCodeDeclaratorSuffix* _tmp32_; |
| 4406 | BalaCCodeDeclaratorSuffix* _tmp33_; |
| 4407 | BalaCCodeVariableDeclarator* _tmp34_; |
| 4408 | BalaCCodeVariableDeclarator* _tmp35_; |
| 4409 | BalaCCodeDeclaration* _tmp38_; |
| 4410 | _tmp18_ = bala_constant_get_type_reference (c); |
| 4411 | _tmp19_ = _tmp18_; |
| 4412 | _tmp20_ = bala_get_ccode_const_name ((BalaCodeNode*) _tmp19_); |
| 4413 | _tmp21_ = _tmp20_; |
| 4414 | _tmp22_ = bala_ccode_declaration_new (_tmp21_); |
| 4415 | _tmp23_ = _tmp22_; |
| 4416 | _g_free0 (_tmp21_)(_tmp21_ = (g_free (_tmp21_), ((void*)0))); |
| 4417 | _cdecl_ = _tmp23_; |
| 4418 | _tmp24_ = bala_constant_get_value (c); |
| 4419 | _tmp25_ = _tmp24_; |
| 4420 | _tmp26_ = bala_get_cvalue (_tmp25_); |
| 4421 | _tmp27_ = _bala_ccode_node_ref0 (_tmp26_); |
| 4422 | cinitializer = _tmp27_; |
| 4423 | if (!definition) { |
| 4424 | _bala_ccode_node_unref0 (cinitializer)((cinitializer == ((void*)0)) ? ((void*)0) : (cinitializer = ( bala_ccode_node_unref (cinitializer), ((void*)0)))); |
| 4425 | cinitializer = NULL((void*)0); |
| 4426 | } |
| 4427 | _tmp28_ = _cdecl_; |
| 4428 | _tmp29_ = bala_get_ccode_name ((BalaCodeNode*) c); |
| 4429 | _tmp30_ = _tmp29_; |
| 4430 | _tmp31_ = cinitializer; |
| 4431 | _tmp32_ = bala_ccode_base_module_get_constant_declarator_suffix (self, c); |
| 4432 | _tmp33_ = _tmp32_; |
| 4433 | _tmp34_ = bala_ccode_variable_declarator_new (_tmp30_, _tmp31_, _tmp33_); |
| 4434 | _tmp35_ = _tmp34_; |
| 4435 | bala_ccode_declaration_add_declarator (_tmp28_, (BalaCCodeDeclarator*) _tmp35_); |
| 4436 | _bala_ccode_node_unref0 (_tmp35_)((_tmp35_ == ((void*)0)) ? ((void*)0) : (_tmp35_ = (bala_ccode_node_unref (_tmp35_), ((void*)0)))); |
| 4437 | _bala_ccode_declarator_suffix_unref0 (_tmp33_)((_tmp33_ == ((void*)0)) ? ((void*)0) : (_tmp33_ = (bala_ccode_declarator_suffix_unref (_tmp33_), ((void*)0)))); |
| 4438 | _g_free0 (_tmp30_)(_tmp30_ = (g_free (_tmp30_), ((void*)0))); |
| 4439 | if (bala_symbol_is_private_symbol ((BalaSymbol*) c)) { |
| 4440 | BalaCCodeDeclaration* _tmp36_; |
| 4441 | _tmp36_ = _cdecl_; |
| 4442 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp36_, BALA_CCODE_MODIFIERS_STATIC); |
| 4443 | } else { |
| 4444 | BalaCCodeDeclaration* _tmp37_; |
| 4445 | _tmp37_ = _cdecl_; |
| 4446 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp37_, BALA_CCODE_MODIFIERS_EXTERN); |
| 4447 | } |
| 4448 | _tmp38_ = _cdecl_; |
| 4449 | bala_ccode_file_add_constant_declaration (decl_space, (BalaCCodeNode*) _tmp38_); |
| 4450 | _bala_ccode_node_unref0 (cinitializer)((cinitializer == ((void*)0)) ? ((void*)0) : (cinitializer = ( bala_ccode_node_unref (cinitializer), ((void*)0)))); |
| 4451 | _bala_ccode_node_unref0 (_cdecl_)((_cdecl_ == ((void*)0)) ? ((void*)0) : (_cdecl_ = (bala_ccode_node_unref (_cdecl_), ((void*)0)))); |
| 4452 | } else { |
| 4453 | gboolean _tmp39_ = FALSE(0); |
| 4454 | BalaExpression* _tmp40_; |
| 4455 | BalaExpression* _tmp41_; |
| 4456 | BalaCCodeMacroReplacement* cdefine = NULL((void*)0); |
| 4457 | gchar* _tmp59_; |
| 4458 | gchar* _tmp60_; |
| 4459 | BalaExpression* _tmp61_; |
| 4460 | BalaExpression* _tmp62_; |
| 4461 | BalaCCodeExpression* _tmp63_; |
| 4462 | BalaCCodeMacroReplacement* _tmp64_; |
| 4463 | BalaCCodeMacroReplacement* _tmp65_; |
| 4464 | BalaCCodeMacroReplacement* _tmp66_; |
| 4465 | _tmp40_ = bala_constant_get_value (c); |
| 4466 | _tmp41_ = _tmp40_; |
| 4467 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp41_, BALA_TYPE_STRING_LITERAL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp41_); GType __t = ((bala_string_literal_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 4468 | BalaExpression* _tmp42_; |
| 4469 | BalaExpression* _tmp43_; |
| 4470 | gboolean _tmp44_; |
| 4471 | gboolean _tmp45_; |
| 4472 | _tmp42_ = bala_constant_get_value (c); |
| 4473 | _tmp43_ = _tmp42_; |
| 4474 | _tmp44_ = bala_string_literal_get_translate (G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, BALA_TYPE_STRING_LITERAL, BalaStringLiteral)(((BalaStringLiteral*) g_type_check_instance_cast ((GTypeInstance *) (_tmp43_), ((bala_string_literal_get_type ())))))); |
| 4475 | _tmp45_ = _tmp44_; |
| 4476 | _tmp39_ = _tmp45_; |
| 4477 | } else { |
| 4478 | _tmp39_ = FALSE(0); |
| 4479 | } |
| 4480 | if (_tmp39_) { |
| 4481 | BalaMethod* m = NULL((void*)0); |
| 4482 | BalaSymbol* _tmp46_; |
| 4483 | BalaScope* _tmp47_; |
| 4484 | BalaScope* _tmp48_; |
| 4485 | BalaSymbol* _tmp49_; |
| 4486 | BalaSymbol* _tmp50_; |
| 4487 | BalaScope* _tmp51_; |
| 4488 | BalaScope* _tmp52_; |
| 4489 | BalaSymbol* _tmp53_; |
| 4490 | BalaMethod* _tmp54_; |
| 4491 | BalaMethod* _tmp55_; |
| 4492 | BalaMethod* _tmp56_; |
| 4493 | gchar* _tmp57_; |
| 4494 | gchar* _tmp58_; |
| 4495 | _tmp46_ = self->root_symbol; |
| 4496 | _tmp47_ = bala_symbol_get_scope (_tmp46_); |
| 4497 | _tmp48_ = _tmp47_; |
| 4498 | _tmp49_ = bala_scope_lookup (_tmp48_, "GLib"); |
| 4499 | _tmp50_ = _tmp49_; |
| 4500 | _tmp51_ = bala_symbol_get_scope (_tmp50_); |
| 4501 | _tmp52_ = _tmp51_; |
| 4502 | _tmp53_ = bala_scope_lookup (_tmp52_, "_"); |
| 4503 | _tmp54_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, BALA_TYPE_METHOD, BalaMethod)(((BalaMethod*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp53_), ((bala_method_get_type ()))))); |
| 4504 | _bala_code_node_unref0 (_tmp50_)((_tmp50_ == ((void*)0)) ? ((void*)0) : (_tmp50_ = (bala_code_node_unref (_tmp50_), ((void*)0)))); |
| 4505 | m = _tmp54_; |
| 4506 | _tmp55_ = m; |
| 4507 | _tmp56_ = m; |
| 4508 | _tmp57_ = bala_get_ccode_name ((BalaCodeNode*) _tmp56_); |
| 4509 | _tmp58_ = _tmp57_; |
| 4510 | bala_ccode_base_module_add_symbol_declaration (self, decl_space, (BalaSymbol*) _tmp55_, _tmp58_); |
| 4511 | _g_free0 (_tmp58_)(_tmp58_ = (g_free (_tmp58_), ((void*)0))); |
| 4512 | _bala_code_node_unref0 (m)((m == ((void*)0)) ? ((void*)0) : (m = (bala_code_node_unref ( m), ((void*)0)))); |
| 4513 | } |
| 4514 | _tmp59_ = bala_get_ccode_name ((BalaCodeNode*) c); |
| 4515 | _tmp60_ = _tmp59_; |
| 4516 | _tmp61_ = bala_constant_get_value (c); |
| 4517 | _tmp62_ = _tmp61_; |
| 4518 | _tmp63_ = bala_get_cvalue (_tmp62_); |
| 4519 | _tmp64_ = bala_ccode_macro_replacement_new_with_expression (_tmp60_, _tmp63_); |
| 4520 | _tmp65_ = _tmp64_; |
| 4521 | _g_free0 (_tmp60_)(_tmp60_ = (g_free (_tmp60_), ((void*)0))); |
| 4522 | cdefine = _tmp65_; |
| 4523 | _tmp66_ = cdefine; |
| 4524 | bala_ccode_file_add_type_member_declaration (decl_space, (BalaCCodeNode*) _tmp66_); |
| 4525 | _bala_ccode_node_unref0 (cdefine)((cdefine == ((void*)0)) ? ((void*)0) : (cdefine = (bala_ccode_node_unref (cdefine), ((void*)0)))); |
| 4526 | } |
| 4527 | _bala_code_node_unref0 (initializer_list)((initializer_list == ((void*)0)) ? ((void*)0) : (initializer_list = (bala_code_node_unref (initializer_list), ((void*)0)))); |
| 4528 | } |
| 4529 | } |
| 4530 | |
| 4531 | static void |
| 4532 | bala_ccode_base_module_real_visit_constant (BalaCodeVisitor* base, |
| 4533 | BalaConstant* c) |
| 4534 | { |
| 4535 | BalaCCodeBaseModule * self; |
| 4536 | BalaSourceReference* _tmp0_; |
| 4537 | BalaSourceReference* _tmp1_; |
| 4538 | BalaSymbol* _tmp2_; |
| 4539 | BalaSymbol* _tmp3_; |
| 4540 | self = (BalaCCodeBaseModule*) base; |
| 4541 | g_return_if_fail (c != NULL)do { if ((c != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "c != NULL"); return ; } } while (0); |
| 4542 | _tmp0_ = bala_code_node_get_source_reference ((BalaCodeNode*) c); |
| 4543 | _tmp1_ = _tmp0_; |
| 4544 | bala_ccode_base_module_push_line (self, _tmp1_); |
| 4545 | _tmp2_ = bala_symbol_get_parent_symbol ((BalaSymbol*) c); |
| 4546 | _tmp3_ = _tmp2_; |
| 4547 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_BLOCK)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_block_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 4548 | BalaDataType* _tmp4_; |
| 4549 | BalaDataType* _tmp5_; |
| 4550 | BalaCCodeFile* _tmp6_; |
| 4551 | BalaExpression* _tmp7_; |
| 4552 | BalaExpression* _tmp8_; |
| 4553 | gchar* type_name = NULL((void*)0); |
| 4554 | BalaDataType* _tmp9_; |
| 4555 | BalaDataType* _tmp10_; |
| 4556 | BalaDataType* _tmp11_; |
| 4557 | BalaCCodeExpression* cinitializer = NULL((void*)0); |
| 4558 | BalaExpression* _tmp16_; |
| 4559 | BalaExpression* _tmp17_; |
| 4560 | BalaCCodeExpression* _tmp18_; |
| 4561 | BalaCCodeExpression* _tmp19_; |
| 4562 | BalaCCodeFunction* _tmp20_; |
| 4563 | BalaCCodeFunction* _tmp21_; |
| 4564 | const gchar* _tmp22_; |
| 4565 | gchar* _tmp23_; |
| 4566 | gchar* _tmp24_; |
| 4567 | BalaCCodeExpression* _tmp25_; |
| 4568 | BalaCCodeDeclaratorSuffix* _tmp26_; |
| 4569 | BalaCCodeDeclaratorSuffix* _tmp27_; |
| 4570 | BalaCCodeVariableDeclarator* _tmp28_; |
| 4571 | BalaCCodeVariableDeclarator* _tmp29_; |
| 4572 | _tmp4_ = bala_constant_get_type_reference (c); |
| 4573 | _tmp5_ = _tmp4_; |
| 4574 | _tmp6_ = self->cfile; |
| 4575 | bala_ccode_base_module_generate_type_declaration (self, _tmp5_, _tmp6_); |
| 4576 | _tmp7_ = bala_constant_get_value (c); |
| 4577 | _tmp8_ = _tmp7_; |
| 4578 | bala_code_node_emit ((BalaCodeNode*) _tmp8_, (BalaCodeGenerator*) self); |
| 4579 | _tmp9_ = bala_constant_get_type_reference (c); |
| 4580 | _tmp10_ = _tmp9_; |
| 4581 | _tmp11_ = self->string_type; |
| 4582 | if (bala_data_type_compatible (_tmp10_, _tmp11_)) { |
| 4583 | gchar* _tmp12_; |
| 4584 | _tmp12_ = g_strdup ("const char"); |
| 4585 | _g_free0 (type_name)(type_name = (g_free (type_name), ((void*)0))); |
| 4586 | type_name = _tmp12_; |
| 4587 | } else { |
| 4588 | BalaDataType* _tmp13_; |
| 4589 | BalaDataType* _tmp14_; |
| 4590 | gchar* _tmp15_; |
| 4591 | _tmp13_ = bala_constant_get_type_reference (c); |
| 4592 | _tmp14_ = _tmp13_; |
| 4593 | _tmp15_ = bala_get_ccode_const_name ((BalaCodeNode*) _tmp14_); |
| 4594 | _g_free0 (type_name)(type_name = (g_free (type_name), ((void*)0))); |
| 4595 | type_name = _tmp15_; |
| 4596 | } |
| 4597 | _tmp16_ = bala_constant_get_value (c); |
| 4598 | _tmp17_ = _tmp16_; |
| 4599 | _tmp18_ = bala_get_cvalue (_tmp17_); |
| 4600 | _tmp19_ = _bala_ccode_node_ref0 (_tmp18_); |
| 4601 | cinitializer = _tmp19_; |
| 4602 | _tmp20_ = bala_ccode_base_module_get_ccode (self); |
| 4603 | _tmp21_ = _tmp20_; |
| 4604 | _tmp22_ = type_name; |
| 4605 | _tmp23_ = bala_get_ccode_name ((BalaCodeNode*) c); |
| 4606 | _tmp24_ = _tmp23_; |
| 4607 | _tmp25_ = cinitializer; |
| 4608 | _tmp26_ = bala_ccode_base_module_get_constant_declarator_suffix (self, c); |
| 4609 | _tmp27_ = _tmp26_; |
| 4610 | _tmp28_ = bala_ccode_variable_declarator_new (_tmp24_, _tmp25_, _tmp27_); |
| 4611 | _tmp29_ = _tmp28_; |
| 4612 | bala_ccode_function_add_declaration (_tmp21_, _tmp22_, (BalaCCodeDeclarator*) _tmp29_, BALA_CCODE_MODIFIERS_STATIC); |
| 4613 | _bala_ccode_node_unref0 (_tmp29_)((_tmp29_ == ((void*)0)) ? ((void*)0) : (_tmp29_ = (bala_ccode_node_unref (_tmp29_), ((void*)0)))); |
| 4614 | _bala_ccode_declarator_suffix_unref0 (_tmp27_)((_tmp27_ == ((void*)0)) ? ((void*)0) : (_tmp27_ = (bala_ccode_declarator_suffix_unref (_tmp27_), ((void*)0)))); |
| 4615 | _g_free0 (_tmp24_)(_tmp24_ = (g_free (_tmp24_), ((void*)0))); |
| 4616 | _bala_ccode_node_unref0 (cinitializer)((cinitializer == ((void*)0)) ? ((void*)0) : (cinitializer = ( bala_ccode_node_unref (cinitializer), ((void*)0)))); |
| 4617 | _g_free0 (type_name)(type_name = (g_free (type_name), ((void*)0))); |
| 4618 | } else { |
| 4619 | BalaCCodeFile* _tmp30_; |
| 4620 | _tmp30_ = self->cfile; |
| 4621 | bala_ccode_base_module_generate_constant_declaration (self, c, _tmp30_, TRUE(!(0))); |
| 4622 | if (!bala_symbol_is_internal_symbol ((BalaSymbol*) c)) { |
| 4623 | BalaCCodeFile* _tmp31_; |
| 4624 | _tmp31_ = self->header_file; |
| 4625 | bala_ccode_base_module_generate_constant_declaration (self, c, _tmp31_, FALSE(0)); |
| 4626 | } |
| 4627 | if (!bala_symbol_is_private_symbol ((BalaSymbol*) c)) { |
| 4628 | BalaCCodeFile* _tmp32_; |
| 4629 | _tmp32_ = self->internal_header_file; |
| 4630 | bala_ccode_base_module_generate_constant_declaration (self, c, _tmp32_, FALSE(0)); |
| 4631 | } |
| 4632 | } |
| 4633 | bala_ccode_base_module_pop_line (self); |
| 4634 | } |
| 4635 | |
| 4636 | void |
| 4637 | bala_ccode_base_module_append_field (BalaCCodeBaseModule* self, |
| 4638 | BalaCCodeStruct* ccode_struct, |
| 4639 | BalaField* f, |
| 4640 | BalaCCodeFile* decl_space) |
| 4641 | { |
| 4642 | BalaDataType* _tmp0_; |
| 4643 | BalaDataType* _tmp1_; |
| 4644 | BalaCCodeModifiers _tmp2_ = 0U; |
| 4645 | gboolean _tmp3_; |
| 4646 | gboolean _tmp4_; |
| 4647 | BalaCCodeModifiers _tmp5_ = 0U; |
| 4648 | BalaVersionAttribute* _tmp6_; |
| 4649 | BalaVersionAttribute* _tmp7_; |
| 4650 | gboolean _tmp8_; |
| 4651 | gboolean _tmp9_; |
| 4652 | BalaCCodeModifiers modifiers = 0U; |
| 4653 | BalaDataType* _tmp10_; |
| 4654 | BalaDataType* _tmp11_; |
| 4655 | gchar* _tmp12_; |
| 4656 | gchar* _tmp13_; |
| 4657 | gchar* _tmp14_; |
| 4658 | gchar* _tmp15_; |
| 4659 | BalaCCodeModifiers _tmp16_; |
| 4660 | BalaDataType* _tmp17_; |
| 4661 | BalaDataType* _tmp18_; |
| 4662 | BalaCCodeDeclaratorSuffix* _tmp19_; |
| 4663 | BalaCCodeDeclaratorSuffix* _tmp20_; |
| 4664 | gboolean _tmp21_ = FALSE(0); |
| 4665 | BalaDataType* _tmp22_; |
| 4666 | BalaDataType* _tmp23_; |
| 4667 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 4668 | g_return_if_fail (ccode_struct != NULL)do { if ((ccode_struct != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "ccode_struct != NULL" ); return; } } while (0); |
| 4669 | g_return_if_fail (f != NULL)do { if ((f != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "f != NULL"); return ; } } while (0); |
| 4670 | g_return_if_fail (decl_space != NULL)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return; } } while (0); |
| 4671 | _tmp0_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 4672 | _tmp1_ = _tmp0_; |
| 4673 | bala_ccode_base_module_generate_type_declaration (self, _tmp1_, decl_space); |
| 4674 | _tmp3_ = bala_field_get_is_volatile (f); |
| 4675 | _tmp4_ = _tmp3_; |
| 4676 | if (_tmp4_) { |
| 4677 | _tmp2_ = BALA_CCODE_MODIFIERS_VOLATILE; |
| 4678 | } else { |
| 4679 | _tmp2_ = 0; |
| 4680 | } |
| 4681 | _tmp6_ = bala_symbol_get_version ((BalaSymbol*) f); |
| 4682 | _tmp7_ = _tmp6_; |
| 4683 | _tmp8_ = bala_version_attribute_get_deprecated (_tmp7_); |
| 4684 | _tmp9_ = _tmp8_; |
| 4685 | if (_tmp9_) { |
| 4686 | _tmp5_ = BALA_CCODE_MODIFIERS_DEPRECATED; |
| 4687 | } else { |
| 4688 | _tmp5_ = 0; |
| 4689 | } |
| 4690 | modifiers = _tmp2_ | _tmp5_; |
| 4691 | _tmp10_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 4692 | _tmp11_ = _tmp10_; |
| 4693 | _tmp12_ = bala_get_ccode_name ((BalaCodeNode*) _tmp11_); |
| 4694 | _tmp13_ = _tmp12_; |
| 4695 | _tmp14_ = bala_get_ccode_name ((BalaCodeNode*) f); |
| 4696 | _tmp15_ = _tmp14_; |
| 4697 | _tmp16_ = modifiers; |
| 4698 | _tmp17_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 4699 | _tmp18_ = _tmp17_; |
| 4700 | _tmp19_ = bala_ccode_base_module_get_ccode_declarator_suffix (self, _tmp18_); |
| 4701 | _tmp20_ = _tmp19_; |
| 4702 | bala_ccode_struct_add_field (ccode_struct, _tmp13_, _tmp15_, _tmp16_, _tmp20_); |
| 4703 | _bala_ccode_declarator_suffix_unref0 (_tmp20_)((_tmp20_ == ((void*)0)) ? ((void*)0) : (_tmp20_ = (bala_ccode_declarator_suffix_unref (_tmp20_), ((void*)0)))); |
| 4704 | _g_free0 (_tmp15_)(_tmp15_ = (g_free (_tmp15_), ((void*)0))); |
| 4705 | _g_free0 (_tmp13_)(_tmp13_ = (g_free (_tmp13_), ((void*)0))); |
| 4706 | _tmp22_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 4707 | _tmp23_ = _tmp22_; |
| 4708 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp23_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp23_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 4709 | _tmp21_ = bala_get_ccode_array_length ((BalaCodeNode*) f); |
| 4710 | } else { |
| 4711 | _tmp21_ = FALSE(0); |
| 4712 | } |
| 4713 | if (_tmp21_) { |
| 4714 | BalaArrayType* array_type = NULL((void*)0); |
| 4715 | BalaDataType* _tmp24_; |
| 4716 | BalaDataType* _tmp25_; |
| 4717 | BalaArrayType* _tmp26_; |
| 4718 | BalaArrayType* _tmp27_; |
| 4719 | gboolean _tmp28_; |
| 4720 | gboolean _tmp29_; |
| 4721 | _tmp24_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 4722 | _tmp25_ = _tmp24_; |
| 4723 | _tmp26_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp25_), ((bala_array_type_get_type ())))))); |
| 4724 | array_type = _tmp26_; |
| 4725 | _tmp27_ = array_type; |
| 4726 | _tmp28_ = bala_array_type_get_fixed_length (_tmp27_); |
| 4727 | _tmp29_ = _tmp28_; |
| 4728 | if (!_tmp29_) { |
| 4729 | gchar* length_ctype = NULL((void*)0); |
| 4730 | gchar* _tmp30_; |
| 4731 | gboolean _tmp39_ = FALSE(0); |
| 4732 | BalaArrayType* _tmp40_; |
| 4733 | gint _tmp41_; |
| 4734 | gint _tmp42_; |
| 4735 | _tmp30_ = bala_get_ccode_array_length_type ((BalaCodeNode*) f); |
| 4736 | length_ctype = _tmp30_; |
| 4737 | { |
| 4738 | gint dim = 0; |
| 4739 | dim = 1; |
| 4740 | { |
| 4741 | gboolean _tmp31_ = FALSE(0); |
| 4742 | _tmp31_ = TRUE(!(0)); |
| 4743 | while (TRUE(!(0))) { |
| 4744 | BalaArrayType* _tmp33_; |
| 4745 | gint _tmp34_; |
| 4746 | gint _tmp35_; |
| 4747 | gchar* length_cname = NULL((void*)0); |
| 4748 | gchar* _tmp36_; |
| 4749 | const gchar* _tmp37_; |
| 4750 | const gchar* _tmp38_; |
| 4751 | if (!_tmp31_) { |
| 4752 | gint _tmp32_; |
| 4753 | _tmp32_ = dim; |
| 4754 | dim = _tmp32_ + 1; |
| 4755 | } |
| 4756 | _tmp31_ = FALSE(0); |
| 4757 | _tmp33_ = array_type; |
| 4758 | _tmp34_ = bala_array_type_get_rank (_tmp33_); |
| 4759 | _tmp35_ = _tmp34_; |
| 4760 | if (!(dim <= _tmp35_)) { |
| 4761 | break; |
| 4762 | } |
| 4763 | _tmp36_ = bala_ccode_base_module_get_variable_array_length_cname (self, (BalaVariable*) f, dim); |
| 4764 | length_cname = _tmp36_; |
| 4765 | _tmp37_ = length_ctype; |
| 4766 | _tmp38_ = length_cname; |
| 4767 | bala_ccode_struct_add_field (ccode_struct, _tmp37_, _tmp38_, 0, NULL((void*)0)); |
| 4768 | _g_free0 (length_cname)(length_cname = (g_free (length_cname), ((void*)0))); |
| 4769 | } |
| 4770 | } |
| 4771 | } |
| 4772 | _tmp40_ = array_type; |
| 4773 | _tmp41_ = bala_array_type_get_rank (_tmp40_); |
| 4774 | _tmp42_ = _tmp41_; |
| 4775 | if (_tmp42_ == 1) { |
| 4776 | _tmp39_ = bala_symbol_is_internal_symbol ((BalaSymbol*) f); |
| 4777 | } else { |
| 4778 | _tmp39_ = FALSE(0); |
| 4779 | } |
| 4780 | if (_tmp39_) { |
| 4781 | const gchar* _tmp43_; |
| 4782 | gchar* _tmp44_; |
| 4783 | gchar* _tmp45_; |
| 4784 | gchar* _tmp46_; |
| 4785 | gchar* _tmp47_; |
| 4786 | _tmp43_ = length_ctype; |
| 4787 | _tmp44_ = bala_get_ccode_name ((BalaCodeNode*) f); |
| 4788 | _tmp45_ = _tmp44_; |
| 4789 | _tmp46_ = bala_ccode_base_module_get_array_size_cname (self, _tmp45_); |
| 4790 | _tmp47_ = _tmp46_; |
| 4791 | bala_ccode_struct_add_field (ccode_struct, _tmp43_, _tmp47_, 0, NULL((void*)0)); |
| 4792 | _g_free0 (_tmp47_)(_tmp47_ = (g_free (_tmp47_), ((void*)0))); |
| 4793 | _g_free0 (_tmp45_)(_tmp45_ = (g_free (_tmp45_), ((void*)0))); |
| 4794 | } |
| 4795 | _g_free0 (length_ctype)(length_ctype = (g_free (length_ctype), ((void*)0))); |
| 4796 | } |
| 4797 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 4798 | } else { |
| 4799 | if (bala_get_ccode_delegate_target ((BalaCodeNode*) f)) { |
| 4800 | BalaDelegateType* delegate_type = NULL((void*)0); |
| 4801 | BalaDataType* _tmp48_; |
| 4802 | BalaDataType* _tmp49_; |
| 4803 | BalaDelegateType* _tmp50_; |
| 4804 | BalaDelegateType* _tmp51_; |
| 4805 | BalaDelegate* _tmp52_; |
| 4806 | BalaDelegate* _tmp53_; |
| 4807 | gboolean _tmp54_; |
| 4808 | gboolean _tmp55_; |
| 4809 | _tmp48_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 4810 | _tmp49_ = _tmp48_; |
| 4811 | _tmp50_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp49_), ((bala_delegate_type_get_type ())))))); |
| 4812 | delegate_type = _tmp50_; |
| 4813 | _tmp51_ = delegate_type; |
| 4814 | _tmp52_ = bala_delegate_type_get_delegate_symbol (_tmp51_); |
| 4815 | _tmp53_ = _tmp52_; |
| 4816 | _tmp54_ = bala_delegate_get_has_target (_tmp53_); |
| 4817 | _tmp55_ = _tmp54_; |
| 4818 | if (_tmp55_) { |
| 4819 | BalaDataType* _tmp56_; |
| 4820 | gchar* _tmp57_; |
| 4821 | gchar* _tmp58_; |
| 4822 | gchar* _tmp59_; |
| 4823 | gchar* _tmp60_; |
| 4824 | BalaDelegateType* _tmp61_; |
| 4825 | _tmp56_ = self->delegate_target_type; |
| 4826 | _tmp57_ = bala_get_ccode_name ((BalaCodeNode*) _tmp56_); |
| 4827 | _tmp58_ = _tmp57_; |
| 4828 | _tmp59_ = bala_get_ccode_delegate_target_name ((BalaVariable*) f); |
| 4829 | _tmp60_ = _tmp59_; |
| 4830 | bala_ccode_struct_add_field (ccode_struct, _tmp58_, _tmp60_, 0, NULL((void*)0)); |
| 4831 | _g_free0 (_tmp60_)(_tmp60_ = (g_free (_tmp60_), ((void*)0))); |
| 4832 | _g_free0 (_tmp58_)(_tmp58_ = (g_free (_tmp58_), ((void*)0))); |
| 4833 | _tmp61_ = delegate_type; |
| 4834 | if (bala_data_type_is_disposable ((BalaDataType*) _tmp61_)) { |
| 4835 | BalaDelegateType* _tmp62_; |
| 4836 | gchar* _tmp63_; |
| 4837 | gchar* _tmp64_; |
| 4838 | gchar* _tmp65_; |
| 4839 | gchar* _tmp66_; |
| 4840 | _tmp62_ = self->delegate_target_destroy_type; |
| 4841 | _tmp63_ = bala_get_ccode_name ((BalaCodeNode*) _tmp62_); |
| 4842 | _tmp64_ = _tmp63_; |
| 4843 | _tmp65_ = bala_get_ccode_delegate_target_destroy_notify_name ((BalaVariable*) f); |
| 4844 | _tmp66_ = _tmp65_; |
| 4845 | bala_ccode_struct_add_field (ccode_struct, _tmp64_, _tmp66_, 0, NULL((void*)0)); |
| 4846 | _g_free0 (_tmp66_)(_tmp66_ = (g_free (_tmp66_), ((void*)0))); |
| 4847 | _g_free0 (_tmp64_)(_tmp64_ = (g_free (_tmp64_), ((void*)0))); |
| 4848 | } |
| 4849 | } |
| 4850 | _bala_code_node_unref0 (delegate_type)((delegate_type == ((void*)0)) ? ((void*)0) : (delegate_type = (bala_code_node_unref (delegate_type), ((void*)0)))); |
| 4851 | } |
| 4852 | } |
| 4853 | } |
| 4854 | |
| 4855 | void |
| 4856 | bala_ccode_base_module_generate_field_declaration (BalaCCodeBaseModule* self, |
| 4857 | BalaField* f, |
| 4858 | BalaCCodeFile* decl_space) |
| 4859 | { |
| 4860 | gchar* _tmp0_; |
| 4861 | gchar* _tmp1_; |
| 4862 | gboolean _tmp2_; |
| 4863 | BalaDataType* _tmp3_; |
| 4864 | BalaDataType* _tmp4_; |
| 4865 | BalaCCodeDeclaration* _cdecl_ = NULL((void*)0); |
| 4866 | BalaDataType* _tmp5_; |
| 4867 | BalaDataType* _tmp6_; |
| 4868 | gchar* _tmp7_; |
| 4869 | gchar* _tmp8_; |
| 4870 | BalaCCodeDeclaration* _tmp9_; |
| 4871 | BalaCCodeDeclaration* _tmp10_; |
| 4872 | BalaCCodeDeclaration* _tmp11_; |
| 4873 | gchar* _tmp12_; |
| 4874 | gchar* _tmp13_; |
| 4875 | BalaDataType* _tmp14_; |
| 4876 | BalaDataType* _tmp15_; |
| 4877 | BalaCCodeDeclaratorSuffix* _tmp16_; |
| 4878 | BalaCCodeDeclaratorSuffix* _tmp17_; |
| 4879 | BalaCCodeVariableDeclarator* _tmp18_; |
| 4880 | BalaCCodeVariableDeclarator* _tmp19_; |
| 4881 | BalaVersionAttribute* _tmp22_; |
| 4882 | BalaVersionAttribute* _tmp23_; |
| 4883 | gboolean _tmp24_; |
| 4884 | gboolean _tmp25_; |
| 4885 | gboolean _tmp30_; |
| 4886 | gboolean _tmp31_; |
| 4887 | BalaCCodeDeclaration* _tmp36_; |
| 4888 | gboolean _tmp37_; |
| 4889 | gboolean _tmp38_; |
| 4890 | gboolean _tmp68_ = FALSE(0); |
| 4891 | BalaDataType* _tmp69_; |
| 4892 | BalaDataType* _tmp70_; |
| 4893 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 4894 | g_return_if_fail (f != NULL)do { if ((f != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "f != NULL"); return ; } } while (0); |
| 4895 | g_return_if_fail (decl_space != NULL)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return; } } while (0); |
| 4896 | _tmp0_ = bala_get_ccode_name ((BalaCodeNode*) f); |
| 4897 | _tmp1_ = _tmp0_; |
| 4898 | _tmp2_ = bala_ccode_base_module_add_symbol_declaration (self, decl_space, (BalaSymbol*) f, _tmp1_); |
| 4899 | _g_free0 (_tmp1_)(_tmp1_ = (g_free (_tmp1_), ((void*)0))); |
| 4900 | if (_tmp2_) { |
| 4901 | return; |
| 4902 | } |
| 4903 | _tmp3_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 4904 | _tmp4_ = _tmp3_; |
| 4905 | bala_ccode_base_module_generate_type_declaration (self, _tmp4_, decl_space); |
| 4906 | _tmp5_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 4907 | _tmp6_ = _tmp5_; |
| 4908 | _tmp7_ = bala_get_ccode_name ((BalaCodeNode*) _tmp6_); |
| 4909 | _tmp8_ = _tmp7_; |
| 4910 | _tmp9_ = bala_ccode_declaration_new (_tmp8_); |
| 4911 | _tmp10_ = _tmp9_; |
| 4912 | _g_free0 (_tmp8_)(_tmp8_ = (g_free (_tmp8_), ((void*)0))); |
| 4913 | _cdecl_ = _tmp10_; |
| 4914 | _tmp11_ = _cdecl_; |
| 4915 | _tmp12_ = bala_get_ccode_name ((BalaCodeNode*) f); |
| 4916 | _tmp13_ = _tmp12_; |
| 4917 | _tmp14_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 4918 | _tmp15_ = _tmp14_; |
| 4919 | _tmp16_ = bala_ccode_base_module_get_ccode_declarator_suffix (self, _tmp15_); |
| 4920 | _tmp17_ = _tmp16_; |
| 4921 | _tmp18_ = bala_ccode_variable_declarator_new (_tmp13_, NULL((void*)0), _tmp17_); |
| 4922 | _tmp19_ = _tmp18_; |
| 4923 | bala_ccode_declaration_add_declarator (_tmp11_, (BalaCCodeDeclarator*) _tmp19_); |
| 4924 | _bala_ccode_node_unref0 (_tmp19_)((_tmp19_ == ((void*)0)) ? ((void*)0) : (_tmp19_ = (bala_ccode_node_unref (_tmp19_), ((void*)0)))); |
| 4925 | _bala_ccode_declarator_suffix_unref0 (_tmp17_)((_tmp17_ == ((void*)0)) ? ((void*)0) : (_tmp17_ = (bala_ccode_declarator_suffix_unref (_tmp17_), ((void*)0)))); |
| 4926 | _g_free0 (_tmp13_)(_tmp13_ = (g_free (_tmp13_), ((void*)0))); |
| 4927 | if (bala_symbol_is_private_symbol ((BalaSymbol*) f)) { |
| 4928 | BalaCCodeDeclaration* _tmp20_; |
| 4929 | _tmp20_ = _cdecl_; |
| 4930 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp20_, BALA_CCODE_MODIFIERS_STATIC); |
| 4931 | } else { |
| 4932 | BalaCCodeDeclaration* _tmp21_; |
| 4933 | _tmp21_ = _cdecl_; |
| 4934 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp21_, BALA_CCODE_MODIFIERS_EXTERN); |
| 4935 | } |
| 4936 | _tmp22_ = bala_symbol_get_version ((BalaSymbol*) f); |
| 4937 | _tmp23_ = _tmp22_; |
| 4938 | _tmp24_ = bala_version_attribute_get_deprecated (_tmp23_); |
| 4939 | _tmp25_ = _tmp24_; |
| 4940 | if (_tmp25_) { |
| 4941 | BalaCCodeDeclaration* _tmp26_; |
| 4942 | BalaCCodeDeclaration* _tmp27_; |
| 4943 | BalaCCodeModifiers _tmp28_; |
| 4944 | BalaCCodeModifiers _tmp29_; |
| 4945 | _tmp26_ = _cdecl_; |
| 4946 | _tmp27_ = _cdecl_; |
| 4947 | _tmp28_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp27_); |
| 4948 | _tmp29_ = _tmp28_; |
| 4949 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp27_, _tmp29_ | BALA_CCODE_MODIFIERS_DEPRECATED); |
| 4950 | } |
| 4951 | _tmp30_ = bala_field_get_is_volatile (f); |
| 4952 | _tmp31_ = _tmp30_; |
| 4953 | if (_tmp31_) { |
| 4954 | BalaCCodeDeclaration* _tmp32_; |
| 4955 | BalaCCodeDeclaration* _tmp33_; |
| 4956 | BalaCCodeModifiers _tmp34_; |
| 4957 | BalaCCodeModifiers _tmp35_; |
| 4958 | _tmp32_ = _cdecl_; |
| 4959 | _tmp33_ = _cdecl_; |
| 4960 | _tmp34_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp33_); |
| 4961 | _tmp35_ = _tmp34_; |
| 4962 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp33_, _tmp35_ | BALA_CCODE_MODIFIERS_VOLATILE); |
| 4963 | } |
| 4964 | _tmp36_ = _cdecl_; |
| 4965 | bala_ccode_file_add_type_member_declaration (decl_space, (BalaCCodeNode*) _tmp36_); |
| 4966 | _tmp37_ = bala_lockable_get_lock_used ((BalaLockable*) f); |
| 4967 | _tmp38_ = _tmp37_; |
| 4968 | if (_tmp38_) { |
| 4969 | BalaCCodeDeclaration* flock = NULL((void*)0); |
| 4970 | BalaStruct* _tmp39_; |
| 4971 | gchar* _tmp40_; |
| 4972 | gchar* _tmp41_; |
| 4973 | BalaCCodeDeclaration* _tmp42_; |
| 4974 | BalaCCodeDeclaration* _tmp43_; |
| 4975 | BalaCCodeVariableDeclarator* flock_decl = NULL((void*)0); |
| 4976 | BalaSymbol* _tmp44_; |
| 4977 | BalaSymbol* _tmp45_; |
| 4978 | gchar* _tmp46_; |
| 4979 | gchar* _tmp47_; |
| 4980 | gchar* _tmp48_; |
| 4981 | gchar* _tmp49_; |
| 4982 | gchar* _tmp50_; |
| 4983 | gchar* _tmp51_; |
| 4984 | gchar* _tmp52_; |
| 4985 | gchar* _tmp53_; |
| 4986 | BalaCCodeConstant* _tmp54_; |
| 4987 | BalaCCodeConstant* _tmp55_; |
| 4988 | BalaCCodeVariableDeclarator* _tmp56_; |
| 4989 | BalaCCodeVariableDeclarator* _tmp57_; |
| 4990 | BalaCCodeDeclaration* _tmp58_; |
| 4991 | BalaCCodeVariableDeclarator* _tmp59_; |
| 4992 | BalaCCodeDeclaration* _tmp67_; |
| 4993 | _tmp39_ = self->mutex_type; |
| 4994 | _tmp40_ = bala_get_ccode_name ((BalaCodeNode*) _tmp39_); |
| 4995 | _tmp41_ = _tmp40_; |
| 4996 | _tmp42_ = bala_ccode_declaration_new (_tmp41_); |
| 4997 | _tmp43_ = _tmp42_; |
| 4998 | _g_free0 (_tmp41_)(_tmp41_ = (g_free (_tmp41_), ((void*)0))); |
| 4999 | flock = _tmp43_; |
| 5000 | _tmp44_ = bala_symbol_get_parent_symbol ((BalaSymbol*) f); |
| 5001 | _tmp45_ = _tmp44_; |
| 5002 | _tmp46_ = bala_get_ccode_lower_case_name ((BalaCodeNode*) _tmp45_, NULL((void*)0)); |
| 5003 | _tmp47_ = _tmp46_; |
| 5004 | _tmp48_ = bala_get_ccode_name ((BalaCodeNode*) f); |
| 5005 | _tmp49_ = _tmp48_; |
| 5006 | _tmp50_ = g_strdup_printf ("%s_%s", _tmp47_, _tmp49_); |
| 5007 | _tmp51_ = _tmp50_; |
| 5008 | _tmp52_ = bala_ccode_base_module_get_symbol_lock_name (self, _tmp51_); |
| 5009 | _tmp53_ = _tmp52_; |
| 5010 | _tmp54_ = bala_ccode_constant_new ("{0}"); |
| 5011 | _tmp55_ = _tmp54_; |
| 5012 | _tmp56_ = bala_ccode_variable_declarator_new (_tmp53_, (BalaCCodeExpression*) _tmp55_, NULL((void*)0)); |
| 5013 | _tmp57_ = _tmp56_; |
| 5014 | _bala_ccode_node_unref0 (_tmp55_)((_tmp55_ == ((void*)0)) ? ((void*)0) : (_tmp55_ = (bala_ccode_node_unref (_tmp55_), ((void*)0)))); |
| 5015 | _g_free0 (_tmp53_)(_tmp53_ = (g_free (_tmp53_), ((void*)0))); |
| 5016 | _g_free0 (_tmp51_)(_tmp51_ = (g_free (_tmp51_), ((void*)0))); |
| 5017 | _g_free0 (_tmp49_)(_tmp49_ = (g_free (_tmp49_), ((void*)0))); |
| 5018 | _g_free0 (_tmp47_)(_tmp47_ = (g_free (_tmp47_), ((void*)0))); |
| 5019 | flock_decl = _tmp57_; |
| 5020 | _tmp58_ = flock; |
| 5021 | _tmp59_ = flock_decl; |
| 5022 | bala_ccode_declaration_add_declarator (_tmp58_, (BalaCCodeDeclarator*) _tmp59_); |
| 5023 | if (bala_symbol_is_private_symbol ((BalaSymbol*) f)) { |
| 5024 | BalaCCodeDeclaration* _tmp60_; |
| 5025 | _tmp60_ = flock; |
| 5026 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp60_, BALA_CCODE_MODIFIERS_STATIC); |
| 5027 | } else { |
| 5028 | gboolean _tmp61_ = FALSE(0); |
| 5029 | BalaCodeContext* _tmp62_; |
| 5030 | gboolean _tmp63_; |
| 5031 | gboolean _tmp64_; |
| 5032 | _tmp62_ = self->priv->_context; |
| 5033 | _tmp63_ = bala_code_context_get_hide_internal (_tmp62_); |
| 5034 | _tmp64_ = _tmp63_; |
| 5035 | if (_tmp64_) { |
| 5036 | _tmp61_ = bala_symbol_is_internal_symbol ((BalaSymbol*) f); |
| 5037 | } else { |
| 5038 | _tmp61_ = FALSE(0); |
| 5039 | } |
| 5040 | if (_tmp61_) { |
| 5041 | BalaCCodeDeclaration* _tmp65_; |
| 5042 | _tmp65_ = flock; |
| 5043 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp65_, BALA_CCODE_MODIFIERS_INTERNAL); |
| 5044 | } else { |
| 5045 | BalaCCodeDeclaration* _tmp66_; |
| 5046 | _tmp66_ = flock; |
| 5047 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp66_, BALA_CCODE_MODIFIERS_EXTERN); |
| 5048 | } |
| 5049 | } |
| 5050 | _tmp67_ = flock; |
| 5051 | bala_ccode_file_add_type_member_declaration (decl_space, (BalaCCodeNode*) _tmp67_); |
| 5052 | _bala_ccode_node_unref0 (flock_decl)((flock_decl == ((void*)0)) ? ((void*)0) : (flock_decl = (bala_ccode_node_unref (flock_decl), ((void*)0)))); |
| 5053 | _bala_ccode_node_unref0 (flock)((flock == ((void*)0)) ? ((void*)0) : (flock = (bala_ccode_node_unref (flock), ((void*)0)))); |
| 5054 | } |
| 5055 | _tmp69_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 5056 | _tmp70_ = _tmp69_; |
| 5057 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp70_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp70_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 5058 | _tmp68_ = bala_get_ccode_array_length ((BalaCodeNode*) f); |
| 5059 | } else { |
| 5060 | _tmp68_ = FALSE(0); |
| 5061 | } |
| 5062 | if (_tmp68_) { |
| 5063 | BalaArrayType* array_type = NULL((void*)0); |
| 5064 | BalaDataType* _tmp71_; |
| 5065 | BalaDataType* _tmp72_; |
| 5066 | BalaArrayType* _tmp73_; |
| 5067 | BalaArrayType* _tmp74_; |
| 5068 | gboolean _tmp75_; |
| 5069 | gboolean _tmp76_; |
| 5070 | _tmp71_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 5071 | _tmp72_ = _tmp71_; |
| 5072 | _tmp73_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp72_), ((bala_array_type_get_type ())))))); |
| 5073 | array_type = _tmp73_; |
| 5074 | _tmp74_ = array_type; |
| 5075 | _tmp75_ = bala_array_type_get_fixed_length (_tmp74_); |
| 5076 | _tmp76_ = _tmp75_; |
| 5077 | if (!_tmp76_) { |
| 5078 | gchar* length_ctype = NULL((void*)0); |
| 5079 | gchar* _tmp77_; |
| 5080 | _tmp77_ = bala_get_ccode_array_length_type ((BalaCodeNode*) f); |
| 5081 | length_ctype = _tmp77_; |
| 5082 | { |
| 5083 | gint dim = 0; |
| 5084 | dim = 1; |
| 5085 | { |
| 5086 | gboolean _tmp78_ = FALSE(0); |
| 5087 | _tmp78_ = TRUE(!(0)); |
| 5088 | while (TRUE(!(0))) { |
| 5089 | BalaArrayType* _tmp80_; |
| 5090 | gint _tmp81_; |
| 5091 | gint _tmp82_; |
| 5092 | const gchar* _tmp83_; |
| 5093 | BalaCCodeDeclaration* _tmp84_; |
| 5094 | BalaCCodeDeclaration* _tmp85_; |
| 5095 | gchar* _tmp86_; |
| 5096 | gchar* _tmp87_; |
| 5097 | BalaCCodeVariableDeclarator* _tmp88_; |
| 5098 | BalaCCodeVariableDeclarator* _tmp89_; |
| 5099 | BalaCCodeDeclaration* _tmp97_; |
| 5100 | if (!_tmp78_) { |
| 5101 | gint _tmp79_; |
| 5102 | _tmp79_ = dim; |
| 5103 | dim = _tmp79_ + 1; |
| 5104 | } |
| 5105 | _tmp78_ = FALSE(0); |
| 5106 | _tmp80_ = array_type; |
| 5107 | _tmp81_ = bala_array_type_get_rank (_tmp80_); |
| 5108 | _tmp82_ = _tmp81_; |
| 5109 | if (!(dim <= _tmp82_)) { |
| 5110 | break; |
| 5111 | } |
| 5112 | _tmp83_ = length_ctype; |
| 5113 | _tmp84_ = bala_ccode_declaration_new (_tmp83_); |
| 5114 | _bala_ccode_node_unref0 (_cdecl_)((_cdecl_ == ((void*)0)) ? ((void*)0) : (_cdecl_ = (bala_ccode_node_unref (_cdecl_), ((void*)0)))); |
| 5115 | _cdecl_ = _tmp84_; |
| 5116 | _tmp85_ = _cdecl_; |
| 5117 | _tmp86_ = bala_ccode_base_module_get_variable_array_length_cname (self, (BalaVariable*) f, dim); |
| 5118 | _tmp87_ = _tmp86_; |
| 5119 | _tmp88_ = bala_ccode_variable_declarator_new (_tmp87_, NULL((void*)0), NULL((void*)0)); |
| 5120 | _tmp89_ = _tmp88_; |
| 5121 | bala_ccode_declaration_add_declarator (_tmp85_, (BalaCCodeDeclarator*) _tmp89_); |
| 5122 | _bala_ccode_node_unref0 (_tmp89_)((_tmp89_ == ((void*)0)) ? ((void*)0) : (_tmp89_ = (bala_ccode_node_unref (_tmp89_), ((void*)0)))); |
| 5123 | _g_free0 (_tmp87_)(_tmp87_ = (g_free (_tmp87_), ((void*)0))); |
| 5124 | if (bala_symbol_is_private_symbol ((BalaSymbol*) f)) { |
| 5125 | BalaCCodeDeclaration* _tmp90_; |
| 5126 | _tmp90_ = _cdecl_; |
| 5127 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp90_, BALA_CCODE_MODIFIERS_STATIC); |
| 5128 | } else { |
| 5129 | gboolean _tmp91_ = FALSE(0); |
| 5130 | BalaCodeContext* _tmp92_; |
| 5131 | gboolean _tmp93_; |
| 5132 | gboolean _tmp94_; |
| 5133 | _tmp92_ = self->priv->_context; |
| 5134 | _tmp93_ = bala_code_context_get_hide_internal (_tmp92_); |
| 5135 | _tmp94_ = _tmp93_; |
| 5136 | if (_tmp94_) { |
| 5137 | _tmp91_ = bala_symbol_is_internal_symbol ((BalaSymbol*) f); |
| 5138 | } else { |
| 5139 | _tmp91_ = FALSE(0); |
| 5140 | } |
| 5141 | if (_tmp91_) { |
| 5142 | BalaCCodeDeclaration* _tmp95_; |
| 5143 | _tmp95_ = _cdecl_; |
| 5144 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp95_, BALA_CCODE_MODIFIERS_INTERNAL); |
| 5145 | } else { |
| 5146 | BalaCCodeDeclaration* _tmp96_; |
| 5147 | _tmp96_ = _cdecl_; |
| 5148 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp96_, BALA_CCODE_MODIFIERS_EXTERN); |
| 5149 | } |
| 5150 | } |
| 5151 | _tmp97_ = _cdecl_; |
| 5152 | bala_ccode_file_add_type_member_declaration (decl_space, (BalaCCodeNode*) _tmp97_); |
| 5153 | } |
| 5154 | } |
| 5155 | } |
| 5156 | _g_free0 (length_ctype)(length_ctype = (g_free (length_ctype), ((void*)0))); |
| 5157 | } |
| 5158 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 5159 | } else { |
| 5160 | if (bala_get_ccode_delegate_target ((BalaCodeNode*) f)) { |
| 5161 | BalaDelegateType* delegate_type = NULL((void*)0); |
| 5162 | BalaDataType* _tmp98_; |
| 5163 | BalaDataType* _tmp99_; |
| 5164 | BalaDelegateType* _tmp100_; |
| 5165 | BalaDelegateType* _tmp101_; |
| 5166 | BalaDelegate* _tmp102_; |
| 5167 | BalaDelegate* _tmp103_; |
| 5168 | gboolean _tmp104_; |
| 5169 | gboolean _tmp105_; |
| 5170 | _tmp98_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 5171 | _tmp99_ = _tmp98_; |
| 5172 | _tmp100_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp99_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp99_), ((bala_delegate_type_get_type ())))))); |
| 5173 | delegate_type = _tmp100_; |
| 5174 | _tmp101_ = delegate_type; |
| 5175 | _tmp102_ = bala_delegate_type_get_delegate_symbol (_tmp101_); |
| 5176 | _tmp103_ = _tmp102_; |
| 5177 | _tmp104_ = bala_delegate_get_has_target (_tmp103_); |
| 5178 | _tmp105_ = _tmp104_; |
| 5179 | if (_tmp105_) { |
| 5180 | BalaDataType* _tmp106_; |
| 5181 | gchar* _tmp107_; |
| 5182 | gchar* _tmp108_; |
| 5183 | BalaCCodeDeclaration* _tmp109_; |
| 5184 | BalaCCodeDeclaration* _tmp110_; |
| 5185 | gchar* _tmp111_; |
| 5186 | gchar* _tmp112_; |
| 5187 | BalaCCodeVariableDeclarator* _tmp113_; |
| 5188 | BalaCCodeVariableDeclarator* _tmp114_; |
| 5189 | BalaCCodeDeclaration* _tmp122_; |
| 5190 | BalaDelegateType* _tmp123_; |
| 5191 | _tmp106_ = self->delegate_target_type; |
| 5192 | _tmp107_ = bala_get_ccode_name ((BalaCodeNode*) _tmp106_); |
| 5193 | _tmp108_ = _tmp107_; |
| 5194 | _tmp109_ = bala_ccode_declaration_new (_tmp108_); |
| 5195 | _bala_ccode_node_unref0 (_cdecl_)((_cdecl_ == ((void*)0)) ? ((void*)0) : (_cdecl_ = (bala_ccode_node_unref (_cdecl_), ((void*)0)))); |
| 5196 | _cdecl_ = _tmp109_; |
| 5197 | _g_free0 (_tmp108_)(_tmp108_ = (g_free (_tmp108_), ((void*)0))); |
| 5198 | _tmp110_ = _cdecl_; |
| 5199 | _tmp111_ = bala_get_ccode_delegate_target_name ((BalaVariable*) f); |
| 5200 | _tmp112_ = _tmp111_; |
| 5201 | _tmp113_ = bala_ccode_variable_declarator_new (_tmp112_, NULL((void*)0), NULL((void*)0)); |
| 5202 | _tmp114_ = _tmp113_; |
| 5203 | bala_ccode_declaration_add_declarator (_tmp110_, (BalaCCodeDeclarator*) _tmp114_); |
| 5204 | _bala_ccode_node_unref0 (_tmp114_)((_tmp114_ == ((void*)0)) ? ((void*)0) : (_tmp114_ = (bala_ccode_node_unref (_tmp114_), ((void*)0)))); |
| 5205 | _g_free0 (_tmp112_)(_tmp112_ = (g_free (_tmp112_), ((void*)0))); |
| 5206 | if (bala_symbol_is_private_symbol ((BalaSymbol*) f)) { |
| 5207 | BalaCCodeDeclaration* _tmp115_; |
| 5208 | _tmp115_ = _cdecl_; |
| 5209 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp115_, BALA_CCODE_MODIFIERS_STATIC); |
| 5210 | } else { |
| 5211 | gboolean _tmp116_ = FALSE(0); |
| 5212 | BalaCodeContext* _tmp117_; |
| 5213 | gboolean _tmp118_; |
| 5214 | gboolean _tmp119_; |
| 5215 | _tmp117_ = self->priv->_context; |
| 5216 | _tmp118_ = bala_code_context_get_hide_internal (_tmp117_); |
| 5217 | _tmp119_ = _tmp118_; |
| 5218 | if (_tmp119_) { |
| 5219 | _tmp116_ = bala_symbol_is_internal_symbol ((BalaSymbol*) f); |
| 5220 | } else { |
| 5221 | _tmp116_ = FALSE(0); |
| 5222 | } |
| 5223 | if (_tmp116_) { |
| 5224 | BalaCCodeDeclaration* _tmp120_; |
| 5225 | _tmp120_ = _cdecl_; |
| 5226 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp120_, BALA_CCODE_MODIFIERS_INTERNAL); |
| 5227 | } else { |
| 5228 | BalaCCodeDeclaration* _tmp121_; |
| 5229 | _tmp121_ = _cdecl_; |
| 5230 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp121_, BALA_CCODE_MODIFIERS_EXTERN); |
| 5231 | } |
| 5232 | } |
| 5233 | _tmp122_ = _cdecl_; |
| 5234 | bala_ccode_file_add_type_member_declaration (decl_space, (BalaCCodeNode*) _tmp122_); |
| 5235 | _tmp123_ = delegate_type; |
| 5236 | if (bala_data_type_is_disposable ((BalaDataType*) _tmp123_)) { |
| 5237 | BalaDelegateType* _tmp124_; |
| 5238 | gchar* _tmp125_; |
| 5239 | gchar* _tmp126_; |
| 5240 | BalaCCodeDeclaration* _tmp127_; |
| 5241 | BalaCCodeDeclaration* _tmp128_; |
| 5242 | gchar* _tmp129_; |
| 5243 | gchar* _tmp130_; |
| 5244 | BalaCCodeVariableDeclarator* _tmp131_; |
| 5245 | BalaCCodeVariableDeclarator* _tmp132_; |
| 5246 | BalaCCodeDeclaration* _tmp140_; |
| 5247 | _tmp124_ = self->delegate_target_destroy_type; |
| 5248 | _tmp125_ = bala_get_ccode_name ((BalaCodeNode*) _tmp124_); |
| 5249 | _tmp126_ = _tmp125_; |
| 5250 | _tmp127_ = bala_ccode_declaration_new (_tmp126_); |
| 5251 | _bala_ccode_node_unref0 (_cdecl_)((_cdecl_ == ((void*)0)) ? ((void*)0) : (_cdecl_ = (bala_ccode_node_unref (_cdecl_), ((void*)0)))); |
| 5252 | _cdecl_ = _tmp127_; |
| 5253 | _g_free0 (_tmp126_)(_tmp126_ = (g_free (_tmp126_), ((void*)0))); |
| 5254 | _tmp128_ = _cdecl_; |
| 5255 | _tmp129_ = bala_get_ccode_delegate_target_destroy_notify_name ((BalaVariable*) f); |
| 5256 | _tmp130_ = _tmp129_; |
| 5257 | _tmp131_ = bala_ccode_variable_declarator_new (_tmp130_, NULL((void*)0), NULL((void*)0)); |
| 5258 | _tmp132_ = _tmp131_; |
| 5259 | bala_ccode_declaration_add_declarator (_tmp128_, (BalaCCodeDeclarator*) _tmp132_); |
| 5260 | _bala_ccode_node_unref0 (_tmp132_)((_tmp132_ == ((void*)0)) ? ((void*)0) : (_tmp132_ = (bala_ccode_node_unref (_tmp132_), ((void*)0)))); |
| 5261 | _g_free0 (_tmp130_)(_tmp130_ = (g_free (_tmp130_), ((void*)0))); |
| 5262 | if (bala_symbol_is_private_symbol ((BalaSymbol*) f)) { |
| 5263 | BalaCCodeDeclaration* _tmp133_; |
| 5264 | _tmp133_ = _cdecl_; |
| 5265 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp133_, BALA_CCODE_MODIFIERS_STATIC); |
| 5266 | } else { |
| 5267 | gboolean _tmp134_ = FALSE(0); |
| 5268 | BalaCodeContext* _tmp135_; |
| 5269 | gboolean _tmp136_; |
| 5270 | gboolean _tmp137_; |
| 5271 | _tmp135_ = self->priv->_context; |
| 5272 | _tmp136_ = bala_code_context_get_hide_internal (_tmp135_); |
| 5273 | _tmp137_ = _tmp136_; |
| 5274 | if (_tmp137_) { |
| 5275 | _tmp134_ = bala_symbol_is_internal_symbol ((BalaSymbol*) f); |
| 5276 | } else { |
| 5277 | _tmp134_ = FALSE(0); |
| 5278 | } |
| 5279 | if (_tmp134_) { |
| 5280 | BalaCCodeDeclaration* _tmp138_; |
| 5281 | _tmp138_ = _cdecl_; |
| 5282 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp138_, BALA_CCODE_MODIFIERS_INTERNAL); |
| 5283 | } else { |
| 5284 | BalaCCodeDeclaration* _tmp139_; |
| 5285 | _tmp139_ = _cdecl_; |
| 5286 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp139_, BALA_CCODE_MODIFIERS_EXTERN); |
| 5287 | } |
| 5288 | } |
| 5289 | _tmp140_ = _cdecl_; |
| 5290 | bala_ccode_file_add_type_member_declaration (decl_space, (BalaCCodeNode*) _tmp140_); |
| 5291 | } |
| 5292 | } |
| 5293 | _bala_code_node_unref0 (delegate_type)((delegate_type == ((void*)0)) ? ((void*)0) : (delegate_type = (bala_code_node_unref (delegate_type), ((void*)0)))); |
| 5294 | } |
| 5295 | } |
| 5296 | _bala_ccode_node_unref0 (_cdecl_)((_cdecl_ == ((void*)0)) ? ((void*)0) : (_cdecl_ = (bala_ccode_node_unref (_cdecl_), ((void*)0)))); |
| 5297 | } |
| 5298 | |
| 5299 | static gpointer |
| 5300 | _bala_target_value_ref0 (gpointer self) |
| 5301 | { |
| 5302 | return self ? bala_target_value_ref (self) : NULL((void*)0); |
| 5303 | } |
| 5304 | |
| 5305 | static void |
| 5306 | bala_ccode_base_module_real_visit_field (BalaCodeVisitor* base, |
| 5307 | BalaField* f) |
| 5308 | { |
| 5309 | BalaCCodeBaseModule * self; |
| 5310 | BalaSourceReference* _tmp0_; |
| 5311 | BalaSourceReference* _tmp1_; |
| 5312 | BalaClass* cl = NULL((void*)0); |
| 5313 | BalaSymbol* _tmp2_; |
| 5314 | BalaSymbol* _tmp3_; |
| 5315 | BalaClass* _tmp4_; |
| 5316 | gboolean _tmp5_ = FALSE(0); |
| 5317 | BalaClass* _tmp6_; |
| 5318 | gboolean is_gtypeinstance = FALSE(0); |
| 5319 | BalaCCodeExpression* lhs = NULL((void*)0); |
| 5320 | BalaMemberBinding _tmp10_; |
| 5321 | BalaMemberBinding _tmp11_; |
| 5322 | self = (BalaCCodeBaseModule*) base; |
| 5323 | g_return_if_fail (f != NULL)do { if ((f != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "f != NULL"); return ; } } while (0); |
| 5324 | _tmp0_ = bala_code_node_get_source_reference ((BalaCodeNode*) f); |
| 5325 | _tmp1_ = _tmp0_; |
| 5326 | bala_ccode_base_module_push_line (self, _tmp1_); |
| 5327 | bala_ccode_base_module_visit_member (self, (BalaSymbol*) f); |
| 5328 | _tmp2_ = bala_symbol_get_parent_symbol ((BalaSymbol*) f); |
| 5329 | _tmp3_ = _tmp2_; |
| 5330 | _tmp4_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp3_) : NULL((void*)0)); |
| 5331 | cl = _tmp4_; |
| 5332 | _tmp6_ = cl; |
| 5333 | if (_tmp6_ != NULL((void*)0)) { |
| 5334 | BalaClass* _tmp7_; |
| 5335 | gboolean _tmp8_; |
| 5336 | gboolean _tmp9_; |
| 5337 | _tmp7_ = cl; |
| 5338 | _tmp8_ = bala_class_get_is_compact (_tmp7_); |
| 5339 | _tmp9_ = _tmp8_; |
| 5340 | _tmp5_ = !_tmp9_; |
| 5341 | } else { |
| 5342 | _tmp5_ = FALSE(0); |
| 5343 | } |
| 5344 | is_gtypeinstance = _tmp5_; |
| 5345 | lhs = NULL((void*)0); |
| 5346 | _tmp10_ = bala_field_get_binding (f); |
| 5347 | _tmp11_ = _tmp10_; |
| 5348 | if (_tmp11_ == BALA_MEMBER_BINDING_INSTANCE) { |
| 5349 | gboolean _tmp12_ = FALSE(0); |
| 5350 | BalaExpression* _tmp27_; |
| 5351 | BalaExpression* _tmp28_; |
| 5352 | gboolean _tmp159_ = FALSE(0); |
| 5353 | gboolean _tmp160_ = FALSE(0); |
| 5354 | gboolean _tmp161_ = FALSE(0); |
| 5355 | BalaDataType* _tmp162_; |
| 5356 | BalaDataType* _tmp163_; |
| 5357 | if (is_gtypeinstance) { |
| 5358 | BalaSymbolAccessibility _tmp13_; |
| 5359 | BalaSymbolAccessibility _tmp14_; |
| 5360 | _tmp13_ = bala_symbol_get_access ((BalaSymbol*) f); |
| 5361 | _tmp14_ = _tmp13_; |
| 5362 | _tmp12_ = _tmp14_ == BALA_SYMBOL_ACCESSIBILITY_PRIVATE; |
| 5363 | } else { |
| 5364 | _tmp12_ = FALSE(0); |
| 5365 | } |
| 5366 | if (_tmp12_) { |
| 5367 | BalaCCodeIdentifier* _tmp15_; |
| 5368 | BalaCCodeIdentifier* _tmp16_; |
| 5369 | BalaCCodeMemberAccess* _tmp17_; |
| 5370 | BalaCCodeMemberAccess* _tmp18_; |
| 5371 | gchar* _tmp19_; |
| 5372 | gchar* _tmp20_; |
| 5373 | BalaCCodeMemberAccess* _tmp21_; |
| 5374 | _tmp15_ = bala_ccode_identifier_new ("self"); |
| 5375 | _tmp16_ = _tmp15_; |
| 5376 | _tmp17_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp16_, "priv"); |
| 5377 | _tmp18_ = _tmp17_; |
| 5378 | _tmp19_ = bala_get_ccode_name ((BalaCodeNode*) f); |
| 5379 | _tmp20_ = _tmp19_; |
| 5380 | _tmp21_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp18_, _tmp20_); |
| 5381 | _bala_ccode_node_unref0 (lhs)((lhs == ((void*)0)) ? ((void*)0) : (lhs = (bala_ccode_node_unref (lhs), ((void*)0)))); |
| 5382 | lhs = (BalaCCodeExpression*) _tmp21_; |
| 5383 | _g_free0 (_tmp20_)(_tmp20_ = (g_free (_tmp20_), ((void*)0))); |
| 5384 | _bala_ccode_node_unref0 (_tmp18_)((_tmp18_ == ((void*)0)) ? ((void*)0) : (_tmp18_ = (bala_ccode_node_unref (_tmp18_), ((void*)0)))); |
| 5385 | _bala_ccode_node_unref0 (_tmp16_)((_tmp16_ == ((void*)0)) ? ((void*)0) : (_tmp16_ = (bala_ccode_node_unref (_tmp16_), ((void*)0)))); |
| 5386 | } else { |
| 5387 | BalaCCodeIdentifier* _tmp22_; |
| 5388 | BalaCCodeIdentifier* _tmp23_; |
| 5389 | gchar* _tmp24_; |
| 5390 | gchar* _tmp25_; |
| 5391 | BalaCCodeMemberAccess* _tmp26_; |
| 5392 | _tmp22_ = bala_ccode_identifier_new ("self"); |
| 5393 | _tmp23_ = _tmp22_; |
| 5394 | _tmp24_ = bala_get_ccode_name ((BalaCodeNode*) f); |
| 5395 | _tmp25_ = _tmp24_; |
| 5396 | _tmp26_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp23_, _tmp25_); |
| 5397 | _bala_ccode_node_unref0 (lhs)((lhs == ((void*)0)) ? ((void*)0) : (lhs = (bala_ccode_node_unref (lhs), ((void*)0)))); |
| 5398 | lhs = (BalaCCodeExpression*) _tmp26_; |
| 5399 | _g_free0 (_tmp25_)(_tmp25_ = (g_free (_tmp25_), ((void*)0))); |
| 5400 | _bala_ccode_node_unref0 (_tmp23_)((_tmp23_ == ((void*)0)) ? ((void*)0) : (_tmp23_ = (bala_ccode_node_unref (_tmp23_), ((void*)0)))); |
| 5401 | } |
| 5402 | _tmp27_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 5403 | _tmp28_ = _tmp27_; |
| 5404 | if (_tmp28_ != NULL((void*)0)) { |
| 5405 | BalaCCodeBaseModuleEmitContext* _tmp29_; |
| 5406 | BalaExpression* _tmp30_; |
| 5407 | BalaExpression* _tmp31_; |
| 5408 | BalaCCodeExpression* rhs = NULL((void*)0); |
| 5409 | BalaExpression* _tmp32_; |
| 5410 | BalaExpression* _tmp33_; |
| 5411 | BalaCCodeExpression* _tmp34_; |
| 5412 | BalaCCodeExpression* _tmp35_; |
| 5413 | BalaExpression* _tmp36_; |
| 5414 | BalaExpression* _tmp37_; |
| 5415 | BalaArrayList* _tmp157_; |
| 5416 | BalaArrayList* _tmp158_; |
| 5417 | _tmp29_ = self->instance_init_context; |
| 5418 | bala_ccode_base_module_push_context (self, _tmp29_); |
| 5419 | _tmp30_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 5420 | _tmp31_ = _tmp30_; |
| 5421 | bala_code_node_emit ((BalaCodeNode*) _tmp31_, (BalaCodeGenerator*) self); |
| 5422 | _tmp32_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 5423 | _tmp33_ = _tmp32_; |
| 5424 | _tmp34_ = bala_get_cvalue (_tmp33_); |
| 5425 | _tmp35_ = _bala_ccode_node_ref0 (_tmp34_); |
| 5426 | rhs = _tmp35_; |
| 5427 | _tmp36_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 5428 | _tmp37_ = _tmp36_; |
| 5429 | if (!bala_ccode_base_module_is_simple_struct_creation (self, (BalaVariable*) f, _tmp37_)) { |
| 5430 | BalaCCodeFunction* _tmp38_; |
| 5431 | BalaCCodeFunction* _tmp39_; |
| 5432 | BalaCCodeExpression* _tmp40_; |
| 5433 | BalaCCodeExpression* _tmp41_; |
| 5434 | gboolean _tmp42_ = FALSE(0); |
| 5435 | BalaDataType* _tmp43_; |
| 5436 | BalaDataType* _tmp44_; |
| 5437 | _tmp38_ = bala_ccode_base_module_get_ccode (self); |
| 5438 | _tmp39_ = _tmp38_; |
| 5439 | _tmp40_ = lhs; |
| 5440 | _tmp41_ = rhs; |
| 5441 | bala_ccode_function_add_assignment (_tmp39_, _tmp40_, _tmp41_); |
| 5442 | _tmp43_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 5443 | _tmp44_ = _tmp43_; |
| 5444 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp44_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp44_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 5445 | _tmp42_ = bala_get_ccode_array_length ((BalaCodeNode*) f); |
| 5446 | } else { |
| 5447 | _tmp42_ = FALSE(0); |
| 5448 | } |
| 5449 | if (_tmp42_) { |
| 5450 | BalaArrayType* array_type = NULL((void*)0); |
| 5451 | BalaDataType* _tmp45_; |
| 5452 | BalaDataType* _tmp46_; |
| 5453 | BalaArrayType* _tmp47_; |
| 5454 | BalaTargetValue* field_value = NULL((void*)0); |
| 5455 | BalaSymbol* _tmp48_; |
| 5456 | BalaSymbol* _tmp49_; |
| 5457 | BalaTargetValue* _tmp50_; |
| 5458 | BalaTargetValue* _tmp51_; |
| 5459 | BalaTargetValue* _tmp52_; |
| 5460 | BalaTargetValue* _tmp53_; |
| 5461 | BalaGLibValue* glib_value = NULL((void*)0); |
| 5462 | BalaExpression* _tmp54_; |
| 5463 | BalaExpression* _tmp55_; |
| 5464 | BalaTargetValue* _tmp56_; |
| 5465 | BalaTargetValue* _tmp57_; |
| 5466 | BalaGLibValue* _tmp58_; |
| 5467 | BalaGLibValue* _tmp59_; |
| 5468 | BalaList* _tmp60_; |
| 5469 | gboolean _tmp100_ = FALSE(0); |
| 5470 | BalaArrayType* _tmp101_; |
| 5471 | gint _tmp102_; |
| 5472 | gint _tmp103_; |
| 5473 | _tmp45_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 5474 | _tmp46_ = _tmp45_; |
| 5475 | _tmp47_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp46_), ((bala_array_type_get_type ())))))); |
| 5476 | array_type = _tmp47_; |
| 5477 | _tmp48_ = bala_symbol_get_parent_symbol ((BalaSymbol*) f); |
| 5478 | _tmp49_ = _tmp48_; |
| 5479 | _tmp50_ = bala_ccode_base_module_load_this_parameter (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp49_), ((bala_typesymbol_get_type ())))))); |
| 5480 | _tmp51_ = _tmp50_; |
| 5481 | _tmp52_ = bala_ccode_base_module_get_field_cvalue (self, f, _tmp51_); |
| 5482 | _tmp53_ = _tmp52_; |
| 5483 | _bala_target_value_unref0 (_tmp51_)((_tmp51_ == ((void*)0)) ? ((void*)0) : (_tmp51_ = (bala_target_value_unref (_tmp51_), ((void*)0)))); |
| 5484 | field_value = _tmp53_; |
| 5485 | _tmp54_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 5486 | _tmp55_ = _tmp54_; |
| 5487 | _tmp56_ = bala_expression_get_target_value (_tmp55_); |
| 5488 | _tmp57_ = _tmp56_; |
| 5489 | _tmp58_ = _bala_target_value_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp57_), ((bala_glib_value_get_type ())))))); |
| 5490 | glib_value = _tmp58_; |
| 5491 | _tmp59_ = glib_value; |
| 5492 | _tmp60_ = _tmp59_->array_length_cvalues; |
| 5493 | if (_tmp60_ != NULL((void*)0)) { |
| 5494 | { |
| 5495 | gint dim = 0; |
| 5496 | dim = 1; |
| 5497 | { |
| 5498 | gboolean _tmp61_ = FALSE(0); |
| 5499 | _tmp61_ = TRUE(!(0)); |
| 5500 | while (TRUE(!(0))) { |
| 5501 | BalaArrayType* _tmp63_; |
| 5502 | gint _tmp64_; |
| 5503 | gint _tmp65_; |
| 5504 | BalaCCodeExpression* array_len_lhs = NULL((void*)0); |
| 5505 | BalaTargetValue* _tmp66_; |
| 5506 | BalaCCodeExpression* _tmp67_; |
| 5507 | BalaCCodeFunction* _tmp68_; |
| 5508 | BalaCCodeFunction* _tmp69_; |
| 5509 | BalaCCodeExpression* _tmp70_; |
| 5510 | BalaGLibValue* _tmp71_; |
| 5511 | BalaCCodeExpression* _tmp72_; |
| 5512 | BalaCCodeExpression* _tmp73_; |
| 5513 | if (!_tmp61_) { |
| 5514 | gint _tmp62_; |
| 5515 | _tmp62_ = dim; |
| 5516 | dim = _tmp62_ + 1; |
| 5517 | } |
| 5518 | _tmp61_ = FALSE(0); |
| 5519 | _tmp63_ = array_type; |
| 5520 | _tmp64_ = bala_array_type_get_rank (_tmp63_); |
| 5521 | _tmp65_ = _tmp64_; |
| 5522 | if (!(dim <= _tmp65_)) { |
| 5523 | break; |
| 5524 | } |
| 5525 | _tmp66_ = field_value; |
| 5526 | _tmp67_ = bala_ccode_base_module_get_array_length_cvalue (self, _tmp66_, dim); |
| 5527 | array_len_lhs = _tmp67_; |
| 5528 | _tmp68_ = bala_ccode_base_module_get_ccode (self); |
| 5529 | _tmp69_ = _tmp68_; |
| 5530 | _tmp70_ = array_len_lhs; |
| 5531 | _tmp71_ = glib_value; |
| 5532 | _tmp72_ = bala_ccode_base_module_get_array_length_cvalue (self, (BalaTargetValue*) _tmp71_, dim); |
| 5533 | _tmp73_ = _tmp72_; |
| 5534 | bala_ccode_function_add_assignment (_tmp69_, _tmp70_, _tmp73_); |
| 5535 | _bala_ccode_node_unref0 (_tmp73_)((_tmp73_ == ((void*)0)) ? ((void*)0) : (_tmp73_ = (bala_ccode_node_unref (_tmp73_), ((void*)0)))); |
| 5536 | _bala_ccode_node_unref0 (array_len_lhs)((array_len_lhs == ((void*)0)) ? ((void*)0) : (array_len_lhs = (bala_ccode_node_unref (array_len_lhs), ((void*)0)))); |
| 5537 | } |
| 5538 | } |
| 5539 | } |
| 5540 | } else { |
| 5541 | BalaGLibValue* _tmp74_; |
| 5542 | _tmp74_ = glib_value; |
| 5543 | if (_tmp74_->array_null_terminated) { |
| 5544 | BalaCCodeFunctionCall* len_call = NULL((void*)0); |
| 5545 | BalaCCodeIdentifier* _tmp75_; |
| 5546 | BalaCCodeIdentifier* _tmp76_; |
| 5547 | BalaCCodeFunctionCall* _tmp77_; |
| 5548 | BalaCCodeFunctionCall* _tmp78_; |
| 5549 | BalaCCodeFunctionCall* _tmp79_; |
| 5550 | BalaGLibValue* _tmp80_; |
| 5551 | BalaCCodeExpression* _tmp81_; |
| 5552 | BalaCCodeFunction* _tmp82_; |
| 5553 | BalaCCodeFunction* _tmp83_; |
| 5554 | BalaTargetValue* _tmp84_; |
| 5555 | BalaCCodeExpression* _tmp85_; |
| 5556 | BalaCCodeExpression* _tmp86_; |
| 5557 | BalaCCodeFunctionCall* _tmp87_; |
| 5558 | self->requires_array_length = TRUE(!(0)); |
| 5559 | _tmp75_ = bala_ccode_identifier_new ("_bala_array_length"); |
| 5560 | _tmp76_ = _tmp75_; |
| 5561 | _tmp77_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp76_); |
| 5562 | _tmp78_ = _tmp77_; |
| 5563 | _bala_ccode_node_unref0 (_tmp76_)((_tmp76_ == ((void*)0)) ? ((void*)0) : (_tmp76_ = (bala_ccode_node_unref (_tmp76_), ((void*)0)))); |
| 5564 | len_call = _tmp78_; |
| 5565 | _tmp79_ = len_call; |
| 5566 | _tmp80_ = glib_value; |
| 5567 | _tmp81_ = bala_get_cvalue_ ((BalaTargetValue*) _tmp80_); |
| 5568 | bala_ccode_function_call_add_argument (_tmp79_, _tmp81_); |
| 5569 | _tmp82_ = bala_ccode_base_module_get_ccode (self); |
| 5570 | _tmp83_ = _tmp82_; |
| 5571 | _tmp84_ = field_value; |
| 5572 | _tmp85_ = bala_ccode_base_module_get_array_length_cvalue (self, _tmp84_, 1); |
| 5573 | _tmp86_ = _tmp85_; |
| 5574 | _tmp87_ = len_call; |
| 5575 | bala_ccode_function_add_assignment (_tmp83_, _tmp86_, (BalaCCodeExpression*) _tmp87_); |
| 5576 | _bala_ccode_node_unref0 (_tmp86_)((_tmp86_ == ((void*)0)) ? ((void*)0) : (_tmp86_ = (bala_ccode_node_unref (_tmp86_), ((void*)0)))); |
| 5577 | _bala_ccode_node_unref0 (len_call)((len_call == ((void*)0)) ? ((void*)0) : (len_call = (bala_ccode_node_unref (len_call), ((void*)0)))); |
| 5578 | } else { |
| 5579 | { |
| 5580 | gint dim = 0; |
| 5581 | dim = 1; |
| 5582 | { |
| 5583 | gboolean _tmp88_ = FALSE(0); |
| 5584 | _tmp88_ = TRUE(!(0)); |
| 5585 | while (TRUE(!(0))) { |
| 5586 | BalaArrayType* _tmp90_; |
| 5587 | gint _tmp91_; |
| 5588 | gint _tmp92_; |
| 5589 | BalaCCodeFunction* _tmp93_; |
| 5590 | BalaCCodeFunction* _tmp94_; |
| 5591 | BalaTargetValue* _tmp95_; |
| 5592 | BalaCCodeExpression* _tmp96_; |
| 5593 | BalaCCodeExpression* _tmp97_; |
| 5594 | BalaCCodeConstant* _tmp98_; |
| 5595 | BalaCCodeConstant* _tmp99_; |
| 5596 | if (!_tmp88_) { |
| 5597 | gint _tmp89_; |
| 5598 | _tmp89_ = dim; |
| 5599 | dim = _tmp89_ + 1; |
| 5600 | } |
| 5601 | _tmp88_ = FALSE(0); |
| 5602 | _tmp90_ = array_type; |
| 5603 | _tmp91_ = bala_array_type_get_rank (_tmp90_); |
| 5604 | _tmp92_ = _tmp91_; |
| 5605 | if (!(dim <= _tmp92_)) { |
| 5606 | break; |
| 5607 | } |
| 5608 | _tmp93_ = bala_ccode_base_module_get_ccode (self); |
| 5609 | _tmp94_ = _tmp93_; |
| 5610 | _tmp95_ = field_value; |
| 5611 | _tmp96_ = bala_ccode_base_module_get_array_length_cvalue (self, _tmp95_, dim); |
| 5612 | _tmp97_ = _tmp96_; |
| 5613 | _tmp98_ = bala_ccode_constant_new ("-1"); |
| 5614 | _tmp99_ = _tmp98_; |
| 5615 | bala_ccode_function_add_assignment (_tmp94_, _tmp97_, (BalaCCodeExpression*) _tmp99_); |
| 5616 | _bala_ccode_node_unref0 (_tmp99_)((_tmp99_ == ((void*)0)) ? ((void*)0) : (_tmp99_ = (bala_ccode_node_unref (_tmp99_), ((void*)0)))); |
| 5617 | _bala_ccode_node_unref0 (_tmp97_)((_tmp97_ == ((void*)0)) ? ((void*)0) : (_tmp97_ = (bala_ccode_node_unref (_tmp97_), ((void*)0)))); |
| 5618 | } |
| 5619 | } |
| 5620 | } |
| 5621 | } |
| 5622 | } |
| 5623 | _tmp101_ = array_type; |
| 5624 | _tmp102_ = bala_array_type_get_rank (_tmp101_); |
| 5625 | _tmp103_ = _tmp102_; |
| 5626 | if (_tmp103_ == 1) { |
| 5627 | _tmp100_ = bala_symbol_is_internal_symbol ((BalaSymbol*) f); |
| 5628 | } else { |
| 5629 | _tmp100_ = FALSE(0); |
| 5630 | } |
| 5631 | if (_tmp100_) { |
| 5632 | BalaCCodeExpression* lhs_array_size = NULL((void*)0); |
| 5633 | BalaTargetValue* _tmp104_; |
| 5634 | BalaCCodeExpression* _tmp105_; |
| 5635 | BalaCCodeExpression* _tmp106_; |
| 5636 | BalaCCodeExpression* rhs_array_len = NULL((void*)0); |
| 5637 | BalaTargetValue* _tmp107_; |
| 5638 | BalaCCodeExpression* _tmp108_; |
| 5639 | BalaCCodeFunction* _tmp109_; |
| 5640 | BalaCCodeFunction* _tmp110_; |
| 5641 | BalaCCodeExpression* _tmp111_; |
| 5642 | BalaCCodeExpression* _tmp112_; |
| 5643 | _tmp104_ = field_value; |
| 5644 | _tmp105_ = bala_get_array_size_cvalue (_tmp104_); |
| 5645 | _tmp106_ = _bala_ccode_node_ref0 (_tmp105_); |
| 5646 | lhs_array_size = _tmp106_; |
| 5647 | _tmp107_ = field_value; |
| 5648 | _tmp108_ = bala_ccode_base_module_get_array_length_cvalue (self, _tmp107_, 1); |
| 5649 | rhs_array_len = _tmp108_; |
| 5650 | _tmp109_ = bala_ccode_base_module_get_ccode (self); |
| 5651 | _tmp110_ = _tmp109_; |
| 5652 | _tmp111_ = lhs_array_size; |
| 5653 | _tmp112_ = rhs_array_len; |
| 5654 | bala_ccode_function_add_assignment (_tmp110_, _tmp111_, _tmp112_); |
| 5655 | _bala_ccode_node_unref0 (rhs_array_len)((rhs_array_len == ((void*)0)) ? ((void*)0) : (rhs_array_len = (bala_ccode_node_unref (rhs_array_len), ((void*)0)))); |
| 5656 | _bala_ccode_node_unref0 (lhs_array_size)((lhs_array_size == ((void*)0)) ? ((void*)0) : (lhs_array_size = (bala_ccode_node_unref (lhs_array_size), ((void*)0)))); |
| 5657 | } |
| 5658 | _bala_target_value_unref0 (glib_value)((glib_value == ((void*)0)) ? ((void*)0) : (glib_value = (bala_target_value_unref (glib_value), ((void*)0)))); |
| 5659 | _bala_target_value_unref0 (field_value)((field_value == ((void*)0)) ? ((void*)0) : (field_value = (bala_target_value_unref (field_value), ((void*)0)))); |
| 5660 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 5661 | } else { |
| 5662 | if (bala_get_ccode_delegate_target ((BalaCodeNode*) f)) { |
| 5663 | BalaDelegateType* delegate_type = NULL((void*)0); |
| 5664 | BalaDataType* _tmp113_; |
| 5665 | BalaDataType* _tmp114_; |
| 5666 | BalaDelegateType* _tmp115_; |
| 5667 | BalaDelegateType* _tmp116_; |
| 5668 | BalaDelegate* _tmp117_; |
| 5669 | BalaDelegate* _tmp118_; |
| 5670 | gboolean _tmp119_; |
| 5671 | gboolean _tmp120_; |
| 5672 | _tmp113_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 5673 | _tmp114_ = _tmp113_; |
| 5674 | _tmp115_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp114_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp114_), ((bala_delegate_type_get_type ())))))); |
| 5675 | delegate_type = _tmp115_; |
| 5676 | _tmp116_ = delegate_type; |
| 5677 | _tmp117_ = bala_delegate_type_get_delegate_symbol (_tmp116_); |
| 5678 | _tmp118_ = _tmp117_; |
| 5679 | _tmp119_ = bala_delegate_get_has_target (_tmp118_); |
| 5680 | _tmp120_ = _tmp119_; |
| 5681 | if (_tmp120_) { |
| 5682 | BalaTargetValue* field_value = NULL((void*)0); |
| 5683 | BalaSymbol* _tmp121_; |
| 5684 | BalaSymbol* _tmp122_; |
| 5685 | BalaTargetValue* _tmp123_; |
| 5686 | BalaTargetValue* _tmp124_; |
| 5687 | BalaTargetValue* _tmp125_; |
| 5688 | BalaTargetValue* _tmp126_; |
| 5689 | BalaCCodeFunction* _tmp127_; |
| 5690 | BalaCCodeFunction* _tmp128_; |
| 5691 | BalaTargetValue* _tmp129_; |
| 5692 | BalaCCodeExpression* _tmp130_; |
| 5693 | BalaCCodeExpression* _tmp131_; |
| 5694 | BalaCCodeIdentifier* _tmp132_; |
| 5695 | BalaCCodeIdentifier* _tmp133_; |
| 5696 | BalaDelegateType* _tmp134_; |
| 5697 | _tmp121_ = bala_symbol_get_parent_symbol ((BalaSymbol*) f); |
| 5698 | _tmp122_ = _tmp121_; |
| 5699 | _tmp123_ = bala_ccode_base_module_load_this_parameter (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp122_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp122_), ((bala_typesymbol_get_type ())))))); |
| 5700 | _tmp124_ = _tmp123_; |
| 5701 | _tmp125_ = bala_ccode_base_module_get_field_cvalue (self, f, _tmp124_); |
| 5702 | _tmp126_ = _tmp125_; |
| 5703 | _bala_target_value_unref0 (_tmp124_)((_tmp124_ == ((void*)0)) ? ((void*)0) : (_tmp124_ = (bala_target_value_unref (_tmp124_), ((void*)0)))); |
| 5704 | field_value = _tmp126_; |
| 5705 | _tmp127_ = bala_ccode_base_module_get_ccode (self); |
| 5706 | _tmp128_ = _tmp127_; |
| 5707 | _tmp129_ = field_value; |
| 5708 | _tmp130_ = bala_ccode_base_module_get_delegate_target_cvalue (self, _tmp129_); |
| 5709 | _tmp131_ = _tmp130_; |
| 5710 | _tmp132_ = bala_ccode_identifier_new ("self"); |
| 5711 | _tmp133_ = _tmp132_; |
| 5712 | bala_ccode_function_add_assignment (_tmp128_, _tmp131_, (BalaCCodeExpression*) _tmp133_); |
| 5713 | _bala_ccode_node_unref0 (_tmp133_)((_tmp133_ == ((void*)0)) ? ((void*)0) : (_tmp133_ = (bala_ccode_node_unref (_tmp133_), ((void*)0)))); |
| 5714 | _bala_ccode_node_unref0 (_tmp131_)((_tmp131_ == ((void*)0)) ? ((void*)0) : (_tmp131_ = (bala_ccode_node_unref (_tmp131_), ((void*)0)))); |
| 5715 | _tmp134_ = delegate_type; |
| 5716 | if (bala_data_type_is_disposable ((BalaDataType*) _tmp134_)) { |
| 5717 | BalaCCodeFunction* _tmp135_; |
| 5718 | BalaCCodeFunction* _tmp136_; |
| 5719 | BalaTargetValue* _tmp137_; |
| 5720 | BalaCCodeExpression* _tmp138_; |
| 5721 | BalaCCodeExpression* _tmp139_; |
| 5722 | BalaCCodeConstant* _tmp140_; |
| 5723 | BalaCCodeConstant* _tmp141_; |
| 5724 | _tmp135_ = bala_ccode_base_module_get_ccode (self); |
| 5725 | _tmp136_ = _tmp135_; |
| 5726 | _tmp137_ = field_value; |
| 5727 | _tmp138_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cvalue (self, _tmp137_); |
| 5728 | _tmp139_ = _tmp138_; |
| 5729 | _tmp140_ = bala_ccode_constant_new ("NULL"); |
| 5730 | _tmp141_ = _tmp140_; |
| 5731 | bala_ccode_function_add_assignment (_tmp136_, _tmp139_, (BalaCCodeExpression*) _tmp141_); |
| 5732 | _bala_ccode_node_unref0 (_tmp141_)((_tmp141_ == ((void*)0)) ? ((void*)0) : (_tmp141_ = (bala_ccode_node_unref (_tmp141_), ((void*)0)))); |
| 5733 | _bala_ccode_node_unref0 (_tmp139_)((_tmp139_ == ((void*)0)) ? ((void*)0) : (_tmp139_ = (bala_ccode_node_unref (_tmp139_), ((void*)0)))); |
| 5734 | } |
| 5735 | _bala_target_value_unref0 (field_value)((field_value == ((void*)0)) ? ((void*)0) : (field_value = (bala_target_value_unref (field_value), ((void*)0)))); |
| 5736 | } |
| 5737 | _bala_code_node_unref0 (delegate_type)((delegate_type == ((void*)0)) ? ((void*)0) : (delegate_type = (bala_code_node_unref (delegate_type), ((void*)0)))); |
| 5738 | } |
| 5739 | } |
| 5740 | } |
| 5741 | { |
| 5742 | BalaArrayList* _value_list = NULL((void*)0); |
| 5743 | BalaArrayList* _tmp142_; |
| 5744 | BalaArrayList* _tmp143_; |
| 5745 | BalaArrayList* _tmp144_; |
| 5746 | gint _value_size = 0; |
| 5747 | BalaArrayList* _tmp145_; |
| 5748 | gint _tmp146_; |
| 5749 | gint _tmp147_; |
| 5750 | gint _value_index = 0; |
| 5751 | _tmp142_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 5752 | _tmp143_ = _tmp142_; |
| 5753 | _tmp144_ = _bala_iterable_ref0 (_tmp143_); |
| 5754 | _value_list = _tmp144_; |
| 5755 | _tmp145_ = _value_list; |
| 5756 | _tmp146_ = bala_collection_get_size ((BalaCollection*) _tmp145_); |
| 5757 | _tmp147_ = _tmp146_; |
| 5758 | _value_size = _tmp147_; |
| 5759 | _value_index = -1; |
| 5760 | while (TRUE(!(0))) { |
| 5761 | gint _tmp148_; |
| 5762 | gint _tmp149_; |
| 5763 | BalaTargetValue* value = NULL((void*)0); |
| 5764 | BalaArrayList* _tmp150_; |
| 5765 | gpointer _tmp151_; |
| 5766 | BalaCCodeFunction* _tmp152_; |
| 5767 | BalaCCodeFunction* _tmp153_; |
| 5768 | BalaTargetValue* _tmp154_; |
| 5769 | BalaCCodeExpression* _tmp155_; |
| 5770 | BalaCCodeExpression* _tmp156_; |
| 5771 | _value_index = _value_index + 1; |
| 5772 | _tmp148_ = _value_index; |
| 5773 | _tmp149_ = _value_size; |
| 5774 | if (!(_tmp148_ < _tmp149_)) { |
| 5775 | break; |
| 5776 | } |
| 5777 | _tmp150_ = _value_list; |
| 5778 | _tmp151_ = bala_list_get ((BalaList*) _tmp150_, _value_index); |
| 5779 | value = (BalaTargetValue*) _tmp151_; |
| 5780 | _tmp152_ = bala_ccode_base_module_get_ccode (self); |
| 5781 | _tmp153_ = _tmp152_; |
| 5782 | _tmp154_ = value; |
| 5783 | _tmp155_ = bala_ccode_base_module_destroy_value (self, _tmp154_, FALSE(0)); |
| 5784 | _tmp156_ = _tmp155_; |
| 5785 | bala_ccode_function_add_expression (_tmp153_, _tmp156_); |
| 5786 | _bala_ccode_node_unref0 (_tmp156_)((_tmp156_ == ((void*)0)) ? ((void*)0) : (_tmp156_ = (bala_ccode_node_unref (_tmp156_), ((void*)0)))); |
| 5787 | _bala_target_value_unref0 (value)((value == ((void*)0)) ? ((void*)0) : (value = (bala_target_value_unref (value), ((void*)0)))); |
| 5788 | } |
| 5789 | _bala_iterable_unref0 (_value_list)((_value_list == ((void*)0)) ? ((void*)0) : (_value_list = (bala_iterable_unref (_value_list), ((void*)0)))); |
| 5790 | } |
| 5791 | _tmp157_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 5792 | _tmp158_ = _tmp157_; |
| 5793 | bala_collection_clear ((BalaCollection*) _tmp158_); |
| 5794 | bala_ccode_base_module_pop_context (self); |
| 5795 | _bala_ccode_node_unref0 (rhs)((rhs == ((void*)0)) ? ((void*)0) : (rhs = (bala_ccode_node_unref (rhs), ((void*)0)))); |
| 5796 | } |
| 5797 | _tmp162_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 5798 | _tmp163_ = _tmp162_; |
| 5799 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp163_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp163_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 5800 | _tmp161_ = TRUE(!(0)); |
| 5801 | } else { |
| 5802 | _tmp161_ = bala_get_ccode_delegate_target ((BalaCodeNode*) f); |
| 5803 | } |
| 5804 | if (_tmp161_) { |
| 5805 | BalaDataType* _tmp164_; |
| 5806 | BalaDataType* _tmp165_; |
| 5807 | _tmp164_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 5808 | _tmp165_ = _tmp164_; |
| 5809 | _tmp160_ = bala_ccode_base_module_requires_destroy (_tmp165_); |
| 5810 | } else { |
| 5811 | _tmp160_ = FALSE(0); |
| 5812 | } |
| 5813 | if (_tmp160_) { |
| 5814 | BalaCCodeBaseModuleEmitContext* _tmp166_; |
| 5815 | _tmp166_ = self->instance_finalize_context; |
| 5816 | _tmp159_ = _tmp166_ != NULL((void*)0); |
| 5817 | } else { |
| 5818 | _tmp159_ = FALSE(0); |
| 5819 | } |
| 5820 | if (_tmp159_) { |
| 5821 | BalaCCodeBaseModuleEmitContext* _tmp167_; |
| 5822 | BalaCCodeFunction* _tmp168_; |
| 5823 | BalaCCodeFunction* _tmp169_; |
| 5824 | BalaSymbol* _tmp170_; |
| 5825 | BalaSymbol* _tmp171_; |
| 5826 | BalaTargetValue* _tmp172_; |
| 5827 | BalaTargetValue* _tmp173_; |
| 5828 | BalaCCodeExpression* _tmp174_; |
| 5829 | BalaCCodeExpression* _tmp175_; |
| 5830 | _tmp167_ = self->instance_finalize_context; |
| 5831 | bala_ccode_base_module_push_context (self, _tmp167_); |
| 5832 | _tmp168_ = bala_ccode_base_module_get_ccode (self); |
| 5833 | _tmp169_ = _tmp168_; |
| 5834 | _tmp170_ = bala_symbol_get_parent_symbol ((BalaSymbol*) f); |
| 5835 | _tmp171_ = _tmp170_; |
| 5836 | _tmp172_ = bala_ccode_base_module_load_this_parameter (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp171_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp171_), ((bala_typesymbol_get_type ())))))); |
| 5837 | _tmp173_ = _tmp172_; |
| 5838 | _tmp174_ = bala_ccode_base_module_destroy_field (self, f, _tmp173_); |
| 5839 | _tmp175_ = _tmp174_; |
| 5840 | bala_ccode_function_add_expression (_tmp169_, _tmp175_); |
| 5841 | _bala_ccode_node_unref0 (_tmp175_)((_tmp175_ == ((void*)0)) ? ((void*)0) : (_tmp175_ = (bala_ccode_node_unref (_tmp175_), ((void*)0)))); |
| 5842 | _bala_target_value_unref0 (_tmp173_)((_tmp173_ == ((void*)0)) ? ((void*)0) : (_tmp173_ = (bala_target_value_unref (_tmp173_), ((void*)0)))); |
| 5843 | bala_ccode_base_module_pop_context (self); |
| 5844 | } |
| 5845 | } else { |
| 5846 | BalaMemberBinding _tmp176_; |
| 5847 | BalaMemberBinding _tmp177_; |
| 5848 | _tmp176_ = bala_field_get_binding (f); |
| 5849 | _tmp177_ = _tmp176_; |
| 5850 | if (_tmp177_ == BALA_MEMBER_BINDING_CLASS) { |
| 5851 | BalaSymbolAccessibility _tmp178_; |
| 5852 | BalaSymbolAccessibility _tmp179_; |
| 5853 | BalaExpression* _tmp199_; |
| 5854 | BalaExpression* _tmp200_; |
| 5855 | _tmp178_ = bala_symbol_get_access ((BalaSymbol*) f); |
| 5856 | _tmp179_ = _tmp178_; |
| 5857 | if (_tmp179_ == BALA_SYMBOL_ACCESSIBILITY_PRIVATE) { |
| 5858 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 5859 | BalaClass* _tmp180_; |
| 5860 | gchar* _tmp181_; |
| 5861 | gchar* _tmp182_; |
| 5862 | BalaCCodeIdentifier* _tmp183_; |
| 5863 | BalaCCodeIdentifier* _tmp184_; |
| 5864 | BalaCCodeFunctionCall* _tmp185_; |
| 5865 | BalaCCodeFunctionCall* _tmp186_; |
| 5866 | BalaCCodeFunctionCall* _tmp187_; |
| 5867 | BalaCCodeIdentifier* _tmp188_; |
| 5868 | BalaCCodeIdentifier* _tmp189_; |
| 5869 | BalaCCodeFunctionCall* _tmp190_; |
| 5870 | gchar* _tmp191_; |
| 5871 | gchar* _tmp192_; |
| 5872 | BalaCCodeMemberAccess* _tmp193_; |
| 5873 | _tmp180_ = cl; |
| 5874 | _tmp181_ = bala_get_ccode_class_get_private_function (_tmp180_); |
| 5875 | _tmp182_ = _tmp181_; |
| 5876 | _tmp183_ = bala_ccode_identifier_new (_tmp182_); |
| 5877 | _tmp184_ = _tmp183_; |
| 5878 | _tmp185_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp184_); |
| 5879 | _tmp186_ = _tmp185_; |
| 5880 | _bala_ccode_node_unref0 (_tmp184_)((_tmp184_ == ((void*)0)) ? ((void*)0) : (_tmp184_ = (bala_ccode_node_unref (_tmp184_), ((void*)0)))); |
| 5881 | _g_free0 (_tmp182_)(_tmp182_ = (g_free (_tmp182_), ((void*)0))); |
| 5882 | ccall = _tmp186_; |
| 5883 | _tmp187_ = ccall; |
| 5884 | _tmp188_ = bala_ccode_identifier_new ("klass"); |
| 5885 | _tmp189_ = _tmp188_; |
| 5886 | bala_ccode_function_call_add_argument (_tmp187_, (BalaCCodeExpression*) _tmp189_); |
| 5887 | _bala_ccode_node_unref0 (_tmp189_)((_tmp189_ == ((void*)0)) ? ((void*)0) : (_tmp189_ = (bala_ccode_node_unref (_tmp189_), ((void*)0)))); |
| 5888 | _tmp190_ = ccall; |
| 5889 | _tmp191_ = bala_get_ccode_name ((BalaCodeNode*) f); |
| 5890 | _tmp192_ = _tmp191_; |
| 5891 | _tmp193_ = bala_ccode_member_access_new ((BalaCCodeExpression*) _tmp190_, _tmp192_, TRUE(!(0))); |
| 5892 | _bala_ccode_node_unref0 (lhs)((lhs == ((void*)0)) ? ((void*)0) : (lhs = (bala_ccode_node_unref (lhs), ((void*)0)))); |
| 5893 | lhs = (BalaCCodeExpression*) _tmp193_; |
| 5894 | _g_free0 (_tmp192_)(_tmp192_ = (g_free (_tmp192_), ((void*)0))); |
| 5895 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 5896 | } else { |
| 5897 | BalaCCodeIdentifier* _tmp194_; |
| 5898 | BalaCCodeIdentifier* _tmp195_; |
| 5899 | gchar* _tmp196_; |
| 5900 | gchar* _tmp197_; |
| 5901 | BalaCCodeMemberAccess* _tmp198_; |
| 5902 | _tmp194_ = bala_ccode_identifier_new ("klass"); |
| 5903 | _tmp195_ = _tmp194_; |
| 5904 | _tmp196_ = bala_get_ccode_name ((BalaCodeNode*) f); |
| 5905 | _tmp197_ = _tmp196_; |
| 5906 | _tmp198_ = bala_ccode_member_access_new ((BalaCCodeExpression*) _tmp195_, _tmp197_, TRUE(!(0))); |
| 5907 | _bala_ccode_node_unref0 (lhs)((lhs == ((void*)0)) ? ((void*)0) : (lhs = (bala_ccode_node_unref (lhs), ((void*)0)))); |
| 5908 | lhs = (BalaCCodeExpression*) _tmp198_; |
| 5909 | _g_free0 (_tmp197_)(_tmp197_ = (g_free (_tmp197_), ((void*)0))); |
| 5910 | _bala_ccode_node_unref0 (_tmp195_)((_tmp195_ == ((void*)0)) ? ((void*)0) : (_tmp195_ = (bala_ccode_node_unref (_tmp195_), ((void*)0)))); |
| 5911 | } |
| 5912 | _tmp199_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 5913 | _tmp200_ = _tmp199_; |
| 5914 | if (_tmp200_ != NULL((void*)0)) { |
| 5915 | BalaCCodeBaseModuleEmitContext* _tmp201_; |
| 5916 | BalaExpression* _tmp202_; |
| 5917 | BalaExpression* _tmp203_; |
| 5918 | BalaCCodeExpression* rhs = NULL((void*)0); |
| 5919 | BalaExpression* _tmp204_; |
| 5920 | BalaExpression* _tmp205_; |
| 5921 | BalaCCodeExpression* _tmp206_; |
| 5922 | BalaCCodeExpression* _tmp207_; |
| 5923 | BalaCCodeFunction* _tmp208_; |
| 5924 | BalaCCodeFunction* _tmp209_; |
| 5925 | BalaCCodeExpression* _tmp210_; |
| 5926 | BalaCCodeExpression* _tmp211_; |
| 5927 | BalaArrayList* _tmp227_; |
| 5928 | BalaArrayList* _tmp228_; |
| 5929 | _tmp201_ = self->class_init_context; |
| 5930 | bala_ccode_base_module_push_context (self, _tmp201_); |
| 5931 | _tmp202_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 5932 | _tmp203_ = _tmp202_; |
| 5933 | bala_code_node_emit ((BalaCodeNode*) _tmp203_, (BalaCodeGenerator*) self); |
| 5934 | _tmp204_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 5935 | _tmp205_ = _tmp204_; |
| 5936 | _tmp206_ = bala_get_cvalue (_tmp205_); |
| 5937 | _tmp207_ = _bala_ccode_node_ref0 (_tmp206_); |
| 5938 | rhs = _tmp207_; |
| 5939 | _tmp208_ = bala_ccode_base_module_get_ccode (self); |
| 5940 | _tmp209_ = _tmp208_; |
| 5941 | _tmp210_ = lhs; |
| 5942 | _tmp211_ = rhs; |
| 5943 | bala_ccode_function_add_assignment (_tmp209_, _tmp210_, _tmp211_); |
| 5944 | { |
| 5945 | BalaArrayList* _value_list = NULL((void*)0); |
| 5946 | BalaArrayList* _tmp212_; |
| 5947 | BalaArrayList* _tmp213_; |
| 5948 | BalaArrayList* _tmp214_; |
| 5949 | gint _value_size = 0; |
| 5950 | BalaArrayList* _tmp215_; |
| 5951 | gint _tmp216_; |
| 5952 | gint _tmp217_; |
| 5953 | gint _value_index = 0; |
| 5954 | _tmp212_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 5955 | _tmp213_ = _tmp212_; |
| 5956 | _tmp214_ = _bala_iterable_ref0 (_tmp213_); |
| 5957 | _value_list = _tmp214_; |
| 5958 | _tmp215_ = _value_list; |
| 5959 | _tmp216_ = bala_collection_get_size ((BalaCollection*) _tmp215_); |
| 5960 | _tmp217_ = _tmp216_; |
| 5961 | _value_size = _tmp217_; |
| 5962 | _value_index = -1; |
| 5963 | while (TRUE(!(0))) { |
| 5964 | gint _tmp218_; |
| 5965 | gint _tmp219_; |
| 5966 | BalaTargetValue* value = NULL((void*)0); |
| 5967 | BalaArrayList* _tmp220_; |
| 5968 | gpointer _tmp221_; |
| 5969 | BalaCCodeFunction* _tmp222_; |
| 5970 | BalaCCodeFunction* _tmp223_; |
| 5971 | BalaTargetValue* _tmp224_; |
| 5972 | BalaCCodeExpression* _tmp225_; |
| 5973 | BalaCCodeExpression* _tmp226_; |
| 5974 | _value_index = _value_index + 1; |
| 5975 | _tmp218_ = _value_index; |
| 5976 | _tmp219_ = _value_size; |
| 5977 | if (!(_tmp218_ < _tmp219_)) { |
| 5978 | break; |
| 5979 | } |
| 5980 | _tmp220_ = _value_list; |
| 5981 | _tmp221_ = bala_list_get ((BalaList*) _tmp220_, _value_index); |
| 5982 | value = (BalaTargetValue*) _tmp221_; |
| 5983 | _tmp222_ = bala_ccode_base_module_get_ccode (self); |
| 5984 | _tmp223_ = _tmp222_; |
| 5985 | _tmp224_ = value; |
| 5986 | _tmp225_ = bala_ccode_base_module_destroy_value (self, _tmp224_, FALSE(0)); |
| 5987 | _tmp226_ = _tmp225_; |
| 5988 | bala_ccode_function_add_expression (_tmp223_, _tmp226_); |
| 5989 | _bala_ccode_node_unref0 (_tmp226_)((_tmp226_ == ((void*)0)) ? ((void*)0) : (_tmp226_ = (bala_ccode_node_unref (_tmp226_), ((void*)0)))); |
| 5990 | _bala_target_value_unref0 (value)((value == ((void*)0)) ? ((void*)0) : (value = (bala_target_value_unref (value), ((void*)0)))); |
| 5991 | } |
| 5992 | _bala_iterable_unref0 (_value_list)((_value_list == ((void*)0)) ? ((void*)0) : (_value_list = (bala_iterable_unref (_value_list), ((void*)0)))); |
| 5993 | } |
| 5994 | _tmp227_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 5995 | _tmp228_ = _tmp227_; |
| 5996 | bala_collection_clear ((BalaCollection*) _tmp228_); |
| 5997 | bala_ccode_base_module_pop_context (self); |
| 5998 | _bala_ccode_node_unref0 (rhs)((rhs == ((void*)0)) ? ((void*)0) : (rhs = (bala_ccode_node_unref (rhs), ((void*)0)))); |
| 5999 | } |
| 6000 | } else { |
| 6001 | BalaCCodeFile* _tmp229_; |
| 6002 | gboolean _tmp232_; |
| 6003 | gboolean _tmp233_; |
| 6004 | _tmp229_ = self->cfile; |
| 6005 | bala_ccode_base_module_generate_field_declaration (self, f, _tmp229_); |
| 6006 | if (!bala_symbol_is_internal_symbol ((BalaSymbol*) f)) { |
| 6007 | BalaCCodeFile* _tmp230_; |
| 6008 | _tmp230_ = self->header_file; |
| 6009 | bala_ccode_base_module_generate_field_declaration (self, f, _tmp230_); |
| 6010 | } |
| 6011 | if (!bala_symbol_is_private_symbol ((BalaSymbol*) f)) { |
| 6012 | BalaCCodeFile* _tmp231_; |
| 6013 | _tmp231_ = self->internal_header_file; |
| 6014 | bala_ccode_base_module_generate_field_declaration (self, f, _tmp231_); |
| 6015 | } |
| 6016 | _tmp232_ = bala_symbol_get_external ((BalaSymbol*) f); |
| 6017 | _tmp233_ = _tmp232_; |
| 6018 | if (!_tmp233_) { |
| 6019 | gchar* _tmp234_; |
| 6020 | gchar* _tmp235_; |
| 6021 | BalaCCodeIdentifier* _tmp236_; |
| 6022 | BalaCCodeVariableDeclarator* var_decl = NULL((void*)0); |
| 6023 | gchar* _tmp237_; |
| 6024 | gchar* _tmp238_; |
| 6025 | BalaDataType* _tmp239_; |
| 6026 | BalaDataType* _tmp240_; |
| 6027 | BalaCCodeDeclaratorSuffix* _tmp241_; |
| 6028 | BalaCCodeDeclaratorSuffix* _tmp242_; |
| 6029 | BalaCCodeVariableDeclarator* _tmp243_; |
| 6030 | BalaCCodeVariableDeclarator* _tmp244_; |
| 6031 | BalaCCodeVariableDeclarator* _tmp245_; |
| 6032 | BalaDataType* _tmp246_; |
| 6033 | BalaDataType* _tmp247_; |
| 6034 | BalaCCodeExpression* _tmp248_; |
| 6035 | BalaCCodeExpression* _tmp249_; |
| 6036 | BalaCCodeBaseModuleEmitContext* _tmp250_; |
| 6037 | BalaExpression* _tmp254_; |
| 6038 | BalaExpression* _tmp255_; |
| 6039 | BalaCCodeDeclaration* var_def = NULL((void*)0); |
| 6040 | BalaDataType* _tmp265_; |
| 6041 | BalaDataType* _tmp266_; |
| 6042 | gchar* _tmp267_; |
| 6043 | gchar* _tmp268_; |
| 6044 | BalaCCodeDeclaration* _tmp269_; |
| 6045 | BalaCCodeDeclaration* _tmp270_; |
| 6046 | BalaCCodeDeclaration* _tmp271_; |
| 6047 | BalaCCodeVariableDeclarator* _tmp272_; |
| 6048 | BalaVersionAttribute* _tmp275_; |
| 6049 | BalaVersionAttribute* _tmp276_; |
| 6050 | gboolean _tmp277_; |
| 6051 | gboolean _tmp278_; |
| 6052 | gboolean _tmp283_; |
| 6053 | gboolean _tmp284_; |
| 6054 | BalaCCodeFile* _tmp289_; |
| 6055 | BalaCCodeDeclaration* _tmp290_; |
| 6056 | gboolean _tmp291_ = FALSE(0); |
| 6057 | BalaDataType* _tmp292_; |
| 6058 | BalaDataType* _tmp293_; |
| 6059 | BalaExpression* _tmp378_; |
| 6060 | BalaExpression* _tmp379_; |
| 6061 | _tmp234_ = bala_get_ccode_name ((BalaCodeNode*) f); |
| 6062 | _tmp235_ = _tmp234_; |
| 6063 | _tmp236_ = bala_ccode_identifier_new (_tmp235_); |
| 6064 | _bala_ccode_node_unref0 (lhs)((lhs == ((void*)0)) ? ((void*)0) : (lhs = (bala_ccode_node_unref (lhs), ((void*)0)))); |
| 6065 | lhs = (BalaCCodeExpression*) _tmp236_; |
| 6066 | _g_free0 (_tmp235_)(_tmp235_ = (g_free (_tmp235_), ((void*)0))); |
| 6067 | _tmp237_ = bala_get_ccode_name ((BalaCodeNode*) f); |
| 6068 | _tmp238_ = _tmp237_; |
| 6069 | _tmp239_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 6070 | _tmp240_ = _tmp239_; |
| 6071 | _tmp241_ = bala_ccode_base_module_get_ccode_declarator_suffix (self, _tmp240_); |
| 6072 | _tmp242_ = _tmp241_; |
| 6073 | _tmp243_ = bala_ccode_variable_declarator_new (_tmp238_, NULL((void*)0), _tmp242_); |
| 6074 | _tmp244_ = _tmp243_; |
| 6075 | _bala_ccode_declarator_suffix_unref0 (_tmp242_)((_tmp242_ == ((void*)0)) ? ((void*)0) : (_tmp242_ = (bala_ccode_declarator_suffix_unref (_tmp242_), ((void*)0)))); |
| 6076 | _g_free0 (_tmp238_)(_tmp238_ = (g_free (_tmp238_), ((void*)0))); |
| 6077 | var_decl = _tmp244_; |
| 6078 | _tmp245_ = var_decl; |
| 6079 | _tmp246_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 6080 | _tmp247_ = _tmp246_; |
| 6081 | _tmp248_ = bala_ccode_base_module_default_value_for_type (self, _tmp247_, TRUE(!(0)), FALSE(0)); |
| 6082 | _tmp249_ = _tmp248_; |
| 6083 | bala_ccode_variable_declarator_set_initializer (_tmp245_, _tmp249_); |
| 6084 | _bala_ccode_node_unref0 (_tmp249_)((_tmp249_ == ((void*)0)) ? ((void*)0) : (_tmp249_ = (bala_ccode_node_unref (_tmp249_), ((void*)0)))); |
| 6085 | _tmp250_ = self->class_init_context; |
| 6086 | if (_tmp250_ != NULL((void*)0)) { |
| 6087 | BalaCCodeBaseModuleEmitContext* _tmp251_; |
| 6088 | _tmp251_ = self->class_init_context; |
| 6089 | bala_ccode_base_module_push_context (self, _tmp251_); |
| 6090 | } else { |
| 6091 | BalaCCodeBaseModuleEmitContext* _tmp252_; |
| 6092 | BalaCCodeBaseModuleEmitContext* _tmp253_; |
| 6093 | _tmp252_ = bala_ccode_base_module_emit_context_new (NULL((void*)0)); |
| 6094 | _tmp253_ = _tmp252_; |
| 6095 | bala_ccode_base_module_push_context (self, _tmp253_); |
| 6096 | _bala_ccode_base_module_emit_context_unref0 (_tmp253_)((_tmp253_ == ((void*)0)) ? ((void*)0) : (_tmp253_ = (bala_ccode_base_module_emit_context_unref (_tmp253_), ((void*)0)))); |
| 6097 | } |
| 6098 | _tmp254_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 6099 | _tmp255_ = _tmp254_; |
| 6100 | if (_tmp255_ != NULL((void*)0)) { |
| 6101 | BalaExpression* _tmp256_; |
| 6102 | BalaExpression* _tmp257_; |
| 6103 | BalaCCodeExpression* init = NULL((void*)0); |
| 6104 | BalaExpression* _tmp258_; |
| 6105 | BalaExpression* _tmp259_; |
| 6106 | BalaCCodeExpression* _tmp260_; |
| 6107 | BalaCCodeExpression* _tmp261_; |
| 6108 | BalaCCodeExpression* _tmp262_; |
| 6109 | _tmp256_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 6110 | _tmp257_ = _tmp256_; |
| 6111 | bala_code_node_emit ((BalaCodeNode*) _tmp257_, (BalaCodeGenerator*) self); |
| 6112 | _tmp258_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 6113 | _tmp259_ = _tmp258_; |
| 6114 | _tmp260_ = bala_get_cvalue (_tmp259_); |
| 6115 | _tmp261_ = _bala_ccode_node_ref0 (_tmp260_); |
| 6116 | init = _tmp261_; |
| 6117 | _tmp262_ = init; |
| 6118 | if (bala_ccode_base_module_is_constant_ccode_expression (_tmp262_)) { |
| 6119 | BalaCCodeVariableDeclarator* _tmp263_; |
| 6120 | BalaCCodeExpression* _tmp264_; |
| 6121 | _tmp263_ = var_decl; |
| 6122 | _tmp264_ = init; |
| 6123 | bala_ccode_variable_declarator_set_initializer (_tmp263_, _tmp264_); |
| 6124 | } |
| 6125 | _bala_ccode_node_unref0 (init)((init == ((void*)0)) ? ((void*)0) : (init = (bala_ccode_node_unref (init), ((void*)0)))); |
| 6126 | } |
| 6127 | _tmp265_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 6128 | _tmp266_ = _tmp265_; |
| 6129 | _tmp267_ = bala_get_ccode_name ((BalaCodeNode*) _tmp266_); |
| 6130 | _tmp268_ = _tmp267_; |
| 6131 | _tmp269_ = bala_ccode_declaration_new (_tmp268_); |
| 6132 | _tmp270_ = _tmp269_; |
| 6133 | _g_free0 (_tmp268_)(_tmp268_ = (g_free (_tmp268_), ((void*)0))); |
| 6134 | var_def = _tmp270_; |
| 6135 | _tmp271_ = var_def; |
| 6136 | _tmp272_ = var_decl; |
| 6137 | bala_ccode_declaration_add_declarator (_tmp271_, (BalaCCodeDeclarator*) _tmp272_); |
| 6138 | if (!bala_symbol_is_private_symbol ((BalaSymbol*) f)) { |
| 6139 | BalaCCodeDeclaration* _tmp273_; |
| 6140 | _tmp273_ = var_def; |
| 6141 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp273_, BALA_CCODE_MODIFIERS_EXTERN); |
| 6142 | } else { |
| 6143 | BalaCCodeDeclaration* _tmp274_; |
| 6144 | _tmp274_ = var_def; |
| 6145 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp274_, BALA_CCODE_MODIFIERS_STATIC); |
| 6146 | } |
| 6147 | _tmp275_ = bala_symbol_get_version ((BalaSymbol*) f); |
| 6148 | _tmp276_ = _tmp275_; |
| 6149 | _tmp277_ = bala_version_attribute_get_deprecated (_tmp276_); |
| 6150 | _tmp278_ = _tmp277_; |
| 6151 | if (_tmp278_) { |
| 6152 | BalaCCodeDeclaration* _tmp279_; |
| 6153 | BalaCCodeDeclaration* _tmp280_; |
| 6154 | BalaCCodeModifiers _tmp281_; |
| 6155 | BalaCCodeModifiers _tmp282_; |
| 6156 | _tmp279_ = var_def; |
| 6157 | _tmp280_ = var_def; |
| 6158 | _tmp281_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp280_); |
| 6159 | _tmp282_ = _tmp281_; |
| 6160 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp280_, _tmp282_ | BALA_CCODE_MODIFIERS_DEPRECATED); |
| 6161 | } |
| 6162 | _tmp283_ = bala_field_get_is_volatile (f); |
| 6163 | _tmp284_ = _tmp283_; |
| 6164 | if (_tmp284_) { |
| 6165 | BalaCCodeDeclaration* _tmp285_; |
| 6166 | BalaCCodeDeclaration* _tmp286_; |
| 6167 | BalaCCodeModifiers _tmp287_; |
| 6168 | BalaCCodeModifiers _tmp288_; |
| 6169 | _tmp285_ = var_def; |
| 6170 | _tmp286_ = var_def; |
| 6171 | _tmp287_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp286_); |
| 6172 | _tmp288_ = _tmp287_; |
| 6173 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp286_, _tmp288_ | BALA_CCODE_MODIFIERS_VOLATILE); |
| 6174 | } |
| 6175 | _tmp289_ = self->cfile; |
| 6176 | _tmp290_ = var_def; |
| 6177 | bala_ccode_file_add_type_member_declaration (_tmp289_, (BalaCCodeNode*) _tmp290_); |
| 6178 | _tmp292_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 6179 | _tmp293_ = _tmp292_; |
| 6180 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp293_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp293_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6181 | _tmp291_ = bala_get_ccode_array_length ((BalaCodeNode*) f); |
| 6182 | } else { |
| 6183 | _tmp291_ = FALSE(0); |
| 6184 | } |
| 6185 | if (_tmp291_) { |
| 6186 | BalaArrayType* array_type = NULL((void*)0); |
| 6187 | BalaDataType* _tmp294_; |
| 6188 | BalaDataType* _tmp295_; |
| 6189 | BalaArrayType* _tmp296_; |
| 6190 | BalaArrayType* _tmp297_; |
| 6191 | gboolean _tmp298_; |
| 6192 | gboolean _tmp299_; |
| 6193 | _tmp294_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 6194 | _tmp295_ = _tmp294_; |
| 6195 | _tmp296_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp295_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp295_), ((bala_array_type_get_type ())))))); |
| 6196 | array_type = _tmp296_; |
| 6197 | _tmp297_ = array_type; |
| 6198 | _tmp298_ = bala_array_type_get_fixed_length (_tmp297_); |
| 6199 | _tmp299_ = _tmp298_; |
| 6200 | if (!_tmp299_) { |
| 6201 | gchar* length_ctype = NULL((void*)0); |
| 6202 | gchar* _tmp300_; |
| 6203 | gboolean _tmp319_ = FALSE(0); |
| 6204 | BalaArrayType* _tmp320_; |
| 6205 | gint _tmp321_; |
| 6206 | gint _tmp322_; |
| 6207 | _tmp300_ = bala_get_ccode_array_length_type ((BalaCodeNode*) f); |
| 6208 | length_ctype = _tmp300_; |
| 6209 | { |
| 6210 | gint dim = 0; |
| 6211 | dim = 1; |
| 6212 | { |
| 6213 | gboolean _tmp301_ = FALSE(0); |
| 6214 | _tmp301_ = TRUE(!(0)); |
| 6215 | while (TRUE(!(0))) { |
| 6216 | BalaArrayType* _tmp303_; |
| 6217 | gint _tmp304_; |
| 6218 | gint _tmp305_; |
| 6219 | BalaCCodeDeclaration* len_def = NULL((void*)0); |
| 6220 | const gchar* _tmp306_; |
| 6221 | BalaCCodeDeclaration* _tmp307_; |
| 6222 | BalaCCodeDeclaration* _tmp308_; |
| 6223 | gchar* _tmp309_; |
| 6224 | gchar* _tmp310_; |
| 6225 | BalaCCodeConstant* _tmp311_; |
| 6226 | BalaCCodeConstant* _tmp312_; |
| 6227 | BalaCCodeVariableDeclarator* _tmp313_; |
| 6228 | BalaCCodeVariableDeclarator* _tmp314_; |
| 6229 | BalaCCodeFile* _tmp317_; |
| 6230 | BalaCCodeDeclaration* _tmp318_; |
| 6231 | if (!_tmp301_) { |
| 6232 | gint _tmp302_; |
| 6233 | _tmp302_ = dim; |
| 6234 | dim = _tmp302_ + 1; |
| 6235 | } |
| 6236 | _tmp301_ = FALSE(0); |
| 6237 | _tmp303_ = array_type; |
| 6238 | _tmp304_ = bala_array_type_get_rank (_tmp303_); |
| 6239 | _tmp305_ = _tmp304_; |
| 6240 | if (!(dim <= _tmp305_)) { |
| 6241 | break; |
| 6242 | } |
| 6243 | _tmp306_ = length_ctype; |
| 6244 | _tmp307_ = bala_ccode_declaration_new (_tmp306_); |
| 6245 | len_def = _tmp307_; |
| 6246 | _tmp308_ = len_def; |
| 6247 | _tmp309_ = bala_ccode_base_module_get_variable_array_length_cname (self, (BalaVariable*) f, dim); |
| 6248 | _tmp310_ = _tmp309_; |
| 6249 | _tmp311_ = bala_ccode_constant_new ("0"); |
| 6250 | _tmp312_ = _tmp311_; |
| 6251 | _tmp313_ = bala_ccode_variable_declarator_new (_tmp310_, (BalaCCodeExpression*) _tmp312_, NULL((void*)0)); |
| 6252 | _tmp314_ = _tmp313_; |
| 6253 | bala_ccode_declaration_add_declarator (_tmp308_, (BalaCCodeDeclarator*) _tmp314_); |
| 6254 | _bala_ccode_node_unref0 (_tmp314_)((_tmp314_ == ((void*)0)) ? ((void*)0) : (_tmp314_ = (bala_ccode_node_unref (_tmp314_), ((void*)0)))); |
| 6255 | _bala_ccode_node_unref0 (_tmp312_)((_tmp312_ == ((void*)0)) ? ((void*)0) : (_tmp312_ = (bala_ccode_node_unref (_tmp312_), ((void*)0)))); |
| 6256 | _g_free0 (_tmp310_)(_tmp310_ = (g_free (_tmp310_), ((void*)0))); |
| 6257 | if (!bala_symbol_is_private_symbol ((BalaSymbol*) f)) { |
| 6258 | BalaCCodeDeclaration* _tmp315_; |
| 6259 | _tmp315_ = len_def; |
| 6260 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp315_, BALA_CCODE_MODIFIERS_EXTERN); |
| 6261 | } else { |
| 6262 | BalaCCodeDeclaration* _tmp316_; |
| 6263 | _tmp316_ = len_def; |
| 6264 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp316_, BALA_CCODE_MODIFIERS_STATIC); |
| 6265 | } |
| 6266 | _tmp317_ = self->cfile; |
| 6267 | _tmp318_ = len_def; |
| 6268 | bala_ccode_file_add_type_member_declaration (_tmp317_, (BalaCCodeNode*) _tmp318_); |
| 6269 | _bala_ccode_node_unref0 (len_def)((len_def == ((void*)0)) ? ((void*)0) : (len_def = (bala_ccode_node_unref (len_def), ((void*)0)))); |
| 6270 | } |
| 6271 | } |
| 6272 | } |
| 6273 | _tmp320_ = array_type; |
| 6274 | _tmp321_ = bala_array_type_get_rank (_tmp320_); |
| 6275 | _tmp322_ = _tmp321_; |
| 6276 | if (_tmp322_ == 1) { |
| 6277 | _tmp319_ = bala_symbol_is_internal_symbol ((BalaSymbol*) f); |
| 6278 | } else { |
| 6279 | _tmp319_ = FALSE(0); |
| 6280 | } |
| 6281 | if (_tmp319_) { |
| 6282 | BalaCCodeDeclaration* _cdecl_ = NULL((void*)0); |
| 6283 | const gchar* _tmp323_; |
| 6284 | BalaCCodeDeclaration* _tmp324_; |
| 6285 | BalaCCodeDeclaration* _tmp325_; |
| 6286 | gchar* _tmp326_; |
| 6287 | gchar* _tmp327_; |
| 6288 | gchar* _tmp328_; |
| 6289 | gchar* _tmp329_; |
| 6290 | BalaCCodeConstant* _tmp330_; |
| 6291 | BalaCCodeConstant* _tmp331_; |
| 6292 | BalaCCodeVariableDeclarator* _tmp332_; |
| 6293 | BalaCCodeVariableDeclarator* _tmp333_; |
| 6294 | BalaCCodeDeclaration* _tmp334_; |
| 6295 | BalaCCodeFile* _tmp335_; |
| 6296 | BalaCCodeDeclaration* _tmp336_; |
| 6297 | _tmp323_ = length_ctype; |
| 6298 | _tmp324_ = bala_ccode_declaration_new (_tmp323_); |
| 6299 | _cdecl_ = _tmp324_; |
| 6300 | _tmp325_ = _cdecl_; |
| 6301 | _tmp326_ = bala_get_ccode_name ((BalaCodeNode*) f); |
| 6302 | _tmp327_ = _tmp326_; |
| 6303 | _tmp328_ = bala_ccode_base_module_get_array_size_cname (self, _tmp327_); |
| 6304 | _tmp329_ = _tmp328_; |
| 6305 | _tmp330_ = bala_ccode_constant_new ("0"); |
| 6306 | _tmp331_ = _tmp330_; |
| 6307 | _tmp332_ = bala_ccode_variable_declarator_new (_tmp329_, (BalaCCodeExpression*) _tmp331_, NULL((void*)0)); |
| 6308 | _tmp333_ = _tmp332_; |
| 6309 | bala_ccode_declaration_add_declarator (_tmp325_, (BalaCCodeDeclarator*) _tmp333_); |
| 6310 | _bala_ccode_node_unref0 (_tmp333_)((_tmp333_ == ((void*)0)) ? ((void*)0) : (_tmp333_ = (bala_ccode_node_unref (_tmp333_), ((void*)0)))); |
| 6311 | _bala_ccode_node_unref0 (_tmp331_)((_tmp331_ == ((void*)0)) ? ((void*)0) : (_tmp331_ = (bala_ccode_node_unref (_tmp331_), ((void*)0)))); |
| 6312 | _g_free0 (_tmp329_)(_tmp329_ = (g_free (_tmp329_), ((void*)0))); |
| 6313 | _g_free0 (_tmp327_)(_tmp327_ = (g_free (_tmp327_), ((void*)0))); |
| 6314 | _tmp334_ = _cdecl_; |
| 6315 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp334_, BALA_CCODE_MODIFIERS_STATIC); |
| 6316 | _tmp335_ = self->cfile; |
| 6317 | _tmp336_ = _cdecl_; |
| 6318 | bala_ccode_file_add_type_member_declaration (_tmp335_, (BalaCCodeNode*) _tmp336_); |
| 6319 | _bala_ccode_node_unref0 (_cdecl_)((_cdecl_ == ((void*)0)) ? ((void*)0) : (_cdecl_ = (bala_ccode_node_unref (_cdecl_), ((void*)0)))); |
| 6320 | } |
| 6321 | _g_free0 (length_ctype)(length_ctype = (g_free (length_ctype), ((void*)0))); |
| 6322 | } |
| 6323 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 6324 | } else { |
| 6325 | if (bala_get_ccode_delegate_target ((BalaCodeNode*) f)) { |
| 6326 | BalaDelegateType* delegate_type = NULL((void*)0); |
| 6327 | BalaDataType* _tmp337_; |
| 6328 | BalaDataType* _tmp338_; |
| 6329 | BalaDelegateType* _tmp339_; |
| 6330 | BalaDelegateType* _tmp340_; |
| 6331 | BalaDelegate* _tmp341_; |
| 6332 | BalaDelegate* _tmp342_; |
| 6333 | gboolean _tmp343_; |
| 6334 | gboolean _tmp344_; |
| 6335 | _tmp337_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 6336 | _tmp338_ = _tmp337_; |
| 6337 | _tmp339_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp338_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp338_), ((bala_delegate_type_get_type ())))))); |
| 6338 | delegate_type = _tmp339_; |
| 6339 | _tmp340_ = delegate_type; |
| 6340 | _tmp341_ = bala_delegate_type_get_delegate_symbol (_tmp340_); |
| 6341 | _tmp342_ = _tmp341_; |
| 6342 | _tmp343_ = bala_delegate_get_has_target (_tmp342_); |
| 6343 | _tmp344_ = _tmp343_; |
| 6344 | if (_tmp344_) { |
| 6345 | BalaCCodeDeclaration* target_def = NULL((void*)0); |
| 6346 | BalaDataType* _tmp345_; |
| 6347 | gchar* _tmp346_; |
| 6348 | gchar* _tmp347_; |
| 6349 | BalaCCodeDeclaration* _tmp348_; |
| 6350 | BalaCCodeDeclaration* _tmp349_; |
| 6351 | BalaCCodeDeclaration* _tmp350_; |
| 6352 | gchar* _tmp351_; |
| 6353 | gchar* _tmp352_; |
| 6354 | BalaCCodeConstant* _tmp353_; |
| 6355 | BalaCCodeConstant* _tmp354_; |
| 6356 | BalaCCodeVariableDeclarator* _tmp355_; |
| 6357 | BalaCCodeVariableDeclarator* _tmp356_; |
| 6358 | BalaCCodeFile* _tmp359_; |
| 6359 | BalaCCodeDeclaration* _tmp360_; |
| 6360 | BalaDelegateType* _tmp361_; |
| 6361 | _tmp345_ = self->delegate_target_type; |
| 6362 | _tmp346_ = bala_get_ccode_name ((BalaCodeNode*) _tmp345_); |
| 6363 | _tmp347_ = _tmp346_; |
| 6364 | _tmp348_ = bala_ccode_declaration_new (_tmp347_); |
| 6365 | _tmp349_ = _tmp348_; |
| 6366 | _g_free0 (_tmp347_)(_tmp347_ = (g_free (_tmp347_), ((void*)0))); |
| 6367 | target_def = _tmp349_; |
| 6368 | _tmp350_ = target_def; |
| 6369 | _tmp351_ = bala_get_ccode_delegate_target_name ((BalaVariable*) f); |
| 6370 | _tmp352_ = _tmp351_; |
| 6371 | _tmp353_ = bala_ccode_constant_new ("NULL"); |
| 6372 | _tmp354_ = _tmp353_; |
| 6373 | _tmp355_ = bala_ccode_variable_declarator_new (_tmp352_, (BalaCCodeExpression*) _tmp354_, NULL((void*)0)); |
| 6374 | _tmp356_ = _tmp355_; |
| 6375 | bala_ccode_declaration_add_declarator (_tmp350_, (BalaCCodeDeclarator*) _tmp356_); |
| 6376 | _bala_ccode_node_unref0 (_tmp356_)((_tmp356_ == ((void*)0)) ? ((void*)0) : (_tmp356_ = (bala_ccode_node_unref (_tmp356_), ((void*)0)))); |
| 6377 | _bala_ccode_node_unref0 (_tmp354_)((_tmp354_ == ((void*)0)) ? ((void*)0) : (_tmp354_ = (bala_ccode_node_unref (_tmp354_), ((void*)0)))); |
| 6378 | _g_free0 (_tmp352_)(_tmp352_ = (g_free (_tmp352_), ((void*)0))); |
| 6379 | if (!bala_symbol_is_private_symbol ((BalaSymbol*) f)) { |
| 6380 | BalaCCodeDeclaration* _tmp357_; |
| 6381 | _tmp357_ = target_def; |
| 6382 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp357_, BALA_CCODE_MODIFIERS_EXTERN); |
| 6383 | } else { |
| 6384 | BalaCCodeDeclaration* _tmp358_; |
| 6385 | _tmp358_ = target_def; |
| 6386 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp358_, BALA_CCODE_MODIFIERS_STATIC); |
| 6387 | } |
| 6388 | _tmp359_ = self->cfile; |
| 6389 | _tmp360_ = target_def; |
| 6390 | bala_ccode_file_add_type_member_declaration (_tmp359_, (BalaCCodeNode*) _tmp360_); |
| 6391 | _tmp361_ = delegate_type; |
| 6392 | if (bala_data_type_is_disposable ((BalaDataType*) _tmp361_)) { |
| 6393 | BalaCCodeDeclaration* target_destroy_notify_def = NULL((void*)0); |
| 6394 | BalaDelegateType* _tmp362_; |
| 6395 | gchar* _tmp363_; |
| 6396 | gchar* _tmp364_; |
| 6397 | BalaCCodeDeclaration* _tmp365_; |
| 6398 | BalaCCodeDeclaration* _tmp366_; |
| 6399 | BalaCCodeDeclaration* _tmp367_; |
| 6400 | gchar* _tmp368_; |
| 6401 | gchar* _tmp369_; |
| 6402 | BalaCCodeConstant* _tmp370_; |
| 6403 | BalaCCodeConstant* _tmp371_; |
| 6404 | BalaCCodeVariableDeclarator* _tmp372_; |
| 6405 | BalaCCodeVariableDeclarator* _tmp373_; |
| 6406 | BalaCCodeFile* _tmp376_; |
| 6407 | BalaCCodeDeclaration* _tmp377_; |
| 6408 | _tmp362_ = self->delegate_target_destroy_type; |
| 6409 | _tmp363_ = bala_get_ccode_name ((BalaCodeNode*) _tmp362_); |
| 6410 | _tmp364_ = _tmp363_; |
| 6411 | _tmp365_ = bala_ccode_declaration_new (_tmp364_); |
| 6412 | _tmp366_ = _tmp365_; |
| 6413 | _g_free0 (_tmp364_)(_tmp364_ = (g_free (_tmp364_), ((void*)0))); |
| 6414 | target_destroy_notify_def = _tmp366_; |
| 6415 | _tmp367_ = target_destroy_notify_def; |
| 6416 | _tmp368_ = bala_get_ccode_delegate_target_destroy_notify_name ((BalaVariable*) f); |
| 6417 | _tmp369_ = _tmp368_; |
| 6418 | _tmp370_ = bala_ccode_constant_new ("NULL"); |
| 6419 | _tmp371_ = _tmp370_; |
| 6420 | _tmp372_ = bala_ccode_variable_declarator_new (_tmp369_, (BalaCCodeExpression*) _tmp371_, NULL((void*)0)); |
| 6421 | _tmp373_ = _tmp372_; |
| 6422 | bala_ccode_declaration_add_declarator (_tmp367_, (BalaCCodeDeclarator*) _tmp373_); |
| 6423 | _bala_ccode_node_unref0 (_tmp373_)((_tmp373_ == ((void*)0)) ? ((void*)0) : (_tmp373_ = (bala_ccode_node_unref (_tmp373_), ((void*)0)))); |
| 6424 | _bala_ccode_node_unref0 (_tmp371_)((_tmp371_ == ((void*)0)) ? ((void*)0) : (_tmp371_ = (bala_ccode_node_unref (_tmp371_), ((void*)0)))); |
| 6425 | _g_free0 (_tmp369_)(_tmp369_ = (g_free (_tmp369_), ((void*)0))); |
| 6426 | if (!bala_symbol_is_private_symbol ((BalaSymbol*) f)) { |
| 6427 | BalaCCodeDeclaration* _tmp374_; |
| 6428 | _tmp374_ = target_destroy_notify_def; |
| 6429 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp374_, BALA_CCODE_MODIFIERS_EXTERN); |
| 6430 | } else { |
| 6431 | BalaCCodeDeclaration* _tmp375_; |
| 6432 | _tmp375_ = target_destroy_notify_def; |
| 6433 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp375_, BALA_CCODE_MODIFIERS_STATIC); |
| 6434 | } |
| 6435 | _tmp376_ = self->cfile; |
| 6436 | _tmp377_ = target_destroy_notify_def; |
| 6437 | bala_ccode_file_add_type_member_declaration (_tmp376_, (BalaCCodeNode*) _tmp377_); |
| 6438 | _bala_ccode_node_unref0 (target_destroy_notify_def)((target_destroy_notify_def == ((void*)0)) ? ((void*)0) : (target_destroy_notify_def = (bala_ccode_node_unref (target_destroy_notify_def), ((void *)0)))); |
| 6439 | } |
| 6440 | _bala_ccode_node_unref0 (target_def)((target_def == ((void*)0)) ? ((void*)0) : (target_def = (bala_ccode_node_unref (target_def), ((void*)0)))); |
| 6441 | } |
| 6442 | _bala_code_node_unref0 (delegate_type)((delegate_type == ((void*)0)) ? ((void*)0) : (delegate_type = (bala_code_node_unref (delegate_type), ((void*)0)))); |
| 6443 | } |
| 6444 | } |
| 6445 | _tmp378_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 6446 | _tmp379_ = _tmp378_; |
| 6447 | if (_tmp379_ != NULL((void*)0)) { |
| 6448 | BalaCCodeExpression* rhs = NULL((void*)0); |
| 6449 | BalaExpression* _tmp380_; |
| 6450 | BalaExpression* _tmp381_; |
| 6451 | BalaCCodeExpression* _tmp382_; |
| 6452 | BalaCCodeExpression* _tmp383_; |
| 6453 | BalaCCodeExpression* _tmp384_; |
| 6454 | _tmp380_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 6455 | _tmp381_ = _tmp380_; |
| 6456 | _tmp382_ = bala_get_cvalue (_tmp381_); |
| 6457 | _tmp383_ = _bala_ccode_node_ref0 (_tmp382_); |
| 6458 | rhs = _tmp383_; |
| 6459 | _tmp384_ = rhs; |
| 6460 | if (!bala_ccode_base_module_is_constant_ccode_expression (_tmp384_)) { |
| 6461 | if (is_gtypeinstance) { |
| 6462 | BalaExpression* _tmp385_; |
| 6463 | BalaExpression* _tmp386_; |
| 6464 | gboolean _tmp422_ = FALSE(0); |
| 6465 | BalaDataType* _tmp423_; |
| 6466 | BalaDataType* _tmp424_; |
| 6467 | _tmp385_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 6468 | _tmp386_ = _tmp385_; |
| 6469 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp386_, BALA_TYPE_INITIALIZER_LIST)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp386_); GType __t = ((bala_initializer_list_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 6470 | BalaCCodeFunction* _tmp387_; |
| 6471 | BalaCCodeFunction* _tmp388_; |
| 6472 | BalaLocalVariable* temp_decl = NULL((void*)0); |
| 6473 | BalaDataType* _tmp389_; |
| 6474 | BalaDataType* _tmp390_; |
| 6475 | BalaLocalVariable* _tmp391_; |
| 6476 | BalaCCodeVariableDeclarator* vardecl = NULL((void*)0); |
| 6477 | BalaLocalVariable* _tmp392_; |
| 6478 | const gchar* _tmp393_; |
| 6479 | const gchar* _tmp394_; |
| 6480 | BalaCCodeExpression* _tmp395_; |
| 6481 | BalaCCodeVariableDeclarator* _tmp396_; |
| 6482 | BalaCCodeFunction* _tmp397_; |
| 6483 | BalaCCodeFunction* _tmp398_; |
| 6484 | BalaLocalVariable* _tmp399_; |
| 6485 | BalaDataType* _tmp400_; |
| 6486 | BalaDataType* _tmp401_; |
| 6487 | gchar* _tmp402_; |
| 6488 | gchar* _tmp403_; |
| 6489 | BalaCCodeVariableDeclarator* _tmp404_; |
| 6490 | BalaCCodeExpression* tmp = NULL((void*)0); |
| 6491 | BalaLocalVariable* _tmp405_; |
| 6492 | const gchar* _tmp406_; |
| 6493 | const gchar* _tmp407_; |
| 6494 | gchar* _tmp408_; |
| 6495 | gchar* _tmp409_; |
| 6496 | BalaCCodeExpression* _tmp410_; |
| 6497 | BalaCCodeExpression* _tmp411_; |
| 6498 | BalaCCodeFunction* _tmp412_; |
| 6499 | BalaCCodeFunction* _tmp413_; |
| 6500 | BalaCCodeExpression* _tmp414_; |
| 6501 | BalaCCodeExpression* _tmp415_; |
| 6502 | BalaCCodeFunction* _tmp416_; |
| 6503 | BalaCCodeFunction* _tmp417_; |
| 6504 | _tmp387_ = bala_ccode_base_module_get_ccode (self); |
| 6505 | _tmp388_ = _tmp387_; |
| 6506 | bala_ccode_function_open_block (_tmp388_); |
| 6507 | _tmp389_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 6508 | _tmp390_ = _tmp389_; |
| 6509 | _tmp391_ = bala_ccode_base_module_get_temp_variable (self, _tmp390_, TRUE(!(0)), NULL((void*)0), FALSE(0)); |
| 6510 | temp_decl = _tmp391_; |
| 6511 | _tmp392_ = temp_decl; |
| 6512 | _tmp393_ = bala_symbol_get_name ((BalaSymbol*) _tmp392_); |
| 6513 | _tmp394_ = _tmp393_; |
| 6514 | _tmp395_ = rhs; |
| 6515 | _tmp396_ = bala_ccode_variable_declarator_new_zero (_tmp394_, _tmp395_, NULL((void*)0)); |
| 6516 | vardecl = _tmp396_; |
| 6517 | _tmp397_ = bala_ccode_base_module_get_ccode (self); |
| 6518 | _tmp398_ = _tmp397_; |
| 6519 | _tmp399_ = temp_decl; |
| 6520 | _tmp400_ = bala_variable_get_variable_type ((BalaVariable*) _tmp399_); |
| 6521 | _tmp401_ = _tmp400_; |
| 6522 | _tmp402_ = bala_get_ccode_name ((BalaCodeNode*) _tmp401_); |
| 6523 | _tmp403_ = _tmp402_; |
| 6524 | _tmp404_ = vardecl; |
| 6525 | bala_ccode_function_add_declaration (_tmp398_, _tmp403_, (BalaCCodeDeclarator*) _tmp404_, 0); |
| 6526 | _g_free0 (_tmp403_)(_tmp403_ = (g_free (_tmp403_), ((void*)0))); |
| 6527 | _tmp405_ = temp_decl; |
| 6528 | _tmp406_ = bala_symbol_get_name ((BalaSymbol*) _tmp405_); |
| 6529 | _tmp407_ = _tmp406_; |
| 6530 | _tmp408_ = bala_ccode_base_module_get_variable_cname (self, _tmp407_); |
| 6531 | _tmp409_ = _tmp408_; |
| 6532 | _tmp410_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp409_); |
| 6533 | _tmp411_ = _tmp410_; |
| 6534 | _g_free0 (_tmp409_)(_tmp409_ = (g_free (_tmp409_), ((void*)0))); |
| 6535 | tmp = _tmp411_; |
| 6536 | _tmp412_ = bala_ccode_base_module_get_ccode (self); |
| 6537 | _tmp413_ = _tmp412_; |
| 6538 | _tmp414_ = lhs; |
| 6539 | _tmp415_ = tmp; |
| 6540 | bala_ccode_function_add_assignment (_tmp413_, _tmp414_, _tmp415_); |
| 6541 | _tmp416_ = bala_ccode_base_module_get_ccode (self); |
| 6542 | _tmp417_ = _tmp416_; |
| 6543 | bala_ccode_function_close (_tmp417_); |
| 6544 | _bala_ccode_node_unref0 (tmp)((tmp == ((void*)0)) ? ((void*)0) : (tmp = (bala_ccode_node_unref (tmp), ((void*)0)))); |
| 6545 | _bala_ccode_node_unref0 (vardecl)((vardecl == ((void*)0)) ? ((void*)0) : (vardecl = (bala_ccode_node_unref (vardecl), ((void*)0)))); |
| 6546 | _bala_code_node_unref0 (temp_decl)((temp_decl == ((void*)0)) ? ((void*)0) : (temp_decl = (bala_code_node_unref (temp_decl), ((void*)0)))); |
| 6547 | } else { |
| 6548 | BalaCCodeFunction* _tmp418_; |
| 6549 | BalaCCodeFunction* _tmp419_; |
| 6550 | BalaCCodeExpression* _tmp420_; |
| 6551 | BalaCCodeExpression* _tmp421_; |
| 6552 | _tmp418_ = bala_ccode_base_module_get_ccode (self); |
| 6553 | _tmp419_ = _tmp418_; |
| 6554 | _tmp420_ = lhs; |
| 6555 | _tmp421_ = rhs; |
| 6556 | bala_ccode_function_add_assignment (_tmp419_, _tmp420_, _tmp421_); |
| 6557 | } |
| 6558 | _tmp423_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 6559 | _tmp424_ = _tmp423_; |
| 6560 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp424_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp424_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6561 | _tmp422_ = bala_get_ccode_array_length ((BalaCodeNode*) f); |
| 6562 | } else { |
| 6563 | _tmp422_ = FALSE(0); |
| 6564 | } |
| 6565 | if (_tmp422_) { |
| 6566 | BalaArrayType* array_type = NULL((void*)0); |
| 6567 | BalaDataType* _tmp425_; |
| 6568 | BalaDataType* _tmp426_; |
| 6569 | BalaArrayType* _tmp427_; |
| 6570 | BalaTargetValue* field_value = NULL((void*)0); |
| 6571 | BalaTargetValue* _tmp428_; |
| 6572 | BalaGLibValue* glib_value = NULL((void*)0); |
| 6573 | BalaExpression* _tmp429_; |
| 6574 | BalaExpression* _tmp430_; |
| 6575 | BalaTargetValue* _tmp431_; |
| 6576 | BalaTargetValue* _tmp432_; |
| 6577 | BalaGLibValue* _tmp433_; |
| 6578 | BalaGLibValue* _tmp434_; |
| 6579 | BalaList* _tmp435_; |
| 6580 | _tmp425_ = bala_variable_get_variable_type ((BalaVariable*) f); |
| 6581 | _tmp426_ = _tmp425_; |
| 6582 | _tmp427_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp426_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp426_), ((bala_array_type_get_type ())))))); |
| 6583 | array_type = _tmp427_; |
| 6584 | _tmp428_ = bala_ccode_base_module_get_field_cvalue (self, f, NULL((void*)0)); |
| 6585 | field_value = _tmp428_; |
| 6586 | _tmp429_ = bala_variable_get_initializer ((BalaVariable*) f); |
| 6587 | _tmp430_ = _tmp429_; |
| 6588 | _tmp431_ = bala_expression_get_target_value (_tmp430_); |
| 6589 | _tmp432_ = _tmp431_; |
| 6590 | _tmp433_ = _bala_target_value_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp432_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp432_), ((bala_glib_value_get_type ())))))); |
| 6591 | glib_value = _tmp433_; |
| 6592 | _tmp434_ = glib_value; |
| 6593 | _tmp435_ = _tmp434_->array_length_cvalues; |
| 6594 | if (_tmp435_ != NULL((void*)0)) { |
| 6595 | { |
| 6596 | gint dim = 0; |
| 6597 | dim = 1; |
| 6598 | { |
| 6599 | gboolean _tmp436_ = FALSE(0); |
| 6600 | _tmp436_ = TRUE(!(0)); |
| 6601 | while (TRUE(!(0))) { |
| 6602 | BalaArrayType* _tmp438_; |
| 6603 | gint _tmp439_; |
| 6604 | gint _tmp440_; |
| 6605 | BalaCCodeExpression* array_len_lhs = NULL((void*)0); |
| 6606 | BalaTargetValue* _tmp441_; |
| 6607 | BalaCCodeExpression* _tmp442_; |
| 6608 | BalaCCodeFunction* _tmp443_; |
| 6609 | BalaCCodeFunction* _tmp444_; |
| 6610 | BalaCCodeExpression* _tmp445_; |
| 6611 | BalaGLibValue* _tmp446_; |
| 6612 | BalaCCodeExpression* _tmp447_; |
| 6613 | BalaCCodeExpression* _tmp448_; |
| 6614 | if (!_tmp436_) { |
| 6615 | gint _tmp437_; |
| 6616 | _tmp437_ = dim; |
| 6617 | dim = _tmp437_ + 1; |
| 6618 | } |
| 6619 | _tmp436_ = FALSE(0); |
| 6620 | _tmp438_ = array_type; |
| 6621 | _tmp439_ = bala_array_type_get_rank (_tmp438_); |
| 6622 | _tmp440_ = _tmp439_; |
| 6623 | if (!(dim <= _tmp440_)) { |
| 6624 | break; |
| 6625 | } |
| 6626 | _tmp441_ = field_value; |
| 6627 | _tmp442_ = bala_ccode_base_module_get_array_length_cvalue (self, _tmp441_, dim); |
| 6628 | array_len_lhs = _tmp442_; |
| 6629 | _tmp443_ = bala_ccode_base_module_get_ccode (self); |
| 6630 | _tmp444_ = _tmp443_; |
| 6631 | _tmp445_ = array_len_lhs; |
| 6632 | _tmp446_ = glib_value; |
| 6633 | _tmp447_ = bala_ccode_base_module_get_array_length_cvalue (self, (BalaTargetValue*) _tmp446_, dim); |
| 6634 | _tmp448_ = _tmp447_; |
| 6635 | bala_ccode_function_add_assignment (_tmp444_, _tmp445_, _tmp448_); |
| 6636 | _bala_ccode_node_unref0 (_tmp448_)((_tmp448_ == ((void*)0)) ? ((void*)0) : (_tmp448_ = (bala_ccode_node_unref (_tmp448_), ((void*)0)))); |
| 6637 | _bala_ccode_node_unref0 (array_len_lhs)((array_len_lhs == ((void*)0)) ? ((void*)0) : (array_len_lhs = (bala_ccode_node_unref (array_len_lhs), ((void*)0)))); |
| 6638 | } |
| 6639 | } |
| 6640 | } |
| 6641 | } else { |
| 6642 | BalaGLibValue* _tmp449_; |
| 6643 | _tmp449_ = glib_value; |
| 6644 | if (_tmp449_->array_null_terminated) { |
| 6645 | BalaCCodeFunctionCall* len_call = NULL((void*)0); |
| 6646 | BalaCCodeIdentifier* _tmp450_; |
| 6647 | BalaCCodeIdentifier* _tmp451_; |
| 6648 | BalaCCodeFunctionCall* _tmp452_; |
| 6649 | BalaCCodeFunctionCall* _tmp453_; |
| 6650 | BalaCCodeFunctionCall* _tmp454_; |
| 6651 | BalaGLibValue* _tmp455_; |
| 6652 | BalaCCodeExpression* _tmp456_; |
| 6653 | BalaCCodeFunction* _tmp457_; |
| 6654 | BalaCCodeFunction* _tmp458_; |
| 6655 | BalaTargetValue* _tmp459_; |
| 6656 | BalaCCodeExpression* _tmp460_; |
| 6657 | BalaCCodeExpression* _tmp461_; |
| 6658 | BalaCCodeFunctionCall* _tmp462_; |
| 6659 | self->requires_array_length = TRUE(!(0)); |
| 6660 | _tmp450_ = bala_ccode_identifier_new ("_bala_array_length"); |
| 6661 | _tmp451_ = _tmp450_; |
| 6662 | _tmp452_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp451_); |
| 6663 | _tmp453_ = _tmp452_; |
| 6664 | _bala_ccode_node_unref0 (_tmp451_)((_tmp451_ == ((void*)0)) ? ((void*)0) : (_tmp451_ = (bala_ccode_node_unref (_tmp451_), ((void*)0)))); |
| 6665 | len_call = _tmp453_; |
| 6666 | _tmp454_ = len_call; |
| 6667 | _tmp455_ = glib_value; |
| 6668 | _tmp456_ = bala_get_cvalue_ ((BalaTargetValue*) _tmp455_); |
| 6669 | bala_ccode_function_call_add_argument (_tmp454_, _tmp456_); |
| 6670 | _tmp457_ = bala_ccode_base_module_get_ccode (self); |
| 6671 | _tmp458_ = _tmp457_; |
| 6672 | _tmp459_ = field_value; |
| 6673 | _tmp460_ = bala_ccode_base_module_get_array_length_cvalue (self, _tmp459_, 1); |
| 6674 | _tmp461_ = _tmp460_; |
| 6675 | _tmp462_ = len_call; |
| 6676 | bala_ccode_function_add_assignment (_tmp458_, _tmp461_, (BalaCCodeExpression*) _tmp462_); |
| 6677 | _bala_ccode_node_unref0 (_tmp461_)((_tmp461_ == ((void*)0)) ? ((void*)0) : (_tmp461_ = (bala_ccode_node_unref (_tmp461_), ((void*)0)))); |
| 6678 | _bala_ccode_node_unref0 (len_call)((len_call == ((void*)0)) ? ((void*)0) : (len_call = (bala_ccode_node_unref (len_call), ((void*)0)))); |
| 6679 | } else { |
| 6680 | { |
| 6681 | gint dim = 0; |
| 6682 | dim = 1; |
| 6683 | { |
| 6684 | gboolean _tmp463_ = FALSE(0); |
| 6685 | _tmp463_ = TRUE(!(0)); |
| 6686 | while (TRUE(!(0))) { |
| 6687 | BalaArrayType* _tmp465_; |
| 6688 | gint _tmp466_; |
| 6689 | gint _tmp467_; |
| 6690 | BalaCCodeFunction* _tmp468_; |
| 6691 | BalaCCodeFunction* _tmp469_; |
| 6692 | BalaTargetValue* _tmp470_; |
| 6693 | BalaCCodeExpression* _tmp471_; |
| 6694 | BalaCCodeExpression* _tmp472_; |
| 6695 | BalaCCodeConstant* _tmp473_; |
| 6696 | BalaCCodeConstant* _tmp474_; |
| 6697 | if (!_tmp463_) { |
| 6698 | gint _tmp464_; |
| 6699 | _tmp464_ = dim; |
| 6700 | dim = _tmp464_ + 1; |
| 6701 | } |
| 6702 | _tmp463_ = FALSE(0); |
| 6703 | _tmp465_ = array_type; |
| 6704 | _tmp466_ = bala_array_type_get_rank (_tmp465_); |
| 6705 | _tmp467_ = _tmp466_; |
| 6706 | if (!(dim <= _tmp467_)) { |
| 6707 | break; |
| 6708 | } |
| 6709 | _tmp468_ = bala_ccode_base_module_get_ccode (self); |
| 6710 | _tmp469_ = _tmp468_; |
| 6711 | _tmp470_ = field_value; |
| 6712 | _tmp471_ = bala_ccode_base_module_get_array_length_cvalue (self, _tmp470_, dim); |
| 6713 | _tmp472_ = _tmp471_; |
| 6714 | _tmp473_ = bala_ccode_constant_new ("-1"); |
| 6715 | _tmp474_ = _tmp473_; |
| 6716 | bala_ccode_function_add_assignment (_tmp469_, _tmp472_, (BalaCCodeExpression*) _tmp474_); |
| 6717 | _bala_ccode_node_unref0 (_tmp474_)((_tmp474_ == ((void*)0)) ? ((void*)0) : (_tmp474_ = (bala_ccode_node_unref (_tmp474_), ((void*)0)))); |
| 6718 | _bala_ccode_node_unref0 (_tmp472_)((_tmp472_ == ((void*)0)) ? ((void*)0) : (_tmp472_ = (bala_ccode_node_unref (_tmp472_), ((void*)0)))); |
| 6719 | } |
| 6720 | } |
| 6721 | } |
| 6722 | } |
| 6723 | } |
| 6724 | _bala_target_value_unref0 (glib_value)((glib_value == ((void*)0)) ? ((void*)0) : (glib_value = (bala_target_value_unref (glib_value), ((void*)0)))); |
| 6725 | _bala_target_value_unref0 (field_value)((field_value == ((void*)0)) ? ((void*)0) : (field_value = (bala_target_value_unref (field_value), ((void*)0)))); |
| 6726 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 6727 | } |
| 6728 | } else { |
| 6729 | BalaSourceReference* _tmp475_; |
| 6730 | BalaSourceReference* _tmp476_; |
| 6731 | bala_code_node_set_error ((BalaCodeNode*) f, TRUE(!(0))); |
| 6732 | _tmp475_ = bala_code_node_get_source_reference ((BalaCodeNode*) f); |
| 6733 | _tmp476_ = _tmp475_; |
| 6734 | bala_report_error (_tmp476_, "Non-constant field initializers not supported in this context"); |
| 6735 | _bala_ccode_node_unref0 (rhs)((rhs == ((void*)0)) ? ((void*)0) : (rhs = (bala_ccode_node_unref (rhs), ((void*)0)))); |
| 6736 | _bala_ccode_node_unref0 (var_def)((var_def == ((void*)0)) ? ((void*)0) : (var_def = (bala_ccode_node_unref (var_def), ((void*)0)))); |
| 6737 | _bala_ccode_node_unref0 (var_decl)((var_decl == ((void*)0)) ? ((void*)0) : (var_decl = (bala_ccode_node_unref (var_decl), ((void*)0)))); |
| 6738 | _bala_ccode_node_unref0 (lhs)((lhs == ((void*)0)) ? ((void*)0) : (lhs = (bala_ccode_node_unref (lhs), ((void*)0)))); |
| 6739 | _bala_code_node_unref0 (cl)((cl == ((void*)0)) ? ((void*)0) : (cl = (bala_code_node_unref (cl), ((void*)0)))); |
| 6740 | return; |
| 6741 | } |
| 6742 | } |
| 6743 | _bala_ccode_node_unref0 (rhs)((rhs == ((void*)0)) ? ((void*)0) : (rhs = (bala_ccode_node_unref (rhs), ((void*)0)))); |
| 6744 | } |
| 6745 | bala_ccode_base_module_pop_context (self); |
| 6746 | _bala_ccode_node_unref0 (var_def)((var_def == ((void*)0)) ? ((void*)0) : (var_def = (bala_ccode_node_unref (var_def), ((void*)0)))); |
| 6747 | _bala_ccode_node_unref0 (var_decl)((var_decl == ((void*)0)) ? ((void*)0) : (var_decl = (bala_ccode_node_unref (var_decl), ((void*)0)))); |
| 6748 | } |
| 6749 | } |
| 6750 | } |
| 6751 | bala_ccode_base_module_pop_line (self); |
| 6752 | _bala_ccode_node_unref0 (lhs)((lhs == ((void*)0)) ? ((void*)0) : (lhs = (bala_ccode_node_unref (lhs), ((void*)0)))); |
| 6753 | _bala_code_node_unref0 (cl)((cl == ((void*)0)) ? ((void*)0) : (cl = (bala_code_node_unref (cl), ((void*)0)))); |
| 6754 | } |
| 6755 | |
| 6756 | gboolean |
| 6757 | bala_ccode_base_module_is_constant_ccode_expression (BalaCCodeExpression* cexpr) |
| 6758 | { |
| 6759 | BalaCCodeParenthesizedExpression* cparenthesized = NULL((void*)0); |
| 6760 | BalaCCodeParenthesizedExpression* _tmp19_; |
| 6761 | gboolean _tmp20_ = FALSE(0); |
| 6762 | BalaCCodeParenthesizedExpression* _tmp21_; |
| 6763 | gboolean result = FALSE(0); |
| 6764 | g_return_val_if_fail (cexpr != NULL, FALSE)do { if ((cexpr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "cexpr != NULL" ); return ((0)); } } while (0); |
| 6765 | if (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_CONSTANT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_constant_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6766 | result = TRUE(!(0)); |
| 6767 | return result; |
| 6768 | } else { |
| 6769 | if (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_CAST_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_cast_expression_get_type ()) ); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6770 | BalaCCodeCastExpression* ccast = NULL((void*)0); |
| 6771 | BalaCCodeCastExpression* _tmp0_; |
| 6772 | BalaCCodeCastExpression* _tmp1_; |
| 6773 | BalaCCodeExpression* _tmp2_; |
| 6774 | BalaCCodeExpression* _tmp3_; |
| 6775 | _tmp0_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_CAST_EXPRESSION, BalaCCodeCastExpression)(((BalaCCodeCastExpression*) g_type_check_instance_cast ((GTypeInstance *) (cexpr), ((bala_ccode_cast_expression_get_type ())))))); |
| 6776 | ccast = _tmp0_; |
| 6777 | _tmp1_ = ccast; |
| 6778 | _tmp2_ = bala_ccode_cast_expression_get_inner (_tmp1_); |
| 6779 | _tmp3_ = _tmp2_; |
| 6780 | result = bala_ccode_base_module_is_constant_ccode_expression (_tmp3_); |
| 6781 | _bala_ccode_node_unref0 (ccast)((ccast == ((void*)0)) ? ((void*)0) : (ccast = (bala_ccode_node_unref (ccast), ((void*)0)))); |
| 6782 | return result; |
| 6783 | } else { |
| 6784 | if (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_UNARY_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_unary_expression_get_type () )); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6785 | BalaCCodeUnaryExpression* cunary = NULL((void*)0); |
| 6786 | BalaCCodeUnaryExpression* _tmp4_; |
| 6787 | BalaCCodeUnaryExpression* _tmp5_; |
| 6788 | BalaCCodeUnaryOperator _tmp6_; |
| 6789 | BalaCCodeUnaryOperator _tmp7_; |
| 6790 | BalaCCodeUnaryExpression* _tmp8_; |
| 6791 | BalaCCodeExpression* _tmp9_; |
| 6792 | BalaCCodeExpression* _tmp10_; |
| 6793 | _tmp4_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_UNARY_EXPRESSION, BalaCCodeUnaryExpression)(((BalaCCodeUnaryExpression*) g_type_check_instance_cast ((GTypeInstance *) (cexpr), ((bala_ccode_unary_expression_get_type ())))))); |
| 6794 | cunary = _tmp4_; |
| 6795 | _tmp5_ = cunary; |
| 6796 | _tmp6_ = bala_ccode_unary_expression_get_operator (_tmp5_); |
| 6797 | _tmp7_ = _tmp6_; |
| 6798 | switch (_tmp7_) { |
| 6799 | case BALA_CCODE_UNARY_OPERATOR_PREFIX_INCREMENT: |
| 6800 | case BALA_CCODE_UNARY_OPERATOR_PREFIX_DECREMENT: |
| 6801 | case BALA_CCODE_UNARY_OPERATOR_POSTFIX_INCREMENT: |
| 6802 | case BALA_CCODE_UNARY_OPERATOR_POSTFIX_DECREMENT: |
| 6803 | { |
| 6804 | result = FALSE(0); |
| 6805 | _bala_ccode_node_unref0 (cunary)((cunary == ((void*)0)) ? ((void*)0) : (cunary = (bala_ccode_node_unref (cunary), ((void*)0)))); |
| 6806 | return result; |
| 6807 | } |
| 6808 | default: |
| 6809 | { |
| 6810 | break; |
| 6811 | } |
| 6812 | } |
| 6813 | _tmp8_ = cunary; |
| 6814 | _tmp9_ = bala_ccode_unary_expression_get_inner (_tmp8_); |
| 6815 | _tmp10_ = _tmp9_; |
| 6816 | result = bala_ccode_base_module_is_constant_ccode_expression (_tmp10_); |
| 6817 | _bala_ccode_node_unref0 (cunary)((cunary == ((void*)0)) ? ((void*)0) : (cunary = (bala_ccode_node_unref (cunary), ((void*)0)))); |
| 6818 | return result; |
| 6819 | } else { |
| 6820 | if (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_BINARY_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_binary_expression_get_type ( ))); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6821 | BalaCCodeBinaryExpression* cbinary = NULL((void*)0); |
| 6822 | BalaCCodeBinaryExpression* _tmp11_; |
| 6823 | gboolean _tmp12_ = FALSE(0); |
| 6824 | BalaCCodeBinaryExpression* _tmp13_; |
| 6825 | BalaCCodeExpression* _tmp14_; |
| 6826 | BalaCCodeExpression* _tmp15_; |
| 6827 | _tmp11_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_BINARY_EXPRESSION, BalaCCodeBinaryExpression)(((BalaCCodeBinaryExpression*) g_type_check_instance_cast ((GTypeInstance *) (cexpr), ((bala_ccode_binary_expression_get_type ())))))); |
| 6828 | cbinary = _tmp11_; |
| 6829 | _tmp13_ = cbinary; |
| 6830 | _tmp14_ = bala_ccode_binary_expression_get_left (_tmp13_); |
| 6831 | _tmp15_ = _tmp14_; |
| 6832 | if (bala_ccode_base_module_is_constant_ccode_expression (_tmp15_)) { |
| 6833 | BalaCCodeBinaryExpression* _tmp16_; |
| 6834 | BalaCCodeExpression* _tmp17_; |
| 6835 | BalaCCodeExpression* _tmp18_; |
| 6836 | _tmp16_ = cbinary; |
| 6837 | _tmp17_ = bala_ccode_binary_expression_get_right (_tmp16_); |
| 6838 | _tmp18_ = _tmp17_; |
| 6839 | _tmp12_ = bala_ccode_base_module_is_constant_ccode_expression (_tmp18_); |
| 6840 | } else { |
| 6841 | _tmp12_ = FALSE(0); |
| 6842 | } |
| 6843 | result = _tmp12_; |
| 6844 | _bala_ccode_node_unref0 (cbinary)((cbinary == ((void*)0)) ? ((void*)0) : (cbinary = (bala_ccode_node_unref (cbinary), ((void*)0)))); |
| 6845 | return result; |
| 6846 | } |
| 6847 | } |
| 6848 | } |
| 6849 | } |
| 6850 | _tmp19_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_PARENTHESIZED_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_parenthesized_expression_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaCCodeParenthesizedExpression*) cexpr) : NULL((void*)0)); |
| 6851 | cparenthesized = _tmp19_; |
| 6852 | _tmp21_ = cparenthesized; |
| 6853 | if (NULL((void*)0) != _tmp21_) { |
| 6854 | BalaCCodeParenthesizedExpression* _tmp22_; |
| 6855 | BalaCCodeExpression* _tmp23_; |
| 6856 | BalaCCodeExpression* _tmp24_; |
| 6857 | _tmp22_ = cparenthesized; |
| 6858 | _tmp23_ = bala_ccode_parenthesized_expression_get_inner (_tmp22_); |
| 6859 | _tmp24_ = _tmp23_; |
| 6860 | _tmp20_ = bala_ccode_base_module_is_constant_ccode_expression (_tmp24_); |
| 6861 | } else { |
| 6862 | _tmp20_ = FALSE(0); |
| 6863 | } |
| 6864 | result = _tmp20_; |
| 6865 | _bala_ccode_node_unref0 (cparenthesized)((cparenthesized == ((void*)0)) ? ((void*)0) : (cparenthesized = (bala_ccode_node_unref (cparenthesized), ((void*)0)))); |
| 6866 | return result; |
| 6867 | } |
| 6868 | |
| 6869 | gboolean |
| 6870 | bala_ccode_base_module_is_constant_ccode (BalaCodeNode* expr) |
| 6871 | { |
| 6872 | gboolean result = FALSE(0); |
| 6873 | g_return_val_if_fail (expr != NULL, FALSE)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return ((0)); } } while (0); |
| 6874 | if (G_TYPE_CHECK_INSTANCE_TYPE (expr, BALA_TYPE_CONSTANT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( expr); GType __t = ((bala_constant_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6875 | BalaSymbol* _tmp0_; |
| 6876 | BalaSymbol* _tmp1_; |
| 6877 | _tmp0_ = bala_symbol_get_parent_symbol ((BalaSymbol*) G_TYPE_CHECK_INSTANCE_CAST (expr, BALA_TYPE_CONSTANT, BalaConstant)(((BalaConstant*) g_type_check_instance_cast ((GTypeInstance* ) (expr), ((bala_constant_get_type ())))))); |
| 6878 | _tmp1_ = _tmp0_; |
| 6879 | result = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BALA_TYPE_BLOCK)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1_); GType __t = ((bala_block_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 6880 | return result; |
| 6881 | } else { |
| 6882 | if (G_TYPE_CHECK_INSTANCE_TYPE (expr, BALA_TYPE_INTEGER_LITERAL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( expr); GType __t = ((bala_integer_literal_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6883 | result = bala_expression_is_constant ((BalaExpression*) G_TYPE_CHECK_INSTANCE_CAST (expr, BALA_TYPE_INTEGER_LITERAL, BalaIntegerLiteral)(((BalaIntegerLiteral*) g_type_check_instance_cast ((GTypeInstance *) (expr), ((bala_integer_literal_get_type ())))))); |
| 6884 | return result; |
| 6885 | } else { |
| 6886 | if (G_TYPE_CHECK_INSTANCE_TYPE (expr, BALA_TYPE_MEMBER_ACCESS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( expr); GType __t = ((bala_member_access_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6887 | BalaSymbol* _tmp2_; |
| 6888 | BalaSymbol* _tmp3_; |
| 6889 | _tmp2_ = bala_expression_get_symbol_reference ((BalaExpression*) G_TYPE_CHECK_INSTANCE_CAST (expr, BALA_TYPE_MEMBER_ACCESS, BalaMemberAccess)(((BalaMemberAccess*) g_type_check_instance_cast ((GTypeInstance *) (expr), ((bala_member_access_get_type ())))))); |
| 6890 | _tmp3_ = _tmp2_; |
| 6891 | result = bala_ccode_base_module_is_constant_ccode ((BalaCodeNode*) _tmp3_); |
| 6892 | return result; |
| 6893 | } else { |
| 6894 | if (G_TYPE_CHECK_INSTANCE_TYPE (expr, BALA_TYPE_CAST_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( expr); GType __t = ((bala_cast_expression_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6895 | BalaExpression* _tmp4_; |
| 6896 | BalaExpression* _tmp5_; |
| 6897 | _tmp4_ = bala_cast_expression_get_inner (G_TYPE_CHECK_INSTANCE_CAST (expr, BALA_TYPE_CAST_EXPRESSION, BalaCastExpression)(((BalaCastExpression*) g_type_check_instance_cast ((GTypeInstance *) (expr), ((bala_cast_expression_get_type ())))))); |
| 6898 | _tmp5_ = _tmp4_; |
| 6899 | result = bala_ccode_base_module_is_constant_ccode ((BalaCodeNode*) _tmp5_); |
| 6900 | return result; |
| 6901 | } |
| 6902 | } |
| 6903 | } |
| 6904 | } |
| 6905 | result = FALSE(0); |
| 6906 | return result; |
| 6907 | } |
| 6908 | |
| 6909 | /** |
| 6910 | * Returns whether the passed cexpr is a pure expression, i.e. an |
| 6911 | * expression without side-effects. |
| 6912 | */ |
| 6913 | gboolean |
| 6914 | bala_ccode_base_module_is_pure_ccode_expression (BalaCCodeExpression* cexpr) |
| 6915 | { |
| 6916 | gboolean _tmp0_ = FALSE(0); |
| 6917 | gboolean result = FALSE(0); |
| 6918 | g_return_val_if_fail (cexpr != NULL, FALSE)do { if ((cexpr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "cexpr != NULL" ); return ((0)); } } while (0); |
| 6919 | if (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_CONSTANT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_constant_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6920 | _tmp0_ = TRUE(!(0)); |
| 6921 | } else { |
| 6922 | _tmp0_ = G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_IDENTIFIER)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_identifier_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 6923 | } |
| 6924 | if (_tmp0_) { |
| 6925 | result = TRUE(!(0)); |
| 6926 | return result; |
| 6927 | } else { |
| 6928 | if (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_BINARY_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_binary_expression_get_type ( ))); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6929 | BalaCCodeBinaryExpression* cbinary = NULL((void*)0); |
| 6930 | BalaCCodeBinaryExpression* _tmp1_; |
| 6931 | gboolean _tmp2_ = FALSE(0); |
| 6932 | BalaCCodeBinaryExpression* _tmp3_; |
| 6933 | BalaCCodeExpression* _tmp4_; |
| 6934 | BalaCCodeExpression* _tmp5_; |
| 6935 | _tmp1_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_BINARY_EXPRESSION, BalaCCodeBinaryExpression)(((BalaCCodeBinaryExpression*) g_type_check_instance_cast ((GTypeInstance *) (cexpr), ((bala_ccode_binary_expression_get_type ())))))); |
| 6936 | cbinary = _tmp1_; |
| 6937 | _tmp3_ = cbinary; |
| 6938 | _tmp4_ = bala_ccode_binary_expression_get_left (_tmp3_); |
| 6939 | _tmp5_ = _tmp4_; |
| 6940 | if (bala_ccode_base_module_is_pure_ccode_expression (_tmp5_)) { |
| 6941 | BalaCCodeBinaryExpression* _tmp6_; |
| 6942 | BalaCCodeExpression* _tmp7_; |
| 6943 | BalaCCodeExpression* _tmp8_; |
| 6944 | _tmp6_ = cbinary; |
| 6945 | _tmp7_ = bala_ccode_binary_expression_get_right (_tmp6_); |
| 6946 | _tmp8_ = _tmp7_; |
| 6947 | _tmp2_ = bala_ccode_base_module_is_pure_ccode_expression (_tmp8_); |
| 6948 | } else { |
| 6949 | _tmp2_ = FALSE(0); |
| 6950 | } |
| 6951 | result = _tmp2_; |
| 6952 | _bala_ccode_node_unref0 (cbinary)((cbinary == ((void*)0)) ? ((void*)0) : (cbinary = (bala_ccode_node_unref (cbinary), ((void*)0)))); |
| 6953 | return result; |
| 6954 | } else { |
| 6955 | if (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_UNARY_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_unary_expression_get_type () )); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 6956 | BalaCCodeUnaryExpression* cunary = NULL((void*)0); |
| 6957 | BalaCCodeUnaryExpression* _tmp9_; |
| 6958 | BalaCCodeUnaryExpression* _tmp10_; |
| 6959 | BalaCCodeUnaryOperator _tmp11_; |
| 6960 | BalaCCodeUnaryOperator _tmp12_; |
| 6961 | _tmp9_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_UNARY_EXPRESSION, BalaCCodeUnaryExpression)(((BalaCCodeUnaryExpression*) g_type_check_instance_cast ((GTypeInstance *) (cexpr), ((bala_ccode_unary_expression_get_type ())))))); |
| 6962 | cunary = _tmp9_; |
| 6963 | _tmp10_ = cunary; |
| 6964 | _tmp11_ = bala_ccode_unary_expression_get_operator (_tmp10_); |
| 6965 | _tmp12_ = _tmp11_; |
| 6966 | switch (_tmp12_) { |
| 6967 | case BALA_CCODE_UNARY_OPERATOR_PREFIX_INCREMENT: |
| 6968 | case BALA_CCODE_UNARY_OPERATOR_PREFIX_DECREMENT: |
| 6969 | case BALA_CCODE_UNARY_OPERATOR_POSTFIX_INCREMENT: |
| 6970 | case BALA_CCODE_UNARY_OPERATOR_POSTFIX_DECREMENT: |
| 6971 | { |
| 6972 | result = FALSE(0); |
| 6973 | _bala_ccode_node_unref0 (cunary)((cunary == ((void*)0)) ? ((void*)0) : (cunary = (bala_ccode_node_unref (cunary), ((void*)0)))); |
| 6974 | return result; |
| 6975 | } |
| 6976 | default: |
| 6977 | { |
| 6978 | BalaCCodeUnaryExpression* _tmp13_; |
| 6979 | BalaCCodeExpression* _tmp14_; |
| 6980 | BalaCCodeExpression* _tmp15_; |
| 6981 | _tmp13_ = cunary; |
| 6982 | _tmp14_ = bala_ccode_unary_expression_get_inner (_tmp13_); |
| 6983 | _tmp15_ = _tmp14_; |
| 6984 | result = bala_ccode_base_module_is_pure_ccode_expression (_tmp15_); |
| 6985 | _bala_ccode_node_unref0 (cunary)((cunary == ((void*)0)) ? ((void*)0) : (cunary = (bala_ccode_node_unref (cunary), ((void*)0)))); |
| 6986 | return result; |
| 6987 | } |
| 6988 | } |
| 6989 | _bala_ccode_node_unref0 (cunary)((cunary == ((void*)0)) ? ((void*)0) : (cunary = (bala_ccode_node_unref (cunary), ((void*)0)))); |
| 6990 | } else { |
| 6991 | if (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_MEMBER_ACCESS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_member_access_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 6992 | BalaCCodeMemberAccess* cma = NULL((void*)0); |
| 6993 | BalaCCodeMemberAccess* _tmp16_; |
| 6994 | BalaCCodeMemberAccess* _tmp17_; |
| 6995 | BalaCCodeExpression* _tmp18_; |
| 6996 | BalaCCodeExpression* _tmp19_; |
| 6997 | _tmp16_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_MEMBER_ACCESS, BalaCCodeMemberAccess)(((BalaCCodeMemberAccess*) g_type_check_instance_cast ((GTypeInstance *) (cexpr), ((bala_ccode_member_access_get_type ())))))); |
| 6998 | cma = _tmp16_; |
| 6999 | _tmp17_ = cma; |
| 7000 | _tmp18_ = bala_ccode_member_access_get_inner (_tmp17_); |
| 7001 | _tmp19_ = _tmp18_; |
| 7002 | result = bala_ccode_base_module_is_pure_ccode_expression (_tmp19_); |
| 7003 | _bala_ccode_node_unref0 (cma)((cma == ((void*)0)) ? ((void*)0) : (cma = (bala_ccode_node_unref (cma), ((void*)0)))); |
| 7004 | return result; |
| 7005 | } else { |
| 7006 | if (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_ELEMENT_ACCESS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_element_access_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 7007 | BalaCCodeElementAccess* cea = NULL((void*)0); |
| 7008 | BalaCCodeElementAccess* _tmp20_; |
| 7009 | gboolean _tmp21_ = FALSE(0); |
| 7010 | BalaCCodeElementAccess* _tmp22_; |
| 7011 | BalaCCodeExpression* _tmp23_; |
| 7012 | BalaCCodeExpression* _tmp24_; |
| 7013 | _tmp20_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_ELEMENT_ACCESS, BalaCCodeElementAccess)(((BalaCCodeElementAccess*) g_type_check_instance_cast ((GTypeInstance *) (cexpr), ((bala_ccode_element_access_get_type ())))))); |
| 7014 | cea = _tmp20_; |
| 7015 | _tmp22_ = cea; |
| 7016 | _tmp23_ = bala_ccode_element_access_get_container (_tmp22_); |
| 7017 | _tmp24_ = _tmp23_; |
| 7018 | if (bala_ccode_base_module_is_pure_ccode_expression (_tmp24_)) { |
| 7019 | BalaCCodeElementAccess* _tmp25_; |
| 7020 | BalaList* _tmp26_; |
| 7021 | BalaList* _tmp27_; |
| 7022 | gpointer _tmp28_; |
| 7023 | BalaCCodeExpression* _tmp29_; |
| 7024 | _tmp25_ = cea; |
| 7025 | _tmp26_ = bala_ccode_element_access_get_indices (_tmp25_); |
| 7026 | _tmp27_ = _tmp26_; |
| 7027 | _tmp28_ = bala_list_get (_tmp27_, 0); |
| 7028 | _tmp29_ = (BalaCCodeExpression*) _tmp28_; |
| 7029 | _tmp21_ = bala_ccode_base_module_is_pure_ccode_expression (_tmp29_); |
| 7030 | _bala_ccode_node_unref0 (_tmp29_)((_tmp29_ == ((void*)0)) ? ((void*)0) : (_tmp29_ = (bala_ccode_node_unref (_tmp29_), ((void*)0)))); |
| 7031 | } else { |
| 7032 | _tmp21_ = FALSE(0); |
| 7033 | } |
| 7034 | result = _tmp21_; |
| 7035 | _bala_ccode_node_unref0 (cea)((cea == ((void*)0)) ? ((void*)0) : (cea = (bala_ccode_node_unref (cea), ((void*)0)))); |
| 7036 | return result; |
| 7037 | } else { |
| 7038 | if (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_CAST_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_cast_expression_get_type ()) ); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7039 | BalaCCodeCastExpression* ccast = NULL((void*)0); |
| 7040 | BalaCCodeCastExpression* _tmp30_; |
| 7041 | BalaCCodeCastExpression* _tmp31_; |
| 7042 | BalaCCodeExpression* _tmp32_; |
| 7043 | BalaCCodeExpression* _tmp33_; |
| 7044 | _tmp30_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_CAST_EXPRESSION, BalaCCodeCastExpression)(((BalaCCodeCastExpression*) g_type_check_instance_cast ((GTypeInstance *) (cexpr), ((bala_ccode_cast_expression_get_type ())))))); |
| 7045 | ccast = _tmp30_; |
| 7046 | _tmp31_ = ccast; |
| 7047 | _tmp32_ = bala_ccode_cast_expression_get_inner (_tmp31_); |
| 7048 | _tmp33_ = _tmp32_; |
| 7049 | result = bala_ccode_base_module_is_pure_ccode_expression (_tmp33_); |
| 7050 | _bala_ccode_node_unref0 (ccast)((ccast == ((void*)0)) ? ((void*)0) : (ccast = (bala_ccode_node_unref (ccast), ((void*)0)))); |
| 7051 | return result; |
| 7052 | } else { |
| 7053 | if (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_PARENTHESIZED_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_parenthesized_expression_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7054 | BalaCCodeParenthesizedExpression* cparenthesized = NULL((void*)0); |
| 7055 | BalaCCodeParenthesizedExpression* _tmp34_; |
| 7056 | BalaCCodeParenthesizedExpression* _tmp35_; |
| 7057 | BalaCCodeExpression* _tmp36_; |
| 7058 | BalaCCodeExpression* _tmp37_; |
| 7059 | _tmp34_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_PARENTHESIZED_EXPRESSION, BalaCCodeParenthesizedExpression)(((BalaCCodeParenthesizedExpression*) g_type_check_instance_cast ((GTypeInstance*) (cexpr), ((bala_ccode_parenthesized_expression_get_type ())))))); |
| 7060 | cparenthesized = _tmp34_; |
| 7061 | _tmp35_ = cparenthesized; |
| 7062 | _tmp36_ = bala_ccode_parenthesized_expression_get_inner (_tmp35_); |
| 7063 | _tmp37_ = _tmp36_; |
| 7064 | result = bala_ccode_base_module_is_pure_ccode_expression (_tmp37_); |
| 7065 | _bala_ccode_node_unref0 (cparenthesized)((cparenthesized == ((void*)0)) ? ((void*)0) : (cparenthesized = (bala_ccode_node_unref (cparenthesized), ((void*)0)))); |
| 7066 | return result; |
| 7067 | } |
| 7068 | } |
| 7069 | } |
| 7070 | } |
| 7071 | } |
| 7072 | } |
| 7073 | } |
| 7074 | result = FALSE(0); |
| 7075 | return result; |
| 7076 | } |
| 7077 | |
| 7078 | static void |
| 7079 | bala_ccode_base_module_real_visit_property (BalaCodeVisitor* base, |
| 7080 | BalaProperty* prop) |
| 7081 | { |
| 7082 | BalaCCodeBaseModule * self; |
| 7083 | BalaPropertyAccessor* _tmp0_; |
| 7084 | BalaPropertyAccessor* _tmp1_; |
| 7085 | BalaPropertyAccessor* _tmp4_; |
| 7086 | BalaPropertyAccessor* _tmp5_; |
| 7087 | self = (BalaCCodeBaseModule*) base; |
| 7088 | g_return_if_fail (prop != NULL)do { if ((prop != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "prop != NULL" ); return; } } while (0); |
| 7089 | bala_ccode_base_module_visit_member (self, (BalaSymbol*) prop); |
| 7090 | _tmp0_ = bala_property_get_get_accessor (prop); |
| 7091 | _tmp1_ = _tmp0_; |
| 7092 | if (_tmp1_ != NULL((void*)0)) { |
| 7093 | BalaPropertyAccessor* _tmp2_; |
| 7094 | BalaPropertyAccessor* _tmp3_; |
| 7095 | _tmp2_ = bala_property_get_get_accessor (prop); |
| 7096 | _tmp3_ = _tmp2_; |
| 7097 | bala_code_node_accept ((BalaCodeNode*) _tmp3_, (BalaCodeVisitor*) self); |
| 7098 | } |
| 7099 | _tmp4_ = bala_property_get_set_accessor (prop); |
| 7100 | _tmp5_ = _tmp4_; |
| 7101 | if (_tmp5_ != NULL((void*)0)) { |
| 7102 | BalaPropertyAccessor* _tmp6_; |
| 7103 | BalaPropertyAccessor* _tmp7_; |
| 7104 | _tmp6_ = bala_property_get_set_accessor (prop); |
| 7105 | _tmp7_ = _tmp6_; |
| 7106 | bala_code_node_accept ((BalaCodeNode*) _tmp7_, (BalaCodeVisitor*) self); |
| 7107 | } |
| 7108 | } |
| 7109 | |
| 7110 | void |
| 7111 | bala_ccode_base_module_generate_type_declaration (BalaCCodeBaseModule* self, |
| 7112 | BalaDataType* type, |
| 7113 | BalaCCodeFile* decl_space) |
| 7114 | { |
| 7115 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 7116 | g_return_if_fail (type != NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return; } } while (0); |
| 7117 | g_return_if_fail (decl_space != NULL)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return; } } while (0); |
| 7118 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_OBJECT_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_object_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7119 | BalaObjectType* object_type = NULL((void*)0); |
| 7120 | BalaObjectType* _tmp0_; |
| 7121 | BalaObjectType* _tmp1_; |
| 7122 | BalaTypeSymbol* _tmp2_; |
| 7123 | BalaTypeSymbol* _tmp3_; |
| 7124 | _tmp0_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_OBJECT_TYPE, BalaObjectType)(((BalaObjectType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_object_type_get_type ())))))); |
| 7125 | object_type = _tmp0_; |
| 7126 | _tmp1_ = object_type; |
| 7127 | _tmp2_ = bala_data_type_get_type_symbol ((BalaDataType*) _tmp1_); |
| 7128 | _tmp3_ = _tmp2_; |
| 7129 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7130 | BalaClass* cl = NULL((void*)0); |
| 7131 | BalaObjectType* _tmp4_; |
| 7132 | BalaTypeSymbol* _tmp5_; |
| 7133 | BalaTypeSymbol* _tmp6_; |
| 7134 | BalaClass* _tmp7_; |
| 7135 | BalaClass* _tmp8_; |
| 7136 | gboolean _tmp9_ = FALSE(0); |
| 7137 | BalaClass* _tmp10_; |
| 7138 | gboolean _tmp11_; |
| 7139 | gboolean _tmp12_; |
| 7140 | _tmp4_ = object_type; |
| 7141 | _tmp5_ = bala_data_type_get_type_symbol ((BalaDataType*) _tmp4_); |
| 7142 | _tmp6_ = _tmp5_; |
| 7143 | _tmp7_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp6_), ((bala_class_get_type ())))))); |
| 7144 | cl = _tmp7_; |
| 7145 | _tmp8_ = cl; |
| 7146 | bala_ccode_base_module_generate_class_declaration (self, _tmp8_, decl_space); |
| 7147 | _tmp10_ = cl; |
| 7148 | _tmp11_ = bala_class_get_is_compact (_tmp10_); |
| 7149 | _tmp12_ = _tmp11_; |
| 7150 | if (!_tmp12_) { |
| 7151 | BalaClass* _tmp13_; |
| 7152 | _tmp13_ = cl; |
| 7153 | _tmp9_ = bala_object_type_symbol_has_type_parameters ((BalaObjectTypeSymbol*) _tmp13_); |
| 7154 | } else { |
| 7155 | _tmp9_ = FALSE(0); |
| 7156 | } |
| 7157 | if (_tmp9_) { |
| 7158 | BalaTypeSymbol* _tmp14_; |
| 7159 | _tmp14_ = self->gtype_type; |
| 7160 | bala_ccode_base_module_generate_struct_declaration (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp14_), ((bala_struct_get_type ()))))), decl_space); |
| 7161 | } |
| 7162 | _bala_code_node_unref0 (cl)((cl == ((void*)0)) ? ((void*)0) : (cl = (bala_code_node_unref (cl), ((void*)0)))); |
| 7163 | } else { |
| 7164 | BalaObjectType* _tmp15_; |
| 7165 | BalaTypeSymbol* _tmp16_; |
| 7166 | BalaTypeSymbol* _tmp17_; |
| 7167 | _tmp15_ = object_type; |
| 7168 | _tmp16_ = bala_data_type_get_type_symbol ((BalaDataType*) _tmp15_); |
| 7169 | _tmp17_ = _tmp16_; |
| 7170 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, BALA_TYPE_INTERFACE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp17_); GType __t = ((bala_interface_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7171 | BalaInterface* iface = NULL((void*)0); |
| 7172 | BalaObjectType* _tmp18_; |
| 7173 | BalaTypeSymbol* _tmp19_; |
| 7174 | BalaTypeSymbol* _tmp20_; |
| 7175 | BalaInterface* _tmp21_; |
| 7176 | BalaInterface* _tmp22_; |
| 7177 | BalaInterface* _tmp23_; |
| 7178 | _tmp18_ = object_type; |
| 7179 | _tmp19_ = bala_data_type_get_type_symbol ((BalaDataType*) _tmp18_); |
| 7180 | _tmp20_ = _tmp19_; |
| 7181 | _tmp21_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, BALA_TYPE_INTERFACE, BalaInterface)(((BalaInterface*) g_type_check_instance_cast ((GTypeInstance *) (_tmp20_), ((bala_interface_get_type ())))))); |
| 7182 | iface = _tmp21_; |
| 7183 | _tmp22_ = iface; |
| 7184 | bala_ccode_base_module_generate_interface_declaration (self, _tmp22_, decl_space); |
| 7185 | _tmp23_ = iface; |
| 7186 | if (bala_object_type_symbol_has_type_parameters ((BalaObjectTypeSymbol*) _tmp23_)) { |
| 7187 | BalaTypeSymbol* _tmp24_; |
| 7188 | _tmp24_ = self->gtype_type; |
| 7189 | bala_ccode_base_module_generate_struct_declaration (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp24_), ((bala_struct_get_type ()))))), decl_space); |
| 7190 | } |
| 7191 | _bala_code_node_unref0 (iface)((iface == ((void*)0)) ? ((void*)0) : (iface = (bala_code_node_unref (iface), ((void*)0)))); |
| 7192 | } |
| 7193 | } |
| 7194 | _bala_code_node_unref0 (object_type)((object_type == ((void*)0)) ? ((void*)0) : (object_type = (bala_code_node_unref (object_type), ((void*)0)))); |
| 7195 | } else { |
| 7196 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7197 | BalaDelegateType* deleg_type = NULL((void*)0); |
| 7198 | BalaDelegateType* _tmp25_; |
| 7199 | BalaDelegate* d = NULL((void*)0); |
| 7200 | BalaDelegateType* _tmp26_; |
| 7201 | BalaDelegate* _tmp27_; |
| 7202 | BalaDelegate* _tmp28_; |
| 7203 | BalaDelegate* _tmp29_; |
| 7204 | BalaDelegate* _tmp30_; |
| 7205 | BalaDelegate* _tmp31_; |
| 7206 | gboolean _tmp32_; |
| 7207 | gboolean _tmp33_; |
| 7208 | _tmp25_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_delegate_type_get_type ())))))); |
| 7209 | deleg_type = _tmp25_; |
| 7210 | _tmp26_ = deleg_type; |
| 7211 | _tmp27_ = bala_delegate_type_get_delegate_symbol (_tmp26_); |
| 7212 | _tmp28_ = _tmp27_; |
| 7213 | _tmp29_ = _bala_code_node_ref0 (_tmp28_); |
| 7214 | d = _tmp29_; |
| 7215 | _tmp30_ = d; |
| 7216 | bala_ccode_base_module_generate_delegate_declaration (self, _tmp30_, decl_space); |
| 7217 | _tmp31_ = d; |
| 7218 | _tmp32_ = bala_delegate_get_has_target (_tmp31_); |
| 7219 | _tmp33_ = _tmp32_; |
| 7220 | if (_tmp33_) { |
| 7221 | BalaDataType* _tmp34_; |
| 7222 | BalaDelegateType* _tmp35_; |
| 7223 | _tmp34_ = self->delegate_target_type; |
| 7224 | bala_ccode_base_module_generate_type_declaration (self, _tmp34_, decl_space); |
| 7225 | _tmp35_ = deleg_type; |
| 7226 | if (bala_data_type_is_disposable ((BalaDataType*) _tmp35_)) { |
| 7227 | BalaDelegateType* _tmp36_; |
| 7228 | _tmp36_ = self->delegate_target_destroy_type; |
| 7229 | bala_ccode_base_module_generate_type_declaration (self, (BalaDataType*) _tmp36_, decl_space); |
| 7230 | } |
| 7231 | } |
| 7232 | _bala_code_node_unref0 (d)((d == ((void*)0)) ? ((void*)0) : (d = (bala_code_node_unref ( d), ((void*)0)))); |
| 7233 | _bala_code_node_unref0 (deleg_type)((deleg_type == ((void*)0)) ? ((void*)0) : (deleg_type = (bala_code_node_unref (deleg_type), ((void*)0)))); |
| 7234 | } else { |
| 7235 | BalaTypeSymbol* _tmp37_; |
| 7236 | BalaTypeSymbol* _tmp38_; |
| 7237 | _tmp37_ = bala_data_type_get_type_symbol (type); |
| 7238 | _tmp38_ = _tmp37_; |
| 7239 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp38_, BALA_TYPE_ENUM)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp38_); GType __t = ((bala_enum_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7240 | BalaEnum* en = NULL((void*)0); |
| 7241 | BalaTypeSymbol* _tmp39_; |
| 7242 | BalaTypeSymbol* _tmp40_; |
| 7243 | BalaEnum* _tmp41_; |
| 7244 | BalaEnum* _tmp42_; |
| 7245 | _tmp39_ = bala_data_type_get_type_symbol (type); |
| 7246 | _tmp40_ = _tmp39_; |
| 7247 | _tmp41_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, BALA_TYPE_ENUM, BalaEnum)(((BalaEnum*) g_type_check_instance_cast ((GTypeInstance*) (_tmp40_ ), ((bala_enum_get_type ())))))); |
| 7248 | en = _tmp41_; |
| 7249 | _tmp42_ = en; |
| 7250 | bala_ccode_base_module_generate_enum_declaration (self, _tmp42_, decl_space); |
| 7251 | _bala_code_node_unref0 (en)((en == ((void*)0)) ? ((void*)0) : (en = (bala_code_node_unref (en), ((void*)0)))); |
| 7252 | } else { |
| 7253 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_value_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7254 | BalaValueType* value_type = NULL((void*)0); |
| 7255 | BalaValueType* _tmp43_; |
| 7256 | BalaValueType* _tmp44_; |
| 7257 | BalaTypeSymbol* _tmp45_; |
| 7258 | BalaTypeSymbol* _tmp46_; |
| 7259 | _tmp43_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_VALUE_TYPE, BalaValueType)(((BalaValueType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_value_type_get_type ())))))); |
| 7260 | value_type = _tmp43_; |
| 7261 | _tmp44_ = value_type; |
| 7262 | _tmp45_ = bala_data_type_get_type_symbol ((BalaDataType*) _tmp44_); |
| 7263 | _tmp46_ = _tmp45_; |
| 7264 | bala_ccode_base_module_generate_struct_declaration (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp46_), ((bala_struct_get_type ()))))), decl_space); |
| 7265 | _bala_code_node_unref0 (value_type)((value_type == ((void*)0)) ? ((void*)0) : (value_type = (bala_code_node_unref (value_type), ((void*)0)))); |
| 7266 | } else { |
| 7267 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_array_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7268 | BalaArrayType* array_type = NULL((void*)0); |
| 7269 | BalaArrayType* _tmp47_; |
| 7270 | BalaArrayType* _tmp48_; |
| 7271 | BalaDataType* _tmp49_; |
| 7272 | BalaDataType* _tmp50_; |
| 7273 | BalaArrayType* _tmp51_; |
| 7274 | BalaDataType* _tmp52_; |
| 7275 | BalaDataType* _tmp53_; |
| 7276 | _tmp47_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_array_type_get_type ())))))); |
| 7277 | array_type = _tmp47_; |
| 7278 | _tmp48_ = array_type; |
| 7279 | _tmp49_ = bala_array_type_get_element_type (_tmp48_); |
| 7280 | _tmp50_ = _tmp49_; |
| 7281 | bala_ccode_base_module_generate_type_declaration (self, _tmp50_, decl_space); |
| 7282 | _tmp51_ = array_type; |
| 7283 | _tmp52_ = bala_array_type_get_length_type (_tmp51_); |
| 7284 | _tmp53_ = _tmp52_; |
| 7285 | if (_tmp53_ != NULL((void*)0)) { |
| 7286 | BalaArrayType* _tmp54_; |
| 7287 | BalaDataType* _tmp55_; |
| 7288 | BalaDataType* _tmp56_; |
| 7289 | _tmp54_ = array_type; |
| 7290 | _tmp55_ = bala_array_type_get_length_type (_tmp54_); |
| 7291 | _tmp56_ = _tmp55_; |
| 7292 | bala_ccode_base_module_generate_type_declaration (self, _tmp56_, decl_space); |
| 7293 | } |
| 7294 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 7295 | } else { |
| 7296 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ERROR_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_error_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7297 | BalaErrorType* error_type = NULL((void*)0); |
| 7298 | BalaErrorType* _tmp57_; |
| 7299 | BalaErrorType* _tmp58_; |
| 7300 | BalaErrorDomain* _tmp59_; |
| 7301 | BalaErrorDomain* _tmp60_; |
| 7302 | _tmp57_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_ERROR_TYPE, BalaErrorType)(((BalaErrorType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_error_type_get_type ())))))); |
| 7303 | error_type = _tmp57_; |
| 7304 | _tmp58_ = error_type; |
| 7305 | _tmp59_ = bala_error_type_get_error_domain (_tmp58_); |
| 7306 | _tmp60_ = _tmp59_; |
| 7307 | if (_tmp60_ != NULL((void*)0)) { |
| 7308 | BalaErrorType* _tmp61_; |
| 7309 | BalaErrorDomain* _tmp62_; |
| 7310 | BalaErrorDomain* _tmp63_; |
| 7311 | _tmp61_ = error_type; |
| 7312 | _tmp62_ = bala_error_type_get_error_domain (_tmp61_); |
| 7313 | _tmp63_ = _tmp62_; |
| 7314 | bala_ccode_base_module_generate_error_domain_declaration (self, _tmp63_, decl_space); |
| 7315 | } else { |
| 7316 | BalaClass* _tmp64_; |
| 7317 | _tmp64_ = self->priv->gerror; |
| 7318 | bala_ccode_base_module_generate_class_declaration (self, _tmp64_, decl_space); |
| 7319 | } |
| 7320 | _bala_code_node_unref0 (error_type)((error_type == ((void*)0)) ? ((void*)0) : (error_type = (bala_code_node_unref (error_type), ((void*)0)))); |
| 7321 | } else { |
| 7322 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_POINTER_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_pointer_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7323 | BalaPointerType* pointer_type = NULL((void*)0); |
| 7324 | BalaPointerType* _tmp65_; |
| 7325 | BalaPointerType* _tmp66_; |
| 7326 | BalaDataType* _tmp67_; |
| 7327 | BalaDataType* _tmp68_; |
| 7328 | _tmp65_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_POINTER_TYPE, BalaPointerType)(((BalaPointerType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_pointer_type_get_type ())))))); |
| 7329 | pointer_type = _tmp65_; |
| 7330 | _tmp66_ = pointer_type; |
| 7331 | _tmp67_ = bala_pointer_type_get_base_type (_tmp66_); |
| 7332 | _tmp68_ = _tmp67_; |
| 7333 | bala_ccode_base_module_generate_type_declaration (self, _tmp68_, decl_space); |
| 7334 | _bala_code_node_unref0 (pointer_type)((pointer_type == ((void*)0)) ? ((void*)0) : (pointer_type = ( bala_code_node_unref (pointer_type), ((void*)0)))); |
| 7335 | } else { |
| 7336 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_METHOD_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_method_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7337 | BalaMethod* method = NULL((void*)0); |
| 7338 | BalaMethod* _tmp69_; |
| 7339 | BalaMethod* _tmp70_; |
| 7340 | BalaMethod* _tmp71_; |
| 7341 | gboolean _tmp72_ = FALSE(0); |
| 7342 | BalaMethod* _tmp73_; |
| 7343 | _tmp69_ = bala_method_type_get_method_symbol (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_METHOD_TYPE, BalaMethodType)(((BalaMethodType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_method_type_get_type ())))))); |
| 7344 | _tmp70_ = _tmp69_; |
| 7345 | _tmp71_ = _bala_code_node_ref0 (_tmp70_); |
| 7346 | method = _tmp71_; |
| 7347 | _tmp73_ = method; |
| 7348 | if (bala_method_has_type_parameters (_tmp73_)) { |
| 7349 | BalaMethod* _tmp74_; |
| 7350 | _tmp74_ = method; |
| 7351 | _tmp72_ = !bala_get_ccode_simple_generics (_tmp74_); |
| 7352 | } else { |
| 7353 | _tmp72_ = FALSE(0); |
| 7354 | } |
| 7355 | if (_tmp72_) { |
| 7356 | BalaTypeSymbol* _tmp75_; |
| 7357 | _tmp75_ = self->gtype_type; |
| 7358 | bala_ccode_base_module_generate_struct_declaration (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp75_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp75_), ((bala_struct_get_type ()))))), decl_space); |
| 7359 | } |
| 7360 | _bala_code_node_unref0 (method)((method == ((void*)0)) ? ((void*)0) : (method = (bala_code_node_unref (method), ((void*)0)))); |
| 7361 | } |
| 7362 | } |
| 7363 | } |
| 7364 | } |
| 7365 | } |
| 7366 | } |
| 7367 | } |
| 7368 | } |
| 7369 | { |
| 7370 | BalaList* _type_arg_list = NULL((void*)0); |
| 7371 | BalaList* _tmp76_; |
| 7372 | BalaList* _tmp77_; |
| 7373 | gint _type_arg_size = 0; |
| 7374 | BalaList* _tmp78_; |
| 7375 | gint _tmp79_; |
| 7376 | gint _tmp80_; |
| 7377 | gint _type_arg_index = 0; |
| 7378 | _tmp76_ = bala_data_type_get_type_arguments (type); |
| 7379 | _tmp77_ = _bala_iterable_ref0 (_tmp76_); |
| 7380 | _type_arg_list = _tmp77_; |
| 7381 | _tmp78_ = _type_arg_list; |
| 7382 | _tmp79_ = bala_collection_get_size ((BalaCollection*) _tmp78_); |
| 7383 | _tmp80_ = _tmp79_; |
| 7384 | _type_arg_size = _tmp80_; |
| 7385 | _type_arg_index = -1; |
| 7386 | while (TRUE(!(0))) { |
| 7387 | gint _tmp81_; |
| 7388 | gint _tmp82_; |
| 7389 | BalaDataType* type_arg = NULL((void*)0); |
| 7390 | BalaList* _tmp83_; |
| 7391 | gpointer _tmp84_; |
| 7392 | BalaDataType* _tmp85_; |
| 7393 | _type_arg_index = _type_arg_index + 1; |
| 7394 | _tmp81_ = _type_arg_index; |
| 7395 | _tmp82_ = _type_arg_size; |
| 7396 | if (!(_tmp81_ < _tmp82_)) { |
| 7397 | break; |
| 7398 | } |
| 7399 | _tmp83_ = _type_arg_list; |
| 7400 | _tmp84_ = bala_list_get (_tmp83_, _type_arg_index); |
| 7401 | type_arg = (BalaDataType*) _tmp84_; |
| 7402 | _tmp85_ = type_arg; |
| 7403 | bala_ccode_base_module_generate_type_declaration (self, _tmp85_, decl_space); |
| 7404 | _bala_code_node_unref0 (type_arg)((type_arg == ((void*)0)) ? ((void*)0) : (type_arg = (bala_code_node_unref (type_arg), ((void*)0)))); |
| 7405 | } |
| 7406 | _bala_iterable_unref0 (_type_arg_list)((_type_arg_list == ((void*)0)) ? ((void*)0) : (_type_arg_list = (bala_iterable_unref (_type_arg_list), ((void*)0)))); |
| 7407 | } |
| 7408 | } |
| 7409 | |
| 7410 | static void |
| 7411 | bala_ccode_base_module_real_generate_class_struct_declaration (BalaCCodeBaseModule* self, |
| 7412 | BalaClass* cl, |
| 7413 | BalaCCodeFile* decl_space) |
| 7414 | { |
| 7415 | g_return_if_fail (cl != NULL)do { if ((cl != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "cl != NULL"); return; } } while (0); |
| 7416 | g_return_if_fail (decl_space != NULL)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return; } } while (0); |
| 7417 | } |
| 7418 | |
| 7419 | void |
| 7420 | bala_ccode_base_module_generate_class_struct_declaration (BalaCCodeBaseModule* self, |
| 7421 | BalaClass* cl, |
| 7422 | BalaCCodeFile* decl_space) |
| 7423 | { |
| 7424 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 7425 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->generate_class_struct_declaration (self, cl, decl_space); |
| 7426 | } |
| 7427 | |
| 7428 | static void |
| 7429 | bala_ccode_base_module_real_generate_struct_declaration (BalaCCodeBaseModule* self, |
| 7430 | BalaStruct* st, |
| 7431 | BalaCCodeFile* decl_space) |
| 7432 | { |
| 7433 | g_return_if_fail (st != NULL)do { if ((st != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "st != NULL"); return; } } while (0); |
| 7434 | g_return_if_fail (decl_space != NULL)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return; } } while (0); |
| 7435 | } |
| 7436 | |
| 7437 | void |
| 7438 | bala_ccode_base_module_generate_struct_declaration (BalaCCodeBaseModule* self, |
| 7439 | BalaStruct* st, |
| 7440 | BalaCCodeFile* decl_space) |
| 7441 | { |
| 7442 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 7443 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->generate_struct_declaration (self, st, decl_space); |
| 7444 | } |
| 7445 | |
| 7446 | static void |
| 7447 | bala_ccode_base_module_real_generate_delegate_declaration (BalaCCodeBaseModule* self, |
| 7448 | BalaDelegate* d, |
| 7449 | BalaCCodeFile* decl_space) |
| 7450 | { |
| 7451 | g_return_if_fail (d != NULL)do { if ((d != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "d != NULL"); return ; } } while (0); |
| 7452 | g_return_if_fail (decl_space != NULL)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return; } } while (0); |
| 7453 | } |
| 7454 | |
| 7455 | void |
| 7456 | bala_ccode_base_module_generate_delegate_declaration (BalaCCodeBaseModule* self, |
| 7457 | BalaDelegate* d, |
| 7458 | BalaCCodeFile* decl_space) |
| 7459 | { |
| 7460 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 7461 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->generate_delegate_declaration (self, d, decl_space); |
| 7462 | } |
| 7463 | |
| 7464 | static void |
| 7465 | bala_ccode_base_module_real_generate_cparameters (BalaCCodeBaseModule* self, |
| 7466 | BalaMethod* m, |
| 7467 | BalaCCodeFile* decl_space, |
| 7468 | BalaMap* cparam_map, |
| 7469 | BalaCCodeFunction* func, |
| 7470 | BalaCCodeFunctionDeclarator* vdeclarator, |
| 7471 | BalaMap* carg_map, |
| 7472 | BalaCCodeFunctionCall* vcall, |
| 7473 | gint direction) |
| 7474 | { |
| 7475 | g_return_if_fail (m != NULL)do { if ((m != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "m != NULL"); return ; } } while (0); |
| 7476 | g_return_if_fail (decl_space != NULL)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return; } } while (0); |
| 7477 | g_return_if_fail (cparam_map != NULL)do { if ((cparam_map != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "cparam_map != NULL" ); return; } } while (0); |
| 7478 | g_return_if_fail (func != NULL)do { if ((func != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "func != NULL" ); return; } } while (0); |
| 7479 | } |
| 7480 | |
| 7481 | void |
| 7482 | bala_ccode_base_module_generate_cparameters (BalaCCodeBaseModule* self, |
| 7483 | BalaMethod* m, |
| 7484 | BalaCCodeFile* decl_space, |
| 7485 | BalaMap* cparam_map, |
| 7486 | BalaCCodeFunction* func, |
| 7487 | BalaCCodeFunctionDeclarator* vdeclarator, |
| 7488 | BalaMap* carg_map, |
| 7489 | BalaCCodeFunctionCall* vcall, |
| 7490 | gint direction) |
| 7491 | { |
| 7492 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 7493 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->generate_cparameters (self, m, decl_space, cparam_map, func, vdeclarator, carg_map, vcall, direction); |
| 7494 | } |
| 7495 | |
| 7496 | void |
| 7497 | bala_ccode_base_module_generate_property_accessor_declaration (BalaCCodeBaseModule* self, |
| 7498 | BalaPropertyAccessor* acc, |
| 7499 | BalaCCodeFile* decl_space) |
| 7500 | { |
| 7501 | gchar* _tmp0_; |
| 7502 | gchar* _tmp1_; |
| 7503 | gboolean _tmp2_; |
| 7504 | BalaProperty* prop = NULL((void*)0); |
| 7505 | BalaProperty* _tmp3_; |
| 7506 | BalaProperty* _tmp4_; |
| 7507 | BalaProperty* _tmp5_; |
| 7508 | gboolean _tmp6_ = FALSE(0); |
| 7509 | gboolean _tmp7_; |
| 7510 | gboolean _tmp8_; |
| 7511 | gboolean returns_real_struct = FALSE(0); |
| 7512 | BalaCCodeParameter* cvalueparam = NULL((void*)0); |
| 7513 | BalaDataType* _tmp37_; |
| 7514 | BalaDataType* _tmp38_; |
| 7515 | BalaCCodeFunction* function = NULL((void*)0); |
| 7516 | gboolean _tmp39_ = FALSE(0); |
| 7517 | gboolean _tmp40_; |
| 7518 | gboolean _tmp41_; |
| 7519 | BalaProperty* _tmp52_; |
| 7520 | BalaMemberBinding _tmp53_; |
| 7521 | BalaMemberBinding _tmp54_; |
| 7522 | gboolean _tmp78_ = FALSE(0); |
| 7523 | gboolean _tmp79_ = FALSE(0); |
| 7524 | gboolean _tmp80_; |
| 7525 | gboolean _tmp81_; |
| 7526 | gboolean _tmp86_ = FALSE(0); |
| 7527 | BalaDataType* _tmp87_; |
| 7528 | BalaDataType* _tmp88_; |
| 7529 | BalaProperty* _tmp158_; |
| 7530 | BalaVersionAttribute* _tmp159_; |
| 7531 | BalaVersionAttribute* _tmp160_; |
| 7532 | gboolean _tmp161_; |
| 7533 | gboolean _tmp162_; |
| 7534 | gboolean _tmp170_ = FALSE(0); |
| 7535 | BalaProperty* _tmp171_; |
| 7536 | gboolean _tmp172_; |
| 7537 | gboolean _tmp173_; |
| 7538 | BalaCCodeFunction* _tmp200_; |
| 7539 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 7540 | g_return_if_fail (acc != NULL)do { if ((acc != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "acc != NULL") ; return; } } while (0); |
| 7541 | g_return_if_fail (decl_space != NULL)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return; } } while (0); |
| 7542 | _tmp0_ = bala_get_ccode_name ((BalaCodeNode*) acc); |
| 7543 | _tmp1_ = _tmp0_; |
| 7544 | _tmp2_ = bala_ccode_base_module_add_symbol_declaration (self, decl_space, (BalaSymbol*) acc, _tmp1_); |
| 7545 | _g_free0 (_tmp1_)(_tmp1_ = (g_free (_tmp1_), ((void*)0))); |
| 7546 | if (_tmp2_) { |
| 7547 | return; |
| 7548 | } |
| 7549 | _tmp3_ = bala_property_accessor_get_prop (acc); |
| 7550 | _tmp4_ = _tmp3_; |
| 7551 | _tmp5_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, BALA_TYPE_PROPERTY, BalaProperty)(((BalaProperty*) g_type_check_instance_cast ((GTypeInstance* ) (_tmp4_), ((bala_property_get_type ())))))); |
| 7552 | prop = _tmp5_; |
| 7553 | _tmp7_ = bala_property_accessor_get_readable (acc); |
| 7554 | _tmp8_ = _tmp7_; |
| 7555 | if (_tmp8_) { |
| 7556 | BalaProperty* _tmp9_; |
| 7557 | BalaDataType* _tmp10_; |
| 7558 | BalaDataType* _tmp11_; |
| 7559 | _tmp9_ = prop; |
| 7560 | _tmp10_ = bala_property_get_property_type (_tmp9_); |
| 7561 | _tmp11_ = _tmp10_; |
| 7562 | _tmp6_ = bala_data_type_is_real_non_null_struct_type (_tmp11_); |
| 7563 | } else { |
| 7564 | _tmp6_ = FALSE(0); |
| 7565 | } |
| 7566 | returns_real_struct = _tmp6_; |
| 7567 | if (returns_real_struct) { |
| 7568 | BalaDataType* _tmp12_; |
| 7569 | BalaDataType* _tmp13_; |
| 7570 | gchar* _tmp14_; |
| 7571 | gchar* _tmp15_; |
| 7572 | gchar* _tmp16_; |
| 7573 | gchar* _tmp17_; |
| 7574 | BalaCCodeParameter* _tmp18_; |
| 7575 | _tmp12_ = bala_property_accessor_get_value_type (acc); |
| 7576 | _tmp13_ = _tmp12_; |
| 7577 | _tmp14_ = bala_get_ccode_name ((BalaCodeNode*) _tmp13_); |
| 7578 | _tmp15_ = _tmp14_; |
| 7579 | _tmp16_ = g_strdup_printf ("%s *", _tmp15_); |
| 7580 | _tmp17_ = _tmp16_; |
| 7581 | _tmp18_ = bala_ccode_parameter_new ("result", _tmp17_); |
| 7582 | _bala_ccode_node_unref0 (cvalueparam)((cvalueparam == ((void*)0)) ? ((void*)0) : (cvalueparam = (bala_ccode_node_unref (cvalueparam), ((void*)0)))); |
| 7583 | cvalueparam = _tmp18_; |
| 7584 | _g_free0 (_tmp17_)(_tmp17_ = (g_free (_tmp17_), ((void*)0))); |
| 7585 | _g_free0 (_tmp15_)(_tmp15_ = (g_free (_tmp15_), ((void*)0))); |
| 7586 | } else { |
| 7587 | gboolean _tmp19_ = FALSE(0); |
| 7588 | gboolean _tmp20_; |
| 7589 | gboolean _tmp21_; |
| 7590 | _tmp20_ = bala_property_accessor_get_readable (acc); |
| 7591 | _tmp21_ = _tmp20_; |
| 7592 | if (!_tmp21_) { |
| 7593 | BalaProperty* _tmp22_; |
| 7594 | BalaDataType* _tmp23_; |
| 7595 | BalaDataType* _tmp24_; |
| 7596 | _tmp22_ = prop; |
| 7597 | _tmp23_ = bala_property_get_property_type (_tmp22_); |
| 7598 | _tmp24_ = _tmp23_; |
| 7599 | _tmp19_ = bala_data_type_is_real_non_null_struct_type (_tmp24_); |
| 7600 | } else { |
| 7601 | _tmp19_ = FALSE(0); |
| 7602 | } |
| 7603 | if (_tmp19_) { |
| 7604 | BalaDataType* _tmp25_; |
| 7605 | BalaDataType* _tmp26_; |
| 7606 | gchar* _tmp27_; |
| 7607 | gchar* _tmp28_; |
| 7608 | gchar* _tmp29_; |
| 7609 | gchar* _tmp30_; |
| 7610 | BalaCCodeParameter* _tmp31_; |
| 7611 | _tmp25_ = bala_property_accessor_get_value_type (acc); |
| 7612 | _tmp26_ = _tmp25_; |
| 7613 | _tmp27_ = bala_get_ccode_name ((BalaCodeNode*) _tmp26_); |
| 7614 | _tmp28_ = _tmp27_; |
| 7615 | _tmp29_ = g_strdup_printf ("%s *", _tmp28_); |
| 7616 | _tmp30_ = _tmp29_; |
| 7617 | _tmp31_ = bala_ccode_parameter_new ("value", _tmp30_); |
| 7618 | _bala_ccode_node_unref0 (cvalueparam)((cvalueparam == ((void*)0)) ? ((void*)0) : (cvalueparam = (bala_ccode_node_unref (cvalueparam), ((void*)0)))); |
| 7619 | cvalueparam = _tmp31_; |
| 7620 | _g_free0 (_tmp30_)(_tmp30_ = (g_free (_tmp30_), ((void*)0))); |
| 7621 | _g_free0 (_tmp28_)(_tmp28_ = (g_free (_tmp28_), ((void*)0))); |
| 7622 | } else { |
| 7623 | BalaDataType* _tmp32_; |
| 7624 | BalaDataType* _tmp33_; |
| 7625 | gchar* _tmp34_; |
| 7626 | gchar* _tmp35_; |
| 7627 | BalaCCodeParameter* _tmp36_; |
| 7628 | _tmp32_ = bala_property_accessor_get_value_type (acc); |
| 7629 | _tmp33_ = _tmp32_; |
| 7630 | _tmp34_ = bala_get_ccode_name ((BalaCodeNode*) _tmp33_); |
| 7631 | _tmp35_ = _tmp34_; |
| 7632 | _tmp36_ = bala_ccode_parameter_new ("value", _tmp35_); |
| 7633 | _bala_ccode_node_unref0 (cvalueparam)((cvalueparam == ((void*)0)) ? ((void*)0) : (cvalueparam = (bala_ccode_node_unref (cvalueparam), ((void*)0)))); |
| 7634 | cvalueparam = _tmp36_; |
| 7635 | _g_free0 (_tmp35_)(_tmp35_ = (g_free (_tmp35_), ((void*)0))); |
| 7636 | } |
| 7637 | } |
| 7638 | _tmp37_ = bala_property_accessor_get_value_type (acc); |
| 7639 | _tmp38_ = _tmp37_; |
| 7640 | bala_ccode_base_module_generate_type_declaration (self, _tmp38_, decl_space); |
| 7641 | _tmp40_ = bala_property_accessor_get_readable (acc); |
| 7642 | _tmp41_ = _tmp40_; |
| 7643 | if (_tmp41_) { |
| 7644 | _tmp39_ = !returns_real_struct; |
| 7645 | } else { |
| 7646 | _tmp39_ = FALSE(0); |
| 7647 | } |
| 7648 | if (_tmp39_) { |
| 7649 | gchar* _tmp42_; |
| 7650 | gchar* _tmp43_; |
| 7651 | BalaDataType* _tmp44_; |
| 7652 | BalaDataType* _tmp45_; |
| 7653 | gchar* _tmp46_; |
| 7654 | gchar* _tmp47_; |
| 7655 | BalaCCodeFunction* _tmp48_; |
| 7656 | _tmp42_ = bala_get_ccode_name ((BalaCodeNode*) acc); |
| 7657 | _tmp43_ = _tmp42_; |
| 7658 | _tmp44_ = bala_property_accessor_get_value_type (acc); |
| 7659 | _tmp45_ = _tmp44_; |
| 7660 | _tmp46_ = bala_get_ccode_name ((BalaCodeNode*) _tmp45_); |
| 7661 | _tmp47_ = _tmp46_; |
| 7662 | _tmp48_ = bala_ccode_function_new (_tmp43_, _tmp47_); |
| 7663 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 7664 | function = _tmp48_; |
| 7665 | _g_free0 (_tmp47_)(_tmp47_ = (g_free (_tmp47_), ((void*)0))); |
| 7666 | _g_free0 (_tmp43_)(_tmp43_ = (g_free (_tmp43_), ((void*)0))); |
| 7667 | } else { |
| 7668 | gchar* _tmp49_; |
| 7669 | gchar* _tmp50_; |
| 7670 | BalaCCodeFunction* _tmp51_; |
| 7671 | _tmp49_ = bala_get_ccode_name ((BalaCodeNode*) acc); |
| 7672 | _tmp50_ = _tmp49_; |
| 7673 | _tmp51_ = bala_ccode_function_new (_tmp50_, "void"); |
| 7674 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 7675 | function = _tmp51_; |
| 7676 | _g_free0 (_tmp50_)(_tmp50_ = (g_free (_tmp50_), ((void*)0))); |
| 7677 | } |
| 7678 | _tmp52_ = prop; |
| 7679 | _tmp53_ = bala_property_get_binding (_tmp52_); |
| 7680 | _tmp54_ = _tmp53_; |
| 7681 | if (_tmp54_ == BALA_MEMBER_BINDING_INSTANCE) { |
| 7682 | BalaTypeSymbol* t = NULL((void*)0); |
| 7683 | BalaProperty* _tmp55_; |
| 7684 | BalaSymbol* _tmp56_; |
| 7685 | BalaSymbol* _tmp57_; |
| 7686 | BalaTypeSymbol* _tmp58_; |
| 7687 | BalaDataType* this_type = NULL((void*)0); |
| 7688 | BalaTypeSymbol* _tmp59_; |
| 7689 | BalaDataType* _tmp60_; |
| 7690 | BalaDataType* _tmp61_; |
| 7691 | BalaCCodeParameter* cselfparam = NULL((void*)0); |
| 7692 | BalaDataType* _tmp62_; |
| 7693 | gchar* _tmp63_; |
| 7694 | gchar* _tmp64_; |
| 7695 | BalaCCodeParameter* _tmp65_; |
| 7696 | BalaCCodeParameter* _tmp66_; |
| 7697 | gboolean _tmp67_ = FALSE(0); |
| 7698 | BalaTypeSymbol* _tmp68_; |
| 7699 | BalaCCodeFunction* _tmp76_; |
| 7700 | BalaCCodeParameter* _tmp77_; |
| 7701 | _tmp55_ = prop; |
| 7702 | _tmp56_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp55_); |
| 7703 | _tmp57_ = _tmp56_; |
| 7704 | _tmp58_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp57_), ((bala_typesymbol_get_type ())))))); |
| 7705 | t = _tmp58_; |
| 7706 | _tmp59_ = t; |
| 7707 | _tmp60_ = bala_semantic_analyzer_get_data_type_for_symbol ((BalaSymbol*) _tmp59_); |
| 7708 | this_type = _tmp60_; |
| 7709 | _tmp61_ = this_type; |
| 7710 | bala_ccode_base_module_generate_type_declaration (self, _tmp61_, decl_space); |
| 7711 | _tmp62_ = this_type; |
| 7712 | _tmp63_ = bala_get_ccode_name ((BalaCodeNode*) _tmp62_); |
| 7713 | _tmp64_ = _tmp63_; |
| 7714 | _tmp65_ = bala_ccode_parameter_new ("self", _tmp64_); |
| 7715 | _tmp66_ = _tmp65_; |
| 7716 | _g_free0 (_tmp64_)(_tmp64_ = (g_free (_tmp64_), ((void*)0))); |
| 7717 | cselfparam = _tmp66_; |
| 7718 | _tmp68_ = t; |
| 7719 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp68_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp68_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7720 | BalaTypeSymbol* _tmp69_; |
| 7721 | _tmp69_ = t; |
| 7722 | _tmp67_ = !bala_struct_is_simple_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp69_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp69_), ((bala_struct_get_type ())))))); |
| 7723 | } else { |
| 7724 | _tmp67_ = FALSE(0); |
| 7725 | } |
| 7726 | if (_tmp67_) { |
| 7727 | BalaCCodeParameter* _tmp70_; |
| 7728 | BalaCCodeParameter* _tmp71_; |
| 7729 | const gchar* _tmp72_; |
| 7730 | const gchar* _tmp73_; |
| 7731 | gchar* _tmp74_; |
| 7732 | gchar* _tmp75_; |
| 7733 | _tmp70_ = cselfparam; |
| 7734 | _tmp71_ = cselfparam; |
| 7735 | _tmp72_ = bala_ccode_parameter_get_type_name (_tmp71_); |
| 7736 | _tmp73_ = _tmp72_; |
| 7737 | _tmp74_ = g_strconcat (_tmp73_, "*", NULL((void*)0)); |
| 7738 | _tmp75_ = _tmp74_; |
| 7739 | bala_ccode_parameter_set_type_name (_tmp71_, _tmp75_); |
| 7740 | _g_free0 (_tmp75_)(_tmp75_ = (g_free (_tmp75_), ((void*)0))); |
| 7741 | } |
| 7742 | _tmp76_ = function; |
| 7743 | _tmp77_ = cselfparam; |
| 7744 | bala_ccode_function_add_parameter (_tmp76_, _tmp77_); |
| 7745 | _bala_ccode_node_unref0 (cselfparam)((cselfparam == ((void*)0)) ? ((void*)0) : (cselfparam = (bala_ccode_node_unref (cselfparam), ((void*)0)))); |
| 7746 | _bala_code_node_unref0 (this_type)((this_type == ((void*)0)) ? ((void*)0) : (this_type = (bala_code_node_unref (this_type), ((void*)0)))); |
| 7747 | _bala_code_node_unref0 (t)((t == ((void*)0)) ? ((void*)0) : (t = (bala_code_node_unref ( t), ((void*)0)))); |
| 7748 | } |
| 7749 | _tmp80_ = bala_property_accessor_get_writable (acc); |
| 7750 | _tmp81_ = _tmp80_; |
| 7751 | if (_tmp81_) { |
| 7752 | _tmp79_ = TRUE(!(0)); |
| 7753 | } else { |
| 7754 | gboolean _tmp82_; |
| 7755 | gboolean _tmp83_; |
| 7756 | _tmp82_ = bala_property_accessor_get_construction (acc); |
| 7757 | _tmp83_ = _tmp82_; |
| 7758 | _tmp79_ = _tmp83_; |
| 7759 | } |
| 7760 | if (_tmp79_) { |
| 7761 | _tmp78_ = TRUE(!(0)); |
| 7762 | } else { |
| 7763 | _tmp78_ = returns_real_struct; |
| 7764 | } |
| 7765 | if (_tmp78_) { |
| 7766 | BalaCCodeFunction* _tmp84_; |
| 7767 | BalaCCodeParameter* _tmp85_; |
| 7768 | _tmp84_ = function; |
| 7769 | _tmp85_ = cvalueparam; |
| 7770 | bala_ccode_function_add_parameter (_tmp84_, _tmp85_); |
| 7771 | } |
| 7772 | _tmp87_ = bala_property_accessor_get_value_type (acc); |
| 7773 | _tmp88_ = _tmp87_; |
| 7774 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp88_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp88_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7775 | BalaProperty* _tmp89_; |
| 7776 | _tmp89_ = prop; |
| 7777 | _tmp86_ = bala_get_ccode_array_length ((BalaCodeNode*) _tmp89_); |
| 7778 | } else { |
| 7779 | _tmp86_ = FALSE(0); |
| 7780 | } |
| 7781 | if (_tmp86_) { |
| 7782 | BalaArrayType* array_type = NULL((void*)0); |
| 7783 | BalaDataType* _tmp90_; |
| 7784 | BalaDataType* _tmp91_; |
| 7785 | BalaArrayType* _tmp92_; |
| 7786 | gchar* length_ctype = NULL((void*)0); |
| 7787 | BalaProperty* _tmp93_; |
| 7788 | gchar* _tmp94_; |
| 7789 | _tmp90_ = bala_property_accessor_get_value_type (acc); |
| 7790 | _tmp91_ = _tmp90_; |
| 7791 | _tmp92_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp91_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp91_), ((bala_array_type_get_type ())))))); |
| 7792 | array_type = _tmp92_; |
| 7793 | _tmp93_ = prop; |
| 7794 | _tmp94_ = bala_get_ccode_array_length_type ((BalaCodeNode*) _tmp93_); |
| 7795 | length_ctype = _tmp94_; |
| 7796 | { |
| 7797 | gint dim = 0; |
| 7798 | dim = 1; |
| 7799 | { |
| 7800 | gboolean _tmp95_ = FALSE(0); |
| 7801 | _tmp95_ = TRUE(!(0)); |
| 7802 | while (TRUE(!(0))) { |
| 7803 | BalaArrayType* _tmp97_; |
| 7804 | gint _tmp98_; |
| 7805 | gint _tmp99_; |
| 7806 | const gchar* _tmp100_ = NULL((void*)0); |
| 7807 | gboolean _tmp101_; |
| 7808 | gboolean _tmp102_; |
| 7809 | gchar* _tmp103_ = NULL((void*)0); |
| 7810 | gboolean _tmp104_; |
| 7811 | gboolean _tmp105_; |
| 7812 | BalaCCodeFunction* _tmp110_; |
| 7813 | gchar* _tmp111_; |
| 7814 | gchar* _tmp112_; |
| 7815 | BalaCCodeParameter* _tmp113_; |
| 7816 | BalaCCodeParameter* _tmp114_; |
| 7817 | if (!_tmp95_) { |
| 7818 | gint _tmp96_; |
| 7819 | _tmp96_ = dim; |
| 7820 | dim = _tmp96_ + 1; |
| 7821 | } |
| 7822 | _tmp95_ = FALSE(0); |
| 7823 | _tmp97_ = array_type; |
| 7824 | _tmp98_ = bala_array_type_get_rank (_tmp97_); |
| 7825 | _tmp99_ = _tmp98_; |
| 7826 | if (!(dim <= _tmp99_)) { |
| 7827 | break; |
| 7828 | } |
| 7829 | _tmp101_ = bala_property_accessor_get_readable (acc); |
| 7830 | _tmp102_ = _tmp101_; |
| 7831 | if (_tmp102_) { |
| 7832 | _tmp100_ = "result"; |
| 7833 | } else { |
| 7834 | _tmp100_ = "value"; |
| 7835 | } |
| 7836 | _tmp104_ = bala_property_accessor_get_readable (acc); |
| 7837 | _tmp105_ = _tmp104_; |
| 7838 | if (_tmp105_) { |
| 7839 | const gchar* _tmp106_; |
| 7840 | gchar* _tmp107_; |
| 7841 | _tmp106_ = length_ctype; |
| 7842 | _tmp107_ = g_strconcat (_tmp106_, "*", NULL((void*)0)); |
| 7843 | _g_free0 (_tmp103_)(_tmp103_ = (g_free (_tmp103_), ((void*)0))); |
| 7844 | _tmp103_ = _tmp107_; |
| 7845 | } else { |
| 7846 | const gchar* _tmp108_; |
| 7847 | gchar* _tmp109_; |
| 7848 | _tmp108_ = length_ctype; |
| 7849 | _tmp109_ = g_strdup (_tmp108_); |
| 7850 | _g_free0 (_tmp103_)(_tmp103_ = (g_free (_tmp103_), ((void*)0))); |
| 7851 | _tmp103_ = _tmp109_; |
| 7852 | } |
| 7853 | _tmp110_ = function; |
| 7854 | _tmp111_ = bala_ccode_base_module_get_array_length_cname (self, _tmp100_, dim); |
| 7855 | _tmp112_ = _tmp111_; |
| 7856 | _tmp113_ = bala_ccode_parameter_new (_tmp112_, _tmp103_); |
| 7857 | _tmp114_ = _tmp113_; |
| 7858 | bala_ccode_function_add_parameter (_tmp110_, _tmp114_); |
| 7859 | _bala_ccode_node_unref0 (_tmp114_)((_tmp114_ == ((void*)0)) ? ((void*)0) : (_tmp114_ = (bala_ccode_node_unref (_tmp114_), ((void*)0)))); |
| 7860 | _g_free0 (_tmp112_)(_tmp112_ = (g_free (_tmp112_), ((void*)0))); |
| 7861 | _g_free0 (_tmp103_)(_tmp103_ = (g_free (_tmp103_), ((void*)0))); |
| 7862 | } |
| 7863 | } |
| 7864 | } |
| 7865 | _g_free0 (length_ctype)(length_ctype = (g_free (length_ctype), ((void*)0))); |
| 7866 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 7867 | } else { |
| 7868 | gboolean _tmp115_ = FALSE(0); |
| 7869 | gboolean _tmp116_ = FALSE(0); |
| 7870 | BalaDataType* _tmp117_; |
| 7871 | BalaDataType* _tmp118_; |
| 7872 | _tmp117_ = bala_property_accessor_get_value_type (acc); |
| 7873 | _tmp118_ = _tmp117_; |
| 7874 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp118_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp118_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 7875 | BalaProperty* _tmp119_; |
| 7876 | _tmp119_ = prop; |
| 7877 | _tmp116_ = bala_get_ccode_delegate_target ((BalaCodeNode*) _tmp119_); |
| 7878 | } else { |
| 7879 | _tmp116_ = FALSE(0); |
| 7880 | } |
| 7881 | if (_tmp116_) { |
| 7882 | BalaDataType* _tmp120_; |
| 7883 | BalaDataType* _tmp121_; |
| 7884 | BalaDelegate* _tmp122_; |
| 7885 | BalaDelegate* _tmp123_; |
| 7886 | gboolean _tmp124_; |
| 7887 | gboolean _tmp125_; |
| 7888 | _tmp120_ = bala_property_accessor_get_value_type (acc); |
| 7889 | _tmp121_ = _tmp120_; |
| 7890 | _tmp122_ = bala_delegate_type_get_delegate_symbol (G_TYPE_CHECK_INSTANCE_CAST (_tmp121_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp121_), ((bala_delegate_type_get_type ())))))); |
| 7891 | _tmp123_ = _tmp122_; |
| 7892 | _tmp124_ = bala_delegate_get_has_target (_tmp123_); |
| 7893 | _tmp125_ = _tmp124_; |
| 7894 | _tmp115_ = _tmp125_; |
| 7895 | } else { |
| 7896 | _tmp115_ = FALSE(0); |
| 7897 | } |
| 7898 | if (_tmp115_) { |
| 7899 | const gchar* _tmp126_ = NULL((void*)0); |
| 7900 | gboolean _tmp127_; |
| 7901 | gboolean _tmp128_; |
| 7902 | gchar* _tmp129_ = NULL((void*)0); |
| 7903 | gboolean _tmp130_; |
| 7904 | gboolean _tmp131_; |
| 7905 | BalaCCodeFunction* _tmp138_; |
| 7906 | gchar* _tmp139_; |
| 7907 | gchar* _tmp140_; |
| 7908 | BalaCCodeParameter* _tmp141_; |
| 7909 | BalaCCodeParameter* _tmp142_; |
| 7910 | gboolean _tmp143_ = FALSE(0); |
| 7911 | gboolean _tmp144_; |
| 7912 | gboolean _tmp145_; |
| 7913 | _tmp127_ = bala_property_accessor_get_readable (acc); |
| 7914 | _tmp128_ = _tmp127_; |
| 7915 | if (_tmp128_) { |
| 7916 | _tmp126_ = "result"; |
| 7917 | } else { |
| 7918 | _tmp126_ = "value"; |
| 7919 | } |
| 7920 | _tmp130_ = bala_property_accessor_get_readable (acc); |
| 7921 | _tmp131_ = _tmp130_; |
| 7922 | if (_tmp131_) { |
| 7923 | BalaDataType* _tmp132_; |
| 7924 | gchar* _tmp133_; |
| 7925 | gchar* _tmp134_; |
| 7926 | gchar* _tmp135_; |
| 7927 | _tmp132_ = self->delegate_target_type; |
| 7928 | _tmp133_ = bala_get_ccode_name ((BalaCodeNode*) _tmp132_); |
| 7929 | _tmp134_ = _tmp133_; |
| 7930 | _tmp135_ = g_strconcat (_tmp134_, "*", NULL((void*)0)); |
| 7931 | _g_free0 (_tmp129_)(_tmp129_ = (g_free (_tmp129_), ((void*)0))); |
| 7932 | _tmp129_ = _tmp135_; |
| 7933 | _g_free0 (_tmp134_)(_tmp134_ = (g_free (_tmp134_), ((void*)0))); |
| 7934 | } else { |
| 7935 | BalaDataType* _tmp136_; |
| 7936 | gchar* _tmp137_; |
| 7937 | _tmp136_ = self->delegate_target_type; |
| 7938 | _tmp137_ = bala_get_ccode_name ((BalaCodeNode*) _tmp136_); |
| 7939 | _g_free0 (_tmp129_)(_tmp129_ = (g_free (_tmp129_), ((void*)0))); |
| 7940 | _tmp129_ = _tmp137_; |
| 7941 | } |
| 7942 | _tmp138_ = function; |
| 7943 | _tmp139_ = bala_ccode_base_module_get_delegate_target_cname (self, _tmp126_); |
| 7944 | _tmp140_ = _tmp139_; |
| 7945 | _tmp141_ = bala_ccode_parameter_new (_tmp140_, _tmp129_); |
| 7946 | _tmp142_ = _tmp141_; |
| 7947 | bala_ccode_function_add_parameter (_tmp138_, _tmp142_); |
| 7948 | _bala_ccode_node_unref0 (_tmp142_)((_tmp142_ == ((void*)0)) ? ((void*)0) : (_tmp142_ = (bala_ccode_node_unref (_tmp142_), ((void*)0)))); |
| 7949 | _g_free0 (_tmp140_)(_tmp140_ = (g_free (_tmp140_), ((void*)0))); |
| 7950 | _tmp144_ = bala_property_accessor_get_readable (acc); |
| 7951 | _tmp145_ = _tmp144_; |
| 7952 | if (!_tmp145_) { |
| 7953 | BalaDataType* _tmp146_; |
| 7954 | BalaDataType* _tmp147_; |
| 7955 | gboolean _tmp148_; |
| 7956 | gboolean _tmp149_; |
| 7957 | _tmp146_ = bala_property_accessor_get_value_type (acc); |
| 7958 | _tmp147_ = _tmp146_; |
| 7959 | _tmp148_ = bala_data_type_get_value_owned (_tmp147_); |
| 7960 | _tmp149_ = _tmp148_; |
| 7961 | _tmp143_ = _tmp149_; |
| 7962 | } else { |
| 7963 | _tmp143_ = FALSE(0); |
| 7964 | } |
| 7965 | if (_tmp143_) { |
| 7966 | BalaCCodeFunction* _tmp150_; |
| 7967 | gchar* _tmp151_; |
| 7968 | gchar* _tmp152_; |
| 7969 | BalaDelegateType* _tmp153_; |
| 7970 | gchar* _tmp154_; |
| 7971 | gchar* _tmp155_; |
| 7972 | BalaCCodeParameter* _tmp156_; |
| 7973 | BalaCCodeParameter* _tmp157_; |
| 7974 | _tmp150_ = function; |
| 7975 | _tmp151_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cname (self, "value"); |
| 7976 | _tmp152_ = _tmp151_; |
| 7977 | _tmp153_ = self->delegate_target_destroy_type; |
| 7978 | _tmp154_ = bala_get_ccode_name ((BalaCodeNode*) _tmp153_); |
| 7979 | _tmp155_ = _tmp154_; |
| 7980 | _tmp156_ = bala_ccode_parameter_new (_tmp152_, _tmp155_); |
| 7981 | _tmp157_ = _tmp156_; |
| 7982 | bala_ccode_function_add_parameter (_tmp150_, _tmp157_); |
| 7983 | _bala_ccode_node_unref0 (_tmp157_)((_tmp157_ == ((void*)0)) ? ((void*)0) : (_tmp157_ = (bala_ccode_node_unref (_tmp157_), ((void*)0)))); |
| 7984 | _g_free0 (_tmp155_)(_tmp155_ = (g_free (_tmp155_), ((void*)0))); |
| 7985 | _g_free0 (_tmp152_)(_tmp152_ = (g_free (_tmp152_), ((void*)0))); |
| 7986 | } |
| 7987 | _g_free0 (_tmp129_)(_tmp129_ = (g_free (_tmp129_), ((void*)0))); |
| 7988 | } |
| 7989 | } |
| 7990 | _tmp158_ = prop; |
| 7991 | _tmp159_ = bala_symbol_get_version ((BalaSymbol*) _tmp158_); |
| 7992 | _tmp160_ = _tmp159_; |
| 7993 | _tmp161_ = bala_version_attribute_get_deprecated (_tmp160_); |
| 7994 | _tmp162_ = _tmp161_; |
| 7995 | if (_tmp162_) { |
| 7996 | BalaCodeContext* _tmp163_; |
| 7997 | BalaProfile _tmp164_; |
| 7998 | BalaProfile _tmp165_; |
| 7999 | BalaCCodeFunction* _tmp166_; |
| 8000 | BalaCCodeFunction* _tmp167_; |
| 8001 | BalaCCodeModifiers _tmp168_; |
| 8002 | BalaCCodeModifiers _tmp169_; |
| 8003 | _tmp163_ = self->priv->_context; |
| 8004 | _tmp164_ = bala_code_context_get_profile (_tmp163_); |
| 8005 | _tmp165_ = _tmp164_; |
| 8006 | if (_tmp165_ == BALA_PROFILE_GOBJECT) { |
| 8007 | bala_ccode_file_add_include (decl_space, "glib.h", FALSE(0)); |
| 8008 | } |
| 8009 | _tmp166_ = function; |
| 8010 | _tmp167_ = function; |
| 8011 | _tmp168_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp167_); |
| 8012 | _tmp169_ = _tmp168_; |
| 8013 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp167_, _tmp169_ | BALA_CCODE_MODIFIERS_DEPRECATED); |
| 8014 | } |
| 8015 | _tmp171_ = prop; |
| 8016 | _tmp172_ = bala_property_get_is_abstract (_tmp171_); |
| 8017 | _tmp173_ = _tmp172_; |
| 8018 | if (!_tmp173_) { |
| 8019 | gboolean _tmp174_ = FALSE(0); |
| 8020 | gboolean _tmp175_ = FALSE(0); |
| 8021 | BalaProperty* _tmp176_; |
| 8022 | _tmp176_ = prop; |
| 8023 | if (bala_symbol_is_private_symbol ((BalaSymbol*) _tmp176_)) { |
| 8024 | _tmp175_ = TRUE(!(0)); |
| 8025 | } else { |
| 8026 | gboolean _tmp177_ = FALSE(0); |
| 8027 | gboolean _tmp178_; |
| 8028 | gboolean _tmp179_; |
| 8029 | _tmp178_ = bala_property_accessor_get_readable (acc); |
| 8030 | _tmp179_ = _tmp178_; |
| 8031 | if (!_tmp179_) { |
| 8032 | gboolean _tmp180_; |
| 8033 | gboolean _tmp181_; |
| 8034 | _tmp180_ = bala_property_accessor_get_writable (acc); |
| 8035 | _tmp181_ = _tmp180_; |
| 8036 | _tmp177_ = !_tmp181_; |
| 8037 | } else { |
| 8038 | _tmp177_ = FALSE(0); |
| 8039 | } |
| 8040 | _tmp175_ = _tmp177_; |
| 8041 | } |
| 8042 | if (_tmp175_) { |
| 8043 | _tmp174_ = TRUE(!(0)); |
| 8044 | } else { |
| 8045 | BalaSymbolAccessibility _tmp182_; |
| 8046 | BalaSymbolAccessibility _tmp183_; |
| 8047 | _tmp182_ = bala_symbol_get_access ((BalaSymbol*) acc); |
| 8048 | _tmp183_ = _tmp182_; |
| 8049 | _tmp174_ = _tmp183_ == BALA_SYMBOL_ACCESSIBILITY_PRIVATE; |
| 8050 | } |
| 8051 | _tmp170_ = _tmp174_; |
| 8052 | } else { |
| 8053 | _tmp170_ = FALSE(0); |
| 8054 | } |
| 8055 | if (_tmp170_) { |
| 8056 | BalaCCodeFunction* _tmp184_; |
| 8057 | BalaCCodeFunction* _tmp185_; |
| 8058 | BalaCCodeModifiers _tmp186_; |
| 8059 | BalaCCodeModifiers _tmp187_; |
| 8060 | _tmp184_ = function; |
| 8061 | _tmp185_ = function; |
| 8062 | _tmp186_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp185_); |
| 8063 | _tmp187_ = _tmp186_; |
| 8064 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp185_, _tmp187_ | BALA_CCODE_MODIFIERS_STATIC); |
| 8065 | } else { |
| 8066 | gboolean _tmp188_ = FALSE(0); |
| 8067 | BalaCodeContext* _tmp189_; |
| 8068 | gboolean _tmp190_; |
| 8069 | gboolean _tmp191_; |
| 8070 | _tmp189_ = self->priv->_context; |
| 8071 | _tmp190_ = bala_code_context_get_hide_internal (_tmp189_); |
| 8072 | _tmp191_ = _tmp190_; |
| 8073 | if (_tmp191_) { |
| 8074 | gboolean _tmp192_ = FALSE(0); |
| 8075 | BalaProperty* _tmp193_; |
| 8076 | _tmp193_ = prop; |
| 8077 | if (bala_symbol_is_internal_symbol ((BalaSymbol*) _tmp193_)) { |
| 8078 | _tmp192_ = TRUE(!(0)); |
| 8079 | } else { |
| 8080 | BalaSymbolAccessibility _tmp194_; |
| 8081 | BalaSymbolAccessibility _tmp195_; |
| 8082 | _tmp194_ = bala_symbol_get_access ((BalaSymbol*) acc); |
| 8083 | _tmp195_ = _tmp194_; |
| 8084 | _tmp192_ = _tmp195_ == BALA_SYMBOL_ACCESSIBILITY_INTERNAL; |
| 8085 | } |
| 8086 | _tmp188_ = _tmp192_; |
| 8087 | } else { |
| 8088 | _tmp188_ = FALSE(0); |
| 8089 | } |
| 8090 | if (_tmp188_) { |
| 8091 | BalaCCodeFunction* _tmp196_; |
| 8092 | BalaCCodeFunction* _tmp197_; |
| 8093 | BalaCCodeModifiers _tmp198_; |
| 8094 | BalaCCodeModifiers _tmp199_; |
| 8095 | _tmp196_ = function; |
| 8096 | _tmp197_ = function; |
| 8097 | _tmp198_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp197_); |
| 8098 | _tmp199_ = _tmp198_; |
| 8099 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp197_, _tmp199_ | BALA_CCODE_MODIFIERS_INTERNAL); |
| 8100 | } |
| 8101 | } |
| 8102 | _tmp200_ = function; |
| 8103 | bala_ccode_file_add_function_declaration (decl_space, _tmp200_); |
| 8104 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 8105 | _bala_ccode_node_unref0 (cvalueparam)((cvalueparam == ((void*)0)) ? ((void*)0) : (cvalueparam = (bala_ccode_node_unref (cvalueparam), ((void*)0)))); |
| 8106 | _bala_code_node_unref0 (prop)((prop == ((void*)0)) ? ((void*)0) : (prop = (bala_code_node_unref (prop), ((void*)0)))); |
| 8107 | } |
| 8108 | |
| 8109 | static void |
| 8110 | bala_ccode_base_module_real_visit_property_accessor (BalaCodeVisitor* base, |
| 8111 | BalaPropertyAccessor* acc) |
| 8112 | { |
| 8113 | BalaCCodeBaseModule * self; |
| 8114 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 8115 | BalaCCodeBaseModuleEmitContext* _tmp1_; |
| 8116 | BalaSourceReference* _tmp2_; |
| 8117 | BalaSourceReference* _tmp3_; |
| 8118 | BalaProperty* prop = NULL((void*)0); |
| 8119 | BalaProperty* _tmp4_; |
| 8120 | BalaProperty* _tmp5_; |
| 8121 | BalaProperty* _tmp6_; |
| 8122 | BalaComment* _tmp7_; |
| 8123 | BalaComment* _tmp8_; |
| 8124 | gboolean _tmp16_ = FALSE(0); |
| 8125 | gboolean _tmp17_; |
| 8126 | gboolean _tmp18_; |
| 8127 | gboolean returns_real_struct = FALSE(0); |
| 8128 | BalaLocalVariable* _tmp22_; |
| 8129 | BalaLocalVariable* _tmp23_; |
| 8130 | BalaTypeSymbol* t = NULL((void*)0); |
| 8131 | BalaProperty* _tmp26_; |
| 8132 | BalaSymbol* _tmp27_; |
| 8133 | BalaSymbol* _tmp28_; |
| 8134 | BalaTypeSymbol* _tmp29_; |
| 8135 | gboolean _tmp30_ = FALSE(0); |
| 8136 | gboolean _tmp31_ = FALSE(0); |
| 8137 | BalaProperty* _tmp32_; |
| 8138 | gboolean _tmp33_; |
| 8139 | gboolean _tmp34_; |
| 8140 | BalaSourceFileType _tmp64_; |
| 8141 | BalaSourceFileType _tmp65_; |
| 8142 | BalaDataType* this_type = NULL((void*)0); |
| 8143 | BalaTypeSymbol* _tmp66_; |
| 8144 | BalaDataType* _tmp67_; |
| 8145 | BalaCCodeParameter* cselfparam = NULL((void*)0); |
| 8146 | BalaDataType* _tmp68_; |
| 8147 | gchar* _tmp69_; |
| 8148 | gchar* _tmp70_; |
| 8149 | BalaCCodeParameter* _tmp71_; |
| 8150 | BalaCCodeParameter* _tmp72_; |
| 8151 | gboolean _tmp73_ = FALSE(0); |
| 8152 | BalaTypeSymbol* _tmp74_; |
| 8153 | BalaCCodeParameter* cvalueparam = NULL((void*)0); |
| 8154 | gboolean _tmp107_ = FALSE(0); |
| 8155 | BalaProperty* _tmp108_; |
| 8156 | gboolean _tmp109_; |
| 8157 | gboolean _tmp110_; |
| 8158 | gboolean _tmp408_ = FALSE(0); |
| 8159 | BalaProperty* _tmp409_; |
| 8160 | gboolean _tmp410_; |
| 8161 | gboolean _tmp411_; |
| 8162 | self = (BalaCCodeBaseModule*) base; |
| 8163 | g_return_if_fail (acc != NULL)do { if ((acc != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "acc != NULL") ; return; } } while (0); |
| 8164 | _tmp0_ = bala_ccode_base_module_emit_context_new ((BalaSymbol*) acc); |
| 8165 | _tmp1_ = _tmp0_; |
| 8166 | bala_ccode_base_module_push_context (self, _tmp1_); |
| 8167 | _bala_ccode_base_module_emit_context_unref0 (_tmp1_)((_tmp1_ == ((void*)0)) ? ((void*)0) : (_tmp1_ = (bala_ccode_base_module_emit_context_unref (_tmp1_), ((void*)0)))); |
| 8168 | _tmp2_ = bala_code_node_get_source_reference ((BalaCodeNode*) acc); |
| 8169 | _tmp3_ = _tmp2_; |
| 8170 | bala_ccode_base_module_push_line (self, _tmp3_); |
| 8171 | _tmp4_ = bala_property_accessor_get_prop (acc); |
| 8172 | _tmp5_ = _tmp4_; |
| 8173 | _tmp6_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, BALA_TYPE_PROPERTY, BalaProperty)(((BalaProperty*) g_type_check_instance_cast ((GTypeInstance* ) (_tmp5_), ((bala_property_get_type ())))))); |
| 8174 | prop = _tmp6_; |
| 8175 | _tmp7_ = bala_symbol_get_comment ((BalaSymbol*) acc); |
| 8176 | _tmp8_ = _tmp7_; |
| 8177 | if (_tmp8_ != NULL((void*)0)) { |
| 8178 | BalaCCodeFile* _tmp9_; |
| 8179 | BalaComment* _tmp10_; |
| 8180 | BalaComment* _tmp11_; |
| 8181 | const gchar* _tmp12_; |
| 8182 | const gchar* _tmp13_; |
| 8183 | BalaCCodeComment* _tmp14_; |
| 8184 | BalaCCodeComment* _tmp15_; |
| 8185 | _tmp9_ = self->cfile; |
| 8186 | _tmp10_ = bala_symbol_get_comment ((BalaSymbol*) acc); |
| 8187 | _tmp11_ = _tmp10_; |
| 8188 | _tmp12_ = bala_comment_get_content (_tmp11_); |
| 8189 | _tmp13_ = _tmp12_; |
| 8190 | _tmp14_ = bala_ccode_comment_new (_tmp13_); |
| 8191 | _tmp15_ = _tmp14_; |
| 8192 | bala_ccode_file_add_type_member_definition (_tmp9_, (BalaCCodeNode*) _tmp15_); |
| 8193 | _bala_ccode_node_unref0 (_tmp15_)((_tmp15_ == ((void*)0)) ? ((void*)0) : (_tmp15_ = (bala_ccode_node_unref (_tmp15_), ((void*)0)))); |
| 8194 | } |
| 8195 | _tmp17_ = bala_property_accessor_get_readable (acc); |
| 8196 | _tmp18_ = _tmp17_; |
| 8197 | if (_tmp18_) { |
| 8198 | BalaProperty* _tmp19_; |
| 8199 | BalaDataType* _tmp20_; |
| 8200 | BalaDataType* _tmp21_; |
| 8201 | _tmp19_ = prop; |
| 8202 | _tmp20_ = bala_property_get_property_type (_tmp19_); |
| 8203 | _tmp21_ = _tmp20_; |
| 8204 | _tmp16_ = bala_data_type_is_real_non_null_struct_type (_tmp21_); |
| 8205 | } else { |
| 8206 | _tmp16_ = FALSE(0); |
| 8207 | } |
| 8208 | returns_real_struct = _tmp16_; |
| 8209 | _tmp22_ = bala_subroutine_get_result_var ((BalaSubroutine*) acc); |
| 8210 | _tmp23_ = _tmp22_; |
| 8211 | if (_tmp23_ != NULL((void*)0)) { |
| 8212 | BalaLocalVariable* _tmp24_; |
| 8213 | BalaLocalVariable* _tmp25_; |
| 8214 | _tmp24_ = bala_subroutine_get_result_var ((BalaSubroutine*) acc); |
| 8215 | _tmp25_ = _tmp24_; |
| 8216 | bala_code_node_accept ((BalaCodeNode*) _tmp25_, (BalaCodeVisitor*) self); |
| 8217 | } |
| 8218 | _tmp26_ = prop; |
| 8219 | _tmp27_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp26_); |
| 8220 | _tmp28_ = _tmp27_; |
| 8221 | _tmp29_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp28_), ((bala_typesymbol_get_type ())))))); |
| 8222 | t = _tmp29_; |
| 8223 | _tmp32_ = prop; |
| 8224 | _tmp33_ = bala_property_get_is_abstract (_tmp32_); |
| 8225 | _tmp34_ = _tmp33_; |
| 8226 | if (_tmp34_) { |
| 8227 | _tmp31_ = TRUE(!(0)); |
| 8228 | } else { |
| 8229 | BalaProperty* _tmp35_; |
| 8230 | gboolean _tmp36_; |
| 8231 | gboolean _tmp37_; |
| 8232 | _tmp35_ = prop; |
| 8233 | _tmp36_ = bala_property_get_is_virtual (_tmp35_); |
| 8234 | _tmp37_ = _tmp36_; |
| 8235 | _tmp31_ = _tmp37_; |
| 8236 | } |
| 8237 | if (_tmp31_) { |
| 8238 | _tmp30_ = TRUE(!(0)); |
| 8239 | } else { |
| 8240 | gboolean _tmp38_ = FALSE(0); |
| 8241 | BalaProperty* _tmp39_; |
| 8242 | BalaProperty* _tmp40_; |
| 8243 | BalaProperty* _tmp41_; |
| 8244 | _tmp39_ = prop; |
| 8245 | _tmp40_ = bala_property_get_base_property (_tmp39_); |
| 8246 | _tmp41_ = _tmp40_; |
| 8247 | if (_tmp41_ == NULL((void*)0)) { |
| 8248 | BalaProperty* _tmp42_; |
| 8249 | BalaProperty* _tmp43_; |
| 8250 | BalaProperty* _tmp44_; |
| 8251 | _tmp42_ = prop; |
| 8252 | _tmp43_ = bala_property_get_base_interface_property (_tmp42_); |
| 8253 | _tmp44_ = _tmp43_; |
| 8254 | _tmp38_ = _tmp44_ == NULL((void*)0); |
| 8255 | } else { |
| 8256 | _tmp38_ = FALSE(0); |
| 8257 | } |
| 8258 | _tmp30_ = _tmp38_; |
| 8259 | } |
| 8260 | if (_tmp30_) { |
| 8261 | BalaCCodeFile* _tmp45_; |
| 8262 | gboolean _tmp46_ = FALSE(0); |
| 8263 | gboolean _tmp47_; |
| 8264 | gboolean _tmp48_; |
| 8265 | _tmp45_ = self->cfile; |
| 8266 | bala_ccode_base_module_generate_property_accessor_declaration (self, acc, _tmp45_); |
| 8267 | _tmp47_ = bala_property_accessor_get_readable (acc); |
| 8268 | _tmp48_ = _tmp47_; |
| 8269 | if (_tmp48_) { |
| 8270 | _tmp46_ = TRUE(!(0)); |
| 8271 | } else { |
| 8272 | gboolean _tmp49_; |
| 8273 | gboolean _tmp50_; |
| 8274 | _tmp49_ = bala_property_accessor_get_writable (acc); |
| 8275 | _tmp50_ = _tmp49_; |
| 8276 | _tmp46_ = _tmp50_; |
| 8277 | } |
| 8278 | if (_tmp46_) { |
| 8279 | gboolean _tmp51_ = FALSE(0); |
| 8280 | BalaProperty* _tmp52_; |
| 8281 | gboolean _tmp59_ = FALSE(0); |
| 8282 | BalaProperty* _tmp60_; |
| 8283 | _tmp52_ = prop; |
| 8284 | if (!bala_symbol_is_internal_symbol ((BalaSymbol*) _tmp52_)) { |
| 8285 | gboolean _tmp53_ = FALSE(0); |
| 8286 | BalaSymbolAccessibility _tmp54_; |
| 8287 | BalaSymbolAccessibility _tmp55_; |
| 8288 | _tmp54_ = bala_symbol_get_access ((BalaSymbol*) acc); |
| 8289 | _tmp55_ = _tmp54_; |
| 8290 | if (_tmp55_ == BALA_SYMBOL_ACCESSIBILITY_PUBLIC) { |
| 8291 | _tmp53_ = TRUE(!(0)); |
| 8292 | } else { |
| 8293 | BalaSymbolAccessibility _tmp56_; |
| 8294 | BalaSymbolAccessibility _tmp57_; |
| 8295 | _tmp56_ = bala_symbol_get_access ((BalaSymbol*) acc); |
| 8296 | _tmp57_ = _tmp56_; |
| 8297 | _tmp53_ = _tmp57_ == BALA_SYMBOL_ACCESSIBILITY_PROTECTED; |
| 8298 | } |
| 8299 | _tmp51_ = _tmp53_; |
| 8300 | } else { |
| 8301 | _tmp51_ = FALSE(0); |
| 8302 | } |
| 8303 | if (_tmp51_) { |
| 8304 | BalaCCodeFile* _tmp58_; |
| 8305 | _tmp58_ = self->header_file; |
| 8306 | bala_ccode_base_module_generate_property_accessor_declaration (self, acc, _tmp58_); |
| 8307 | } |
| 8308 | _tmp60_ = prop; |
| 8309 | if (!bala_symbol_is_private_symbol ((BalaSymbol*) _tmp60_)) { |
| 8310 | BalaSymbolAccessibility _tmp61_; |
| 8311 | BalaSymbolAccessibility _tmp62_; |
| 8312 | _tmp61_ = bala_symbol_get_access ((BalaSymbol*) acc); |
| 8313 | _tmp62_ = _tmp61_; |
| 8314 | _tmp59_ = _tmp62_ != BALA_SYMBOL_ACCESSIBILITY_PRIVATE; |
| 8315 | } else { |
| 8316 | _tmp59_ = FALSE(0); |
| 8317 | } |
| 8318 | if (_tmp59_) { |
| 8319 | BalaCCodeFile* _tmp63_; |
| 8320 | _tmp63_ = self->internal_header_file; |
| 8321 | bala_ccode_base_module_generate_property_accessor_declaration (self, acc, _tmp63_); |
| 8322 | } |
| 8323 | } |
| 8324 | } |
| 8325 | _tmp64_ = bala_symbol_get_source_type ((BalaSymbol*) acc); |
| 8326 | _tmp65_ = _tmp64_; |
| 8327 | if (_tmp65_ == BALA_SOURCE_FILE_TYPE_FAST) { |
| 8328 | bala_ccode_base_module_pop_line (self); |
| 8329 | bala_ccode_base_module_pop_context (self); |
| 8330 | _bala_code_node_unref0 (t)((t == ((void*)0)) ? ((void*)0) : (t = (bala_code_node_unref ( t), ((void*)0)))); |
| 8331 | _bala_code_node_unref0 (prop)((prop == ((void*)0)) ? ((void*)0) : (prop = (bala_code_node_unref (prop), ((void*)0)))); |
| 8332 | return; |
| 8333 | } |
| 8334 | _tmp66_ = t; |
| 8335 | _tmp67_ = bala_semantic_analyzer_get_data_type_for_symbol ((BalaSymbol*) _tmp66_); |
| 8336 | this_type = _tmp67_; |
| 8337 | _tmp68_ = this_type; |
| 8338 | _tmp69_ = bala_get_ccode_name ((BalaCodeNode*) _tmp68_); |
| 8339 | _tmp70_ = _tmp69_; |
| 8340 | _tmp71_ = bala_ccode_parameter_new ("self", _tmp70_); |
| 8341 | _tmp72_ = _tmp71_; |
| 8342 | _g_free0 (_tmp70_)(_tmp70_ = (g_free (_tmp70_), ((void*)0))); |
| 8343 | cselfparam = _tmp72_; |
| 8344 | _tmp74_ = t; |
| 8345 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp74_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp74_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 8346 | BalaTypeSymbol* _tmp75_; |
| 8347 | _tmp75_ = t; |
| 8348 | _tmp73_ = !bala_struct_is_simple_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp75_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp75_), ((bala_struct_get_type ())))))); |
| 8349 | } else { |
| 8350 | _tmp73_ = FALSE(0); |
| 8351 | } |
| 8352 | if (_tmp73_) { |
| 8353 | BalaCCodeParameter* _tmp76_; |
| 8354 | BalaCCodeParameter* _tmp77_; |
| 8355 | const gchar* _tmp78_; |
| 8356 | const gchar* _tmp79_; |
| 8357 | gchar* _tmp80_; |
| 8358 | gchar* _tmp81_; |
| 8359 | _tmp76_ = cselfparam; |
| 8360 | _tmp77_ = cselfparam; |
| 8361 | _tmp78_ = bala_ccode_parameter_get_type_name (_tmp77_); |
| 8362 | _tmp79_ = _tmp78_; |
| 8363 | _tmp80_ = g_strconcat (_tmp79_, "*", NULL((void*)0)); |
| 8364 | _tmp81_ = _tmp80_; |
| 8365 | bala_ccode_parameter_set_type_name (_tmp77_, _tmp81_); |
| 8366 | _g_free0 (_tmp81_)(_tmp81_ = (g_free (_tmp81_), ((void*)0))); |
| 8367 | } |
| 8368 | if (returns_real_struct) { |
| 8369 | BalaDataType* _tmp82_; |
| 8370 | BalaDataType* _tmp83_; |
| 8371 | gchar* _tmp84_; |
| 8372 | gchar* _tmp85_; |
| 8373 | gchar* _tmp86_; |
| 8374 | gchar* _tmp87_; |
| 8375 | BalaCCodeParameter* _tmp88_; |
| 8376 | _tmp82_ = bala_property_accessor_get_value_type (acc); |
| 8377 | _tmp83_ = _tmp82_; |
| 8378 | _tmp84_ = bala_get_ccode_name ((BalaCodeNode*) _tmp83_); |
| 8379 | _tmp85_ = _tmp84_; |
| 8380 | _tmp86_ = g_strdup_printf ("%s *", _tmp85_); |
| 8381 | _tmp87_ = _tmp86_; |
| 8382 | _tmp88_ = bala_ccode_parameter_new ("result", _tmp87_); |
| 8383 | _bala_ccode_node_unref0 (cvalueparam)((cvalueparam == ((void*)0)) ? ((void*)0) : (cvalueparam = (bala_ccode_node_unref (cvalueparam), ((void*)0)))); |
| 8384 | cvalueparam = _tmp88_; |
| 8385 | _g_free0 (_tmp87_)(_tmp87_ = (g_free (_tmp87_), ((void*)0))); |
| 8386 | _g_free0 (_tmp85_)(_tmp85_ = (g_free (_tmp85_), ((void*)0))); |
| 8387 | } else { |
| 8388 | gboolean _tmp89_ = FALSE(0); |
| 8389 | gboolean _tmp90_; |
| 8390 | gboolean _tmp91_; |
| 8391 | _tmp90_ = bala_property_accessor_get_readable (acc); |
| 8392 | _tmp91_ = _tmp90_; |
| 8393 | if (!_tmp91_) { |
| 8394 | BalaProperty* _tmp92_; |
| 8395 | BalaDataType* _tmp93_; |
| 8396 | BalaDataType* _tmp94_; |
| 8397 | _tmp92_ = prop; |
| 8398 | _tmp93_ = bala_property_get_property_type (_tmp92_); |
| 8399 | _tmp94_ = _tmp93_; |
| 8400 | _tmp89_ = bala_data_type_is_real_non_null_struct_type (_tmp94_); |
| 8401 | } else { |
| 8402 | _tmp89_ = FALSE(0); |
| 8403 | } |
| 8404 | if (_tmp89_) { |
| 8405 | BalaDataType* _tmp95_; |
| 8406 | BalaDataType* _tmp96_; |
| 8407 | gchar* _tmp97_; |
| 8408 | gchar* _tmp98_; |
| 8409 | gchar* _tmp99_; |
| 8410 | gchar* _tmp100_; |
| 8411 | BalaCCodeParameter* _tmp101_; |
| 8412 | _tmp95_ = bala_property_accessor_get_value_type (acc); |
| 8413 | _tmp96_ = _tmp95_; |
| 8414 | _tmp97_ = bala_get_ccode_name ((BalaCodeNode*) _tmp96_); |
| 8415 | _tmp98_ = _tmp97_; |
| 8416 | _tmp99_ = g_strdup_printf ("%s *", _tmp98_); |
| 8417 | _tmp100_ = _tmp99_; |
| 8418 | _tmp101_ = bala_ccode_parameter_new ("value", _tmp100_); |
| 8419 | _bala_ccode_node_unref0 (cvalueparam)((cvalueparam == ((void*)0)) ? ((void*)0) : (cvalueparam = (bala_ccode_node_unref (cvalueparam), ((void*)0)))); |
| 8420 | cvalueparam = _tmp101_; |
| 8421 | _g_free0 (_tmp100_)(_tmp100_ = (g_free (_tmp100_), ((void*)0))); |
| 8422 | _g_free0 (_tmp98_)(_tmp98_ = (g_free (_tmp98_), ((void*)0))); |
| 8423 | } else { |
| 8424 | BalaDataType* _tmp102_; |
| 8425 | BalaDataType* _tmp103_; |
| 8426 | gchar* _tmp104_; |
| 8427 | gchar* _tmp105_; |
| 8428 | BalaCCodeParameter* _tmp106_; |
| 8429 | _tmp102_ = bala_property_accessor_get_value_type (acc); |
| 8430 | _tmp103_ = _tmp102_; |
| 8431 | _tmp104_ = bala_get_ccode_name ((BalaCodeNode*) _tmp103_); |
| 8432 | _tmp105_ = _tmp104_; |
| 8433 | _tmp106_ = bala_ccode_parameter_new ("value", _tmp105_); |
| 8434 | _bala_ccode_node_unref0 (cvalueparam)((cvalueparam == ((void*)0)) ? ((void*)0) : (cvalueparam = (bala_ccode_node_unref (cvalueparam), ((void*)0)))); |
| 8435 | cvalueparam = _tmp106_; |
| 8436 | _g_free0 (_tmp105_)(_tmp105_ = (g_free (_tmp105_), ((void*)0))); |
| 8437 | } |
| 8438 | } |
| 8439 | _tmp108_ = prop; |
| 8440 | _tmp109_ = bala_property_get_is_abstract (_tmp108_); |
| 8441 | _tmp110_ = _tmp109_; |
| 8442 | if (_tmp110_) { |
| 8443 | _tmp107_ = TRUE(!(0)); |
| 8444 | } else { |
| 8445 | BalaProperty* _tmp111_; |
| 8446 | gboolean _tmp112_; |
| 8447 | gboolean _tmp113_; |
| 8448 | _tmp111_ = prop; |
| 8449 | _tmp112_ = bala_property_get_is_virtual (_tmp111_); |
| 8450 | _tmp113_ = _tmp112_; |
| 8451 | _tmp107_ = _tmp113_; |
| 8452 | } |
| 8453 | if (_tmp107_) { |
| 8454 | BalaCCodeFunction* function = NULL((void*)0); |
| 8455 | gboolean _tmp114_ = FALSE(0); |
| 8456 | gboolean _tmp115_; |
| 8457 | gboolean _tmp116_; |
| 8458 | BalaCCodeFunction* _tmp127_; |
| 8459 | BalaCCodeParameter* _tmp128_; |
| 8460 | gboolean _tmp129_ = FALSE(0); |
| 8461 | gboolean _tmp130_ = FALSE(0); |
| 8462 | gboolean _tmp131_; |
| 8463 | gboolean _tmp132_; |
| 8464 | gboolean _tmp137_ = FALSE(0); |
| 8465 | BalaDataType* _tmp138_; |
| 8466 | BalaDataType* _tmp139_; |
| 8467 | gboolean _tmp209_ = FALSE(0); |
| 8468 | BalaProperty* _tmp210_; |
| 8469 | gboolean _tmp211_; |
| 8470 | gboolean _tmp212_; |
| 8471 | BalaCCodeFunction* _tmp239_; |
| 8472 | BalaProperty* _tmp240_; |
| 8473 | BalaMemberBinding _tmp241_; |
| 8474 | BalaMemberBinding _tmp242_; |
| 8475 | BalaCCodeExpression* vcast = NULL((void*)0); |
| 8476 | BalaProperty* _tmp250_; |
| 8477 | BalaSymbol* _tmp251_; |
| 8478 | BalaSymbol* _tmp252_; |
| 8479 | gboolean _tmp283_; |
| 8480 | gboolean _tmp284_; |
| 8481 | BalaCCodeFile* _tmp406_; |
| 8482 | BalaCCodeFunction* _tmp407_; |
| 8483 | _tmp115_ = bala_property_accessor_get_readable (acc); |
| 8484 | _tmp116_ = _tmp115_; |
| 8485 | if (_tmp116_) { |
| 8486 | _tmp114_ = !returns_real_struct; |
| 8487 | } else { |
| 8488 | _tmp114_ = FALSE(0); |
| 8489 | } |
| 8490 | if (_tmp114_) { |
| 8491 | gchar* _tmp117_; |
| 8492 | gchar* _tmp118_; |
| 8493 | BalaDataType* _tmp119_; |
| 8494 | BalaDataType* _tmp120_; |
| 8495 | gchar* _tmp121_; |
| 8496 | gchar* _tmp122_; |
| 8497 | BalaCCodeFunction* _tmp123_; |
| 8498 | _tmp117_ = bala_get_ccode_name ((BalaCodeNode*) acc); |
| 8499 | _tmp118_ = _tmp117_; |
| 8500 | _tmp119_ = bala_ccode_base_module_get_current_return_type (self); |
| 8501 | _tmp120_ = _tmp119_; |
| 8502 | _tmp121_ = bala_get_ccode_name ((BalaCodeNode*) _tmp120_); |
| 8503 | _tmp122_ = _tmp121_; |
| 8504 | _tmp123_ = bala_ccode_function_new (_tmp118_, _tmp122_); |
| 8505 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 8506 | function = _tmp123_; |
| 8507 | _g_free0 (_tmp122_)(_tmp122_ = (g_free (_tmp122_), ((void*)0))); |
| 8508 | _g_free0 (_tmp118_)(_tmp118_ = (g_free (_tmp118_), ((void*)0))); |
| 8509 | } else { |
| 8510 | gchar* _tmp124_; |
| 8511 | gchar* _tmp125_; |
| 8512 | BalaCCodeFunction* _tmp126_; |
| 8513 | _tmp124_ = bala_get_ccode_name ((BalaCodeNode*) acc); |
| 8514 | _tmp125_ = _tmp124_; |
| 8515 | _tmp126_ = bala_ccode_function_new (_tmp125_, "void"); |
| 8516 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 8517 | function = _tmp126_; |
| 8518 | _g_free0 (_tmp125_)(_tmp125_ = (g_free (_tmp125_), ((void*)0))); |
| 8519 | } |
| 8520 | _tmp127_ = function; |
| 8521 | _tmp128_ = cselfparam; |
| 8522 | bala_ccode_function_add_parameter (_tmp127_, _tmp128_); |
| 8523 | _tmp131_ = bala_property_accessor_get_writable (acc); |
| 8524 | _tmp132_ = _tmp131_; |
| 8525 | if (_tmp132_) { |
| 8526 | _tmp130_ = TRUE(!(0)); |
| 8527 | } else { |
| 8528 | gboolean _tmp133_; |
| 8529 | gboolean _tmp134_; |
| 8530 | _tmp133_ = bala_property_accessor_get_construction (acc); |
| 8531 | _tmp134_ = _tmp133_; |
| 8532 | _tmp130_ = _tmp134_; |
| 8533 | } |
| 8534 | if (_tmp130_) { |
| 8535 | _tmp129_ = TRUE(!(0)); |
| 8536 | } else { |
| 8537 | _tmp129_ = returns_real_struct; |
| 8538 | } |
| 8539 | if (_tmp129_) { |
| 8540 | BalaCCodeFunction* _tmp135_; |
| 8541 | BalaCCodeParameter* _tmp136_; |
| 8542 | _tmp135_ = function; |
| 8543 | _tmp136_ = cvalueparam; |
| 8544 | bala_ccode_function_add_parameter (_tmp135_, _tmp136_); |
| 8545 | } |
| 8546 | _tmp138_ = bala_property_accessor_get_value_type (acc); |
| 8547 | _tmp139_ = _tmp138_; |
| 8548 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp139_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp139_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 8549 | BalaProperty* _tmp140_; |
| 8550 | _tmp140_ = prop; |
| 8551 | _tmp137_ = bala_get_ccode_array_length ((BalaCodeNode*) _tmp140_); |
| 8552 | } else { |
| 8553 | _tmp137_ = FALSE(0); |
| 8554 | } |
| 8555 | if (_tmp137_) { |
| 8556 | BalaArrayType* array_type = NULL((void*)0); |
| 8557 | BalaDataType* _tmp141_; |
| 8558 | BalaDataType* _tmp142_; |
| 8559 | BalaArrayType* _tmp143_; |
| 8560 | gchar* length_ctype = NULL((void*)0); |
| 8561 | BalaProperty* _tmp144_; |
| 8562 | gchar* _tmp145_; |
| 8563 | _tmp141_ = bala_property_accessor_get_value_type (acc); |
| 8564 | _tmp142_ = _tmp141_; |
| 8565 | _tmp143_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp142_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp142_), ((bala_array_type_get_type ())))))); |
| 8566 | array_type = _tmp143_; |
| 8567 | _tmp144_ = prop; |
| 8568 | _tmp145_ = bala_get_ccode_array_length_type ((BalaCodeNode*) _tmp144_); |
| 8569 | length_ctype = _tmp145_; |
| 8570 | { |
| 8571 | gint dim = 0; |
| 8572 | dim = 1; |
| 8573 | { |
| 8574 | gboolean _tmp146_ = FALSE(0); |
| 8575 | _tmp146_ = TRUE(!(0)); |
| 8576 | while (TRUE(!(0))) { |
| 8577 | BalaArrayType* _tmp148_; |
| 8578 | gint _tmp149_; |
| 8579 | gint _tmp150_; |
| 8580 | const gchar* _tmp151_ = NULL((void*)0); |
| 8581 | gboolean _tmp152_; |
| 8582 | gboolean _tmp153_; |
| 8583 | gchar* _tmp154_ = NULL((void*)0); |
| 8584 | gboolean _tmp155_; |
| 8585 | gboolean _tmp156_; |
| 8586 | BalaCCodeFunction* _tmp161_; |
| 8587 | gchar* _tmp162_; |
| 8588 | gchar* _tmp163_; |
| 8589 | BalaCCodeParameter* _tmp164_; |
| 8590 | BalaCCodeParameter* _tmp165_; |
| 8591 | if (!_tmp146_) { |
| 8592 | gint _tmp147_; |
| 8593 | _tmp147_ = dim; |
| 8594 | dim = _tmp147_ + 1; |
| 8595 | } |
| 8596 | _tmp146_ = FALSE(0); |
| 8597 | _tmp148_ = array_type; |
| 8598 | _tmp149_ = bala_array_type_get_rank (_tmp148_); |
| 8599 | _tmp150_ = _tmp149_; |
| 8600 | if (!(dim <= _tmp150_)) { |
| 8601 | break; |
| 8602 | } |
| 8603 | _tmp152_ = bala_property_accessor_get_readable (acc); |
| 8604 | _tmp153_ = _tmp152_; |
| 8605 | if (_tmp153_) { |
| 8606 | _tmp151_ = "result"; |
| 8607 | } else { |
| 8608 | _tmp151_ = "value"; |
| 8609 | } |
| 8610 | _tmp155_ = bala_property_accessor_get_readable (acc); |
| 8611 | _tmp156_ = _tmp155_; |
| 8612 | if (_tmp156_) { |
| 8613 | const gchar* _tmp157_; |
| 8614 | gchar* _tmp158_; |
| 8615 | _tmp157_ = length_ctype; |
| 8616 | _tmp158_ = g_strconcat (_tmp157_, "*", NULL((void*)0)); |
| 8617 | _g_free0 (_tmp154_)(_tmp154_ = (g_free (_tmp154_), ((void*)0))); |
| 8618 | _tmp154_ = _tmp158_; |
| 8619 | } else { |
| 8620 | const gchar* _tmp159_; |
| 8621 | gchar* _tmp160_; |
| 8622 | _tmp159_ = length_ctype; |
| 8623 | _tmp160_ = g_strdup (_tmp159_); |
| 8624 | _g_free0 (_tmp154_)(_tmp154_ = (g_free (_tmp154_), ((void*)0))); |
| 8625 | _tmp154_ = _tmp160_; |
| 8626 | } |
| 8627 | _tmp161_ = function; |
| 8628 | _tmp162_ = bala_ccode_base_module_get_array_length_cname (self, _tmp151_, dim); |
| 8629 | _tmp163_ = _tmp162_; |
| 8630 | _tmp164_ = bala_ccode_parameter_new (_tmp163_, _tmp154_); |
| 8631 | _tmp165_ = _tmp164_; |
| 8632 | bala_ccode_function_add_parameter (_tmp161_, _tmp165_); |
| 8633 | _bala_ccode_node_unref0 (_tmp165_)((_tmp165_ == ((void*)0)) ? ((void*)0) : (_tmp165_ = (bala_ccode_node_unref (_tmp165_), ((void*)0)))); |
| 8634 | _g_free0 (_tmp163_)(_tmp163_ = (g_free (_tmp163_), ((void*)0))); |
| 8635 | _g_free0 (_tmp154_)(_tmp154_ = (g_free (_tmp154_), ((void*)0))); |
| 8636 | } |
| 8637 | } |
| 8638 | } |
| 8639 | _g_free0 (length_ctype)(length_ctype = (g_free (length_ctype), ((void*)0))); |
| 8640 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 8641 | } else { |
| 8642 | gboolean _tmp166_ = FALSE(0); |
| 8643 | gboolean _tmp167_ = FALSE(0); |
| 8644 | BalaDataType* _tmp168_; |
| 8645 | BalaDataType* _tmp169_; |
| 8646 | _tmp168_ = bala_property_accessor_get_value_type (acc); |
| 8647 | _tmp169_ = _tmp168_; |
| 8648 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp169_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp169_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 8649 | BalaProperty* _tmp170_; |
| 8650 | _tmp170_ = prop; |
| 8651 | _tmp167_ = bala_get_ccode_delegate_target ((BalaCodeNode*) _tmp170_); |
| 8652 | } else { |
| 8653 | _tmp167_ = FALSE(0); |
| 8654 | } |
| 8655 | if (_tmp167_) { |
| 8656 | BalaDataType* _tmp171_; |
| 8657 | BalaDataType* _tmp172_; |
| 8658 | BalaDelegate* _tmp173_; |
| 8659 | BalaDelegate* _tmp174_; |
| 8660 | gboolean _tmp175_; |
| 8661 | gboolean _tmp176_; |
| 8662 | _tmp171_ = bala_property_accessor_get_value_type (acc); |
| 8663 | _tmp172_ = _tmp171_; |
| 8664 | _tmp173_ = bala_delegate_type_get_delegate_symbol (G_TYPE_CHECK_INSTANCE_CAST (_tmp172_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp172_), ((bala_delegate_type_get_type ())))))); |
| 8665 | _tmp174_ = _tmp173_; |
| 8666 | _tmp175_ = bala_delegate_get_has_target (_tmp174_); |
| 8667 | _tmp176_ = _tmp175_; |
| 8668 | _tmp166_ = _tmp176_; |
| 8669 | } else { |
| 8670 | _tmp166_ = FALSE(0); |
| 8671 | } |
| 8672 | if (_tmp166_) { |
| 8673 | const gchar* _tmp177_ = NULL((void*)0); |
| 8674 | gboolean _tmp178_; |
| 8675 | gboolean _tmp179_; |
| 8676 | gchar* _tmp180_ = NULL((void*)0); |
| 8677 | gboolean _tmp181_; |
| 8678 | gboolean _tmp182_; |
| 8679 | BalaCCodeFunction* _tmp189_; |
| 8680 | gchar* _tmp190_; |
| 8681 | gchar* _tmp191_; |
| 8682 | BalaCCodeParameter* _tmp192_; |
| 8683 | BalaCCodeParameter* _tmp193_; |
| 8684 | gboolean _tmp194_ = FALSE(0); |
| 8685 | gboolean _tmp195_; |
| 8686 | gboolean _tmp196_; |
| 8687 | _tmp178_ = bala_property_accessor_get_readable (acc); |
| 8688 | _tmp179_ = _tmp178_; |
| 8689 | if (_tmp179_) { |
| 8690 | _tmp177_ = "result"; |
| 8691 | } else { |
| 8692 | _tmp177_ = "value"; |
| 8693 | } |
| 8694 | _tmp181_ = bala_property_accessor_get_readable (acc); |
| 8695 | _tmp182_ = _tmp181_; |
| 8696 | if (_tmp182_) { |
| 8697 | BalaDataType* _tmp183_; |
| 8698 | gchar* _tmp184_; |
| 8699 | gchar* _tmp185_; |
| 8700 | gchar* _tmp186_; |
| 8701 | _tmp183_ = self->delegate_target_type; |
| 8702 | _tmp184_ = bala_get_ccode_name ((BalaCodeNode*) _tmp183_); |
| 8703 | _tmp185_ = _tmp184_; |
| 8704 | _tmp186_ = g_strconcat (_tmp185_, "*", NULL((void*)0)); |
| 8705 | _g_free0 (_tmp180_)(_tmp180_ = (g_free (_tmp180_), ((void*)0))); |
| 8706 | _tmp180_ = _tmp186_; |
| 8707 | _g_free0 (_tmp185_)(_tmp185_ = (g_free (_tmp185_), ((void*)0))); |
| 8708 | } else { |
| 8709 | BalaDataType* _tmp187_; |
| 8710 | gchar* _tmp188_; |
| 8711 | _tmp187_ = self->delegate_target_type; |
| 8712 | _tmp188_ = bala_get_ccode_name ((BalaCodeNode*) _tmp187_); |
| 8713 | _g_free0 (_tmp180_)(_tmp180_ = (g_free (_tmp180_), ((void*)0))); |
| 8714 | _tmp180_ = _tmp188_; |
| 8715 | } |
| 8716 | _tmp189_ = function; |
| 8717 | _tmp190_ = bala_ccode_base_module_get_delegate_target_cname (self, _tmp177_); |
| 8718 | _tmp191_ = _tmp190_; |
| 8719 | _tmp192_ = bala_ccode_parameter_new (_tmp191_, _tmp180_); |
| 8720 | _tmp193_ = _tmp192_; |
| 8721 | bala_ccode_function_add_parameter (_tmp189_, _tmp193_); |
| 8722 | _bala_ccode_node_unref0 (_tmp193_)((_tmp193_ == ((void*)0)) ? ((void*)0) : (_tmp193_ = (bala_ccode_node_unref (_tmp193_), ((void*)0)))); |
| 8723 | _g_free0 (_tmp191_)(_tmp191_ = (g_free (_tmp191_), ((void*)0))); |
| 8724 | _tmp195_ = bala_property_accessor_get_readable (acc); |
| 8725 | _tmp196_ = _tmp195_; |
| 8726 | if (!_tmp196_) { |
| 8727 | BalaDataType* _tmp197_; |
| 8728 | BalaDataType* _tmp198_; |
| 8729 | gboolean _tmp199_; |
| 8730 | gboolean _tmp200_; |
| 8731 | _tmp197_ = bala_property_accessor_get_value_type (acc); |
| 8732 | _tmp198_ = _tmp197_; |
| 8733 | _tmp199_ = bala_data_type_get_value_owned (_tmp198_); |
| 8734 | _tmp200_ = _tmp199_; |
| 8735 | _tmp194_ = _tmp200_; |
| 8736 | } else { |
| 8737 | _tmp194_ = FALSE(0); |
| 8738 | } |
| 8739 | if (_tmp194_) { |
| 8740 | BalaCCodeFunction* _tmp201_; |
| 8741 | gchar* _tmp202_; |
| 8742 | gchar* _tmp203_; |
| 8743 | BalaDelegateType* _tmp204_; |
| 8744 | gchar* _tmp205_; |
| 8745 | gchar* _tmp206_; |
| 8746 | BalaCCodeParameter* _tmp207_; |
| 8747 | BalaCCodeParameter* _tmp208_; |
| 8748 | _tmp201_ = function; |
| 8749 | _tmp202_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cname (self, "value"); |
| 8750 | _tmp203_ = _tmp202_; |
| 8751 | _tmp204_ = self->delegate_target_destroy_type; |
| 8752 | _tmp205_ = bala_get_ccode_name ((BalaCodeNode*) _tmp204_); |
| 8753 | _tmp206_ = _tmp205_; |
| 8754 | _tmp207_ = bala_ccode_parameter_new (_tmp203_, _tmp206_); |
| 8755 | _tmp208_ = _tmp207_; |
| 8756 | bala_ccode_function_add_parameter (_tmp201_, _tmp208_); |
| 8757 | _bala_ccode_node_unref0 (_tmp208_)((_tmp208_ == ((void*)0)) ? ((void*)0) : (_tmp208_ = (bala_ccode_node_unref (_tmp208_), ((void*)0)))); |
| 8758 | _g_free0 (_tmp206_)(_tmp206_ = (g_free (_tmp206_), ((void*)0))); |
| 8759 | _g_free0 (_tmp203_)(_tmp203_ = (g_free (_tmp203_), ((void*)0))); |
| 8760 | } |
| 8761 | _g_free0 (_tmp180_)(_tmp180_ = (g_free (_tmp180_), ((void*)0))); |
| 8762 | } |
| 8763 | } |
| 8764 | _tmp210_ = prop; |
| 8765 | _tmp211_ = bala_property_get_is_abstract (_tmp210_); |
| 8766 | _tmp212_ = _tmp211_; |
| 8767 | if (!_tmp212_) { |
| 8768 | gboolean _tmp213_ = FALSE(0); |
| 8769 | gboolean _tmp214_ = FALSE(0); |
| 8770 | BalaProperty* _tmp215_; |
| 8771 | _tmp215_ = prop; |
| 8772 | if (bala_symbol_is_private_symbol ((BalaSymbol*) _tmp215_)) { |
| 8773 | _tmp214_ = TRUE(!(0)); |
| 8774 | } else { |
| 8775 | gboolean _tmp216_ = FALSE(0); |
| 8776 | gboolean _tmp217_; |
| 8777 | gboolean _tmp218_; |
| 8778 | _tmp217_ = bala_property_accessor_get_readable (acc); |
| 8779 | _tmp218_ = _tmp217_; |
| 8780 | if (_tmp218_) { |
| 8781 | _tmp216_ = TRUE(!(0)); |
| 8782 | } else { |
| 8783 | gboolean _tmp219_; |
| 8784 | gboolean _tmp220_; |
| 8785 | _tmp219_ = bala_property_accessor_get_writable (acc); |
| 8786 | _tmp220_ = _tmp219_; |
| 8787 | _tmp216_ = _tmp220_; |
| 8788 | } |
| 8789 | _tmp214_ = !_tmp216_; |
| 8790 | } |
| 8791 | if (_tmp214_) { |
| 8792 | _tmp213_ = TRUE(!(0)); |
| 8793 | } else { |
| 8794 | BalaSymbolAccessibility _tmp221_; |
| 8795 | BalaSymbolAccessibility _tmp222_; |
| 8796 | _tmp221_ = bala_symbol_get_access ((BalaSymbol*) acc); |
| 8797 | _tmp222_ = _tmp221_; |
| 8798 | _tmp213_ = _tmp222_ == BALA_SYMBOL_ACCESSIBILITY_PRIVATE; |
| 8799 | } |
| 8800 | _tmp209_ = _tmp213_; |
| 8801 | } else { |
| 8802 | _tmp209_ = FALSE(0); |
| 8803 | } |
| 8804 | if (_tmp209_) { |
| 8805 | BalaCCodeFunction* _tmp223_; |
| 8806 | BalaCCodeFunction* _tmp224_; |
| 8807 | BalaCCodeModifiers _tmp225_; |
| 8808 | BalaCCodeModifiers _tmp226_; |
| 8809 | _tmp223_ = function; |
| 8810 | _tmp224_ = function; |
| 8811 | _tmp225_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp224_); |
| 8812 | _tmp226_ = _tmp225_; |
| 8813 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp224_, _tmp226_ | BALA_CCODE_MODIFIERS_STATIC); |
| 8814 | } else { |
| 8815 | gboolean _tmp227_ = FALSE(0); |
| 8816 | BalaCodeContext* _tmp228_; |
| 8817 | gboolean _tmp229_; |
| 8818 | gboolean _tmp230_; |
| 8819 | _tmp228_ = self->priv->_context; |
| 8820 | _tmp229_ = bala_code_context_get_hide_internal (_tmp228_); |
| 8821 | _tmp230_ = _tmp229_; |
| 8822 | if (_tmp230_) { |
| 8823 | gboolean _tmp231_ = FALSE(0); |
| 8824 | BalaProperty* _tmp232_; |
| 8825 | _tmp232_ = prop; |
| 8826 | if (bala_symbol_is_internal_symbol ((BalaSymbol*) _tmp232_)) { |
| 8827 | _tmp231_ = TRUE(!(0)); |
| 8828 | } else { |
| 8829 | BalaSymbolAccessibility _tmp233_; |
| 8830 | BalaSymbolAccessibility _tmp234_; |
| 8831 | _tmp233_ = bala_symbol_get_access ((BalaSymbol*) acc); |
| 8832 | _tmp234_ = _tmp233_; |
| 8833 | _tmp231_ = _tmp234_ == BALA_SYMBOL_ACCESSIBILITY_INTERNAL; |
| 8834 | } |
| 8835 | _tmp227_ = _tmp231_; |
| 8836 | } else { |
| 8837 | _tmp227_ = FALSE(0); |
| 8838 | } |
| 8839 | if (_tmp227_) { |
| 8840 | BalaCCodeFunction* _tmp235_; |
| 8841 | BalaCCodeFunction* _tmp236_; |
| 8842 | BalaCCodeModifiers _tmp237_; |
| 8843 | BalaCCodeModifiers _tmp238_; |
| 8844 | _tmp235_ = function; |
| 8845 | _tmp236_ = function; |
| 8846 | _tmp237_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp236_); |
| 8847 | _tmp238_ = _tmp237_; |
| 8848 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp236_, _tmp238_ | BALA_CCODE_MODIFIERS_INTERNAL); |
| 8849 | } |
| 8850 | } |
| 8851 | _tmp239_ = function; |
| 8852 | bala_ccode_base_module_push_function (self, _tmp239_); |
| 8853 | _tmp240_ = prop; |
| 8854 | _tmp241_ = bala_property_get_binding (_tmp240_); |
| 8855 | _tmp242_ = _tmp241_; |
| 8856 | if (_tmp242_ == BALA_MEMBER_BINDING_INSTANCE) { |
| 8857 | gboolean _tmp243_ = FALSE(0); |
| 8858 | gboolean _tmp244_; |
| 8859 | gboolean _tmp245_; |
| 8860 | _tmp244_ = bala_property_accessor_get_readable (acc); |
| 8861 | _tmp245_ = _tmp244_; |
| 8862 | if (!_tmp245_) { |
| 8863 | _tmp243_ = TRUE(!(0)); |
| 8864 | } else { |
| 8865 | _tmp243_ = returns_real_struct; |
| 8866 | } |
| 8867 | if (_tmp243_) { |
| 8868 | BalaProperty* _tmp246_; |
| 8869 | BalaTypeSymbol* _tmp247_; |
| 8870 | _tmp246_ = prop; |
| 8871 | _tmp247_ = t; |
| 8872 | bala_ccode_base_module_create_property_type_check_statement (self, _tmp246_, FALSE(0), _tmp247_, TRUE(!(0)), "self"); |
| 8873 | } else { |
| 8874 | BalaProperty* _tmp248_; |
| 8875 | BalaTypeSymbol* _tmp249_; |
| 8876 | _tmp248_ = prop; |
| 8877 | _tmp249_ = t; |
| 8878 | bala_ccode_base_module_create_property_type_check_statement (self, _tmp248_, TRUE(!(0)), _tmp249_, TRUE(!(0)), "self"); |
| 8879 | } |
| 8880 | } |
| 8881 | _tmp250_ = prop; |
| 8882 | _tmp251_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp250_); |
| 8883 | _tmp252_ = _tmp251_; |
| 8884 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp252_, BALA_TYPE_INTERFACE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp252_); GType __t = ((bala_interface_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 8885 | BalaInterface* iface = NULL((void*)0); |
| 8886 | BalaProperty* _tmp253_; |
| 8887 | BalaSymbol* _tmp254_; |
| 8888 | BalaSymbol* _tmp255_; |
| 8889 | BalaInterface* _tmp256_; |
| 8890 | BalaInterface* _tmp257_; |
| 8891 | gchar* _tmp258_; |
| 8892 | gchar* _tmp259_; |
| 8893 | BalaCCodeIdentifier* _tmp260_; |
| 8894 | BalaCCodeIdentifier* _tmp261_; |
| 8895 | BalaCCodeFunctionCall* _tmp262_; |
| 8896 | BalaCCodeExpression* _tmp263_; |
| 8897 | BalaCCodeIdentifier* _tmp264_; |
| 8898 | BalaCCodeIdentifier* _tmp265_; |
| 8899 | _tmp253_ = prop; |
| 8900 | _tmp254_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp253_); |
| 8901 | _tmp255_ = _tmp254_; |
| 8902 | _tmp256_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp255_, BALA_TYPE_INTERFACE, BalaInterface)(((BalaInterface*) g_type_check_instance_cast ((GTypeInstance *) (_tmp255_), ((bala_interface_get_type ())))))); |
| 8903 | iface = _tmp256_; |
| 8904 | _tmp257_ = iface; |
| 8905 | _tmp258_ = bala_get_ccode_type_get_function ((BalaObjectTypeSymbol*) _tmp257_); |
| 8906 | _tmp259_ = _tmp258_; |
| 8907 | _tmp260_ = bala_ccode_identifier_new (_tmp259_); |
| 8908 | _tmp261_ = _tmp260_; |
| 8909 | _tmp262_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp261_); |
| 8910 | _bala_ccode_node_unref0 (vcast)((vcast == ((void*)0)) ? ((void*)0) : (vcast = (bala_ccode_node_unref (vcast), ((void*)0)))); |
| 8911 | vcast = (BalaCCodeExpression*) _tmp262_; |
| 8912 | _bala_ccode_node_unref0 (_tmp261_)((_tmp261_ == ((void*)0)) ? ((void*)0) : (_tmp261_ = (bala_ccode_node_unref (_tmp261_), ((void*)0)))); |
| 8913 | _g_free0 (_tmp259_)(_tmp259_ = (g_free (_tmp259_), ((void*)0))); |
| 8914 | _tmp263_ = vcast; |
| 8915 | _tmp264_ = bala_ccode_identifier_new ("self"); |
| 8916 | _tmp265_ = _tmp264_; |
| 8917 | bala_ccode_function_call_add_argument (G_TYPE_CHECK_INSTANCE_CAST (_tmp263_, BALA_TYPE_CCODE_FUNCTION_CALL, BalaCCodeFunctionCall)(((BalaCCodeFunctionCall*) g_type_check_instance_cast ((GTypeInstance *) (_tmp263_), ((bala_ccode_function_call_get_type ()))))), (BalaCCodeExpression*) _tmp265_); |
| 8918 | _bala_ccode_node_unref0 (_tmp265_)((_tmp265_ == ((void*)0)) ? ((void*)0) : (_tmp265_ = (bala_ccode_node_unref (_tmp265_), ((void*)0)))); |
| 8919 | _bala_code_node_unref0 (iface)((iface == ((void*)0)) ? ((void*)0) : (iface = (bala_code_node_unref (iface), ((void*)0)))); |
| 8920 | } else { |
| 8921 | BalaClass* cl = NULL((void*)0); |
| 8922 | BalaProperty* _tmp266_; |
| 8923 | BalaSymbol* _tmp267_; |
| 8924 | BalaSymbol* _tmp268_; |
| 8925 | BalaClass* _tmp269_; |
| 8926 | BalaClass* _tmp270_; |
| 8927 | gboolean _tmp271_; |
| 8928 | gboolean _tmp272_; |
| 8929 | _tmp266_ = prop; |
| 8930 | _tmp267_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp266_); |
| 8931 | _tmp268_ = _tmp267_; |
| 8932 | _tmp269_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp268_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp268_), ((bala_class_get_type ())))))); |
| 8933 | cl = _tmp269_; |
| 8934 | _tmp270_ = cl; |
| 8935 | _tmp271_ = bala_class_get_is_compact (_tmp270_); |
| 8936 | _tmp272_ = _tmp271_; |
| 8937 | if (!_tmp272_) { |
| 8938 | BalaClass* _tmp273_; |
| 8939 | gchar* _tmp274_; |
| 8940 | gchar* _tmp275_; |
| 8941 | BalaCCodeIdentifier* _tmp276_; |
| 8942 | BalaCCodeIdentifier* _tmp277_; |
| 8943 | BalaCCodeFunctionCall* _tmp278_; |
| 8944 | BalaCCodeExpression* _tmp279_; |
| 8945 | BalaCCodeIdentifier* _tmp280_; |
| 8946 | BalaCCodeIdentifier* _tmp281_; |
| 8947 | _tmp273_ = cl; |
| 8948 | _tmp274_ = bala_get_ccode_type_get_function ((BalaObjectTypeSymbol*) _tmp273_); |
| 8949 | _tmp275_ = _tmp274_; |
| 8950 | _tmp276_ = bala_ccode_identifier_new (_tmp275_); |
| 8951 | _tmp277_ = _tmp276_; |
| 8952 | _tmp278_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp277_); |
| 8953 | _bala_ccode_node_unref0 (vcast)((vcast == ((void*)0)) ? ((void*)0) : (vcast = (bala_ccode_node_unref (vcast), ((void*)0)))); |
| 8954 | vcast = (BalaCCodeExpression*) _tmp278_; |
| 8955 | _bala_ccode_node_unref0 (_tmp277_)((_tmp277_ == ((void*)0)) ? ((void*)0) : (_tmp277_ = (bala_ccode_node_unref (_tmp277_), ((void*)0)))); |
| 8956 | _g_free0 (_tmp275_)(_tmp275_ = (g_free (_tmp275_), ((void*)0))); |
| 8957 | _tmp279_ = vcast; |
| 8958 | _tmp280_ = bala_ccode_identifier_new ("self"); |
| 8959 | _tmp281_ = _tmp280_; |
| 8960 | bala_ccode_function_call_add_argument (G_TYPE_CHECK_INSTANCE_CAST (_tmp279_, BALA_TYPE_CCODE_FUNCTION_CALL, BalaCCodeFunctionCall)(((BalaCCodeFunctionCall*) g_type_check_instance_cast ((GTypeInstance *) (_tmp279_), ((bala_ccode_function_call_get_type ()))))), (BalaCCodeExpression*) _tmp281_); |
| 8961 | _bala_ccode_node_unref0 (_tmp281_)((_tmp281_ == ((void*)0)) ? ((void*)0) : (_tmp281_ = (bala_ccode_node_unref (_tmp281_), ((void*)0)))); |
| 8962 | } else { |
| 8963 | BalaCCodeIdentifier* _tmp282_; |
| 8964 | _tmp282_ = bala_ccode_identifier_new ("self"); |
| 8965 | _bala_ccode_node_unref0 (vcast)((vcast == ((void*)0)) ? ((void*)0) : (vcast = (bala_ccode_node_unref (vcast), ((void*)0)))); |
| 8966 | vcast = (BalaCCodeExpression*) _tmp282_; |
| 8967 | } |
| 8968 | _bala_code_node_unref0 (cl)((cl == ((void*)0)) ? ((void*)0) : (cl = (bala_code_node_unref (cl), ((void*)0)))); |
| 8969 | } |
| 8970 | _tmp283_ = bala_property_accessor_get_readable (acc); |
| 8971 | _tmp284_ = _tmp283_; |
| 8972 | if (_tmp284_) { |
| 8973 | BalaCCodeFunctionCall* vcall = NULL((void*)0); |
| 8974 | BalaCCodeExpression* _tmp285_; |
| 8975 | BalaProperty* _tmp286_; |
| 8976 | const gchar* _tmp287_; |
| 8977 | const gchar* _tmp288_; |
| 8978 | gchar* _tmp289_; |
| 8979 | gchar* _tmp290_; |
| 8980 | BalaCCodeMemberAccess* _tmp291_; |
| 8981 | BalaCCodeMemberAccess* _tmp292_; |
| 8982 | BalaCCodeFunctionCall* _tmp293_; |
| 8983 | BalaCCodeFunctionCall* _tmp294_; |
| 8984 | BalaCCodeFunctionCall* _tmp295_; |
| 8985 | BalaCCodeIdentifier* _tmp296_; |
| 8986 | BalaCCodeIdentifier* _tmp297_; |
| 8987 | _tmp285_ = vcast; |
| 8988 | _tmp286_ = prop; |
| 8989 | _tmp287_ = bala_symbol_get_name ((BalaSymbol*) _tmp286_); |
| 8990 | _tmp288_ = _tmp287_; |
| 8991 | _tmp289_ = g_strdup_printf ("get_%s", _tmp288_); |
| 8992 | _tmp290_ = _tmp289_; |
| 8993 | _tmp291_ = bala_ccode_member_access_new_pointer (_tmp285_, _tmp290_); |
| 8994 | _tmp292_ = _tmp291_; |
| 8995 | _tmp293_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp292_); |
| 8996 | _tmp294_ = _tmp293_; |
| 8997 | _bala_ccode_node_unref0 (_tmp292_)((_tmp292_ == ((void*)0)) ? ((void*)0) : (_tmp292_ = (bala_ccode_node_unref (_tmp292_), ((void*)0)))); |
| 8998 | _g_free0 (_tmp290_)(_tmp290_ = (g_free (_tmp290_), ((void*)0))); |
| 8999 | vcall = _tmp294_; |
| 9000 | _tmp295_ = vcall; |
| 9001 | _tmp296_ = bala_ccode_identifier_new ("self"); |
| 9002 | _tmp297_ = _tmp296_; |
| 9003 | bala_ccode_function_call_add_argument (_tmp295_, (BalaCCodeExpression*) _tmp297_); |
| 9004 | _bala_ccode_node_unref0 (_tmp297_)((_tmp297_ == ((void*)0)) ? ((void*)0) : (_tmp297_ = (bala_ccode_node_unref (_tmp297_), ((void*)0)))); |
| 9005 | if (returns_real_struct) { |
| 9006 | BalaCCodeFunctionCall* _tmp298_; |
| 9007 | BalaCCodeIdentifier* _tmp299_; |
| 9008 | BalaCCodeIdentifier* _tmp300_; |
| 9009 | BalaCCodeFunction* _tmp301_; |
| 9010 | BalaCCodeFunction* _tmp302_; |
| 9011 | BalaCCodeFunctionCall* _tmp303_; |
| 9012 | _tmp298_ = vcall; |
| 9013 | _tmp299_ = bala_ccode_identifier_new ("result"); |
| 9014 | _tmp300_ = _tmp299_; |
| 9015 | bala_ccode_function_call_add_argument (_tmp298_, (BalaCCodeExpression*) _tmp300_); |
| 9016 | _bala_ccode_node_unref0 (_tmp300_)((_tmp300_ == ((void*)0)) ? ((void*)0) : (_tmp300_ = (bala_ccode_node_unref (_tmp300_), ((void*)0)))); |
| 9017 | _tmp301_ = bala_ccode_base_module_get_ccode (self); |
| 9018 | _tmp302_ = _tmp301_; |
| 9019 | _tmp303_ = vcall; |
| 9020 | bala_ccode_function_add_expression (_tmp302_, (BalaCCodeExpression*) _tmp303_); |
| 9021 | } else { |
| 9022 | gboolean _tmp304_ = FALSE(0); |
| 9023 | BalaDataType* _tmp305_; |
| 9024 | BalaDataType* _tmp306_; |
| 9025 | BalaCCodeFunction* _tmp338_; |
| 9026 | BalaCCodeFunction* _tmp339_; |
| 9027 | BalaCCodeFunctionCall* _tmp340_; |
| 9028 | _tmp305_ = bala_property_accessor_get_value_type (acc); |
| 9029 | _tmp306_ = _tmp305_; |
| 9030 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp306_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp306_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 9031 | BalaProperty* _tmp307_; |
| 9032 | _tmp307_ = prop; |
| 9033 | _tmp304_ = bala_get_ccode_array_length ((BalaCodeNode*) _tmp307_); |
| 9034 | } else { |
| 9035 | _tmp304_ = FALSE(0); |
| 9036 | } |
| 9037 | if (_tmp304_) { |
| 9038 | BalaArrayType* array_type = NULL((void*)0); |
| 9039 | BalaDataType* _tmp308_; |
| 9040 | BalaDataType* _tmp309_; |
| 9041 | BalaArrayType* _tmp310_; |
| 9042 | _tmp308_ = bala_property_accessor_get_value_type (acc); |
| 9043 | _tmp309_ = _tmp308_; |
| 9044 | _tmp310_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp309_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp309_), ((bala_array_type_get_type ())))))); |
| 9045 | array_type = _tmp310_; |
| 9046 | { |
| 9047 | gint dim = 0; |
| 9048 | dim = 1; |
| 9049 | { |
| 9050 | gboolean _tmp311_ = FALSE(0); |
| 9051 | _tmp311_ = TRUE(!(0)); |
| 9052 | while (TRUE(!(0))) { |
| 9053 | BalaArrayType* _tmp313_; |
| 9054 | gint _tmp314_; |
| 9055 | gint _tmp315_; |
| 9056 | BalaCCodeIdentifier* len_expr = NULL((void*)0); |
| 9057 | gchar* _tmp316_; |
| 9058 | gchar* _tmp317_; |
| 9059 | BalaCCodeIdentifier* _tmp318_; |
| 9060 | BalaCCodeIdentifier* _tmp319_; |
| 9061 | BalaCCodeFunctionCall* _tmp320_; |
| 9062 | BalaCCodeIdentifier* _tmp321_; |
| 9063 | if (!_tmp311_) { |
| 9064 | gint _tmp312_; |
| 9065 | _tmp312_ = dim; |
| 9066 | dim = _tmp312_ + 1; |
| 9067 | } |
| 9068 | _tmp311_ = FALSE(0); |
| 9069 | _tmp313_ = array_type; |
| 9070 | _tmp314_ = bala_array_type_get_rank (_tmp313_); |
| 9071 | _tmp315_ = _tmp314_; |
| 9072 | if (!(dim <= _tmp315_)) { |
| 9073 | break; |
| 9074 | } |
| 9075 | _tmp316_ = bala_ccode_base_module_get_array_length_cname (self, "result", dim); |
| 9076 | _tmp317_ = _tmp316_; |
| 9077 | _tmp318_ = bala_ccode_identifier_new (_tmp317_); |
| 9078 | _tmp319_ = _tmp318_; |
| 9079 | _g_free0 (_tmp317_)(_tmp317_ = (g_free (_tmp317_), ((void*)0))); |
| 9080 | len_expr = _tmp319_; |
| 9081 | _tmp320_ = vcall; |
| 9082 | _tmp321_ = len_expr; |
| 9083 | bala_ccode_function_call_add_argument (_tmp320_, (BalaCCodeExpression*) _tmp321_); |
| 9084 | _bala_ccode_node_unref0 (len_expr)((len_expr == ((void*)0)) ? ((void*)0) : (len_expr = (bala_ccode_node_unref (len_expr), ((void*)0)))); |
| 9085 | } |
| 9086 | } |
| 9087 | } |
| 9088 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 9089 | } else { |
| 9090 | gboolean _tmp322_ = FALSE(0); |
| 9091 | gboolean _tmp323_ = FALSE(0); |
| 9092 | BalaDataType* _tmp324_; |
| 9093 | BalaDataType* _tmp325_; |
| 9094 | _tmp324_ = bala_property_accessor_get_value_type (acc); |
| 9095 | _tmp325_ = _tmp324_; |
| 9096 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp325_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp325_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 9097 | BalaProperty* _tmp326_; |
| 9098 | _tmp326_ = prop; |
| 9099 | _tmp323_ = bala_get_ccode_delegate_target ((BalaCodeNode*) _tmp326_); |
| 9100 | } else { |
| 9101 | _tmp323_ = FALSE(0); |
| 9102 | } |
| 9103 | if (_tmp323_) { |
| 9104 | BalaDataType* _tmp327_; |
| 9105 | BalaDataType* _tmp328_; |
| 9106 | BalaDelegate* _tmp329_; |
| 9107 | BalaDelegate* _tmp330_; |
| 9108 | gboolean _tmp331_; |
| 9109 | gboolean _tmp332_; |
| 9110 | _tmp327_ = bala_property_accessor_get_value_type (acc); |
| 9111 | _tmp328_ = _tmp327_; |
| 9112 | _tmp329_ = bala_delegate_type_get_delegate_symbol (G_TYPE_CHECK_INSTANCE_CAST (_tmp328_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp328_), ((bala_delegate_type_get_type ())))))); |
| 9113 | _tmp330_ = _tmp329_; |
| 9114 | _tmp331_ = bala_delegate_get_has_target (_tmp330_); |
| 9115 | _tmp332_ = _tmp331_; |
| 9116 | _tmp322_ = _tmp332_; |
| 9117 | } else { |
| 9118 | _tmp322_ = FALSE(0); |
| 9119 | } |
| 9120 | if (_tmp322_) { |
| 9121 | BalaCCodeFunctionCall* _tmp333_; |
| 9122 | gchar* _tmp334_; |
| 9123 | gchar* _tmp335_; |
| 9124 | BalaCCodeIdentifier* _tmp336_; |
| 9125 | BalaCCodeIdentifier* _tmp337_; |
| 9126 | _tmp333_ = vcall; |
| 9127 | _tmp334_ = bala_ccode_base_module_get_delegate_target_cname (self, "result"); |
| 9128 | _tmp335_ = _tmp334_; |
| 9129 | _tmp336_ = bala_ccode_identifier_new (_tmp335_); |
| 9130 | _tmp337_ = _tmp336_; |
| 9131 | bala_ccode_function_call_add_argument (_tmp333_, (BalaCCodeExpression*) _tmp337_); |
| 9132 | _bala_ccode_node_unref0 (_tmp337_)((_tmp337_ == ((void*)0)) ? ((void*)0) : (_tmp337_ = (bala_ccode_node_unref (_tmp337_), ((void*)0)))); |
| 9133 | _g_free0 (_tmp335_)(_tmp335_ = (g_free (_tmp335_), ((void*)0))); |
| 9134 | } |
| 9135 | } |
| 9136 | _tmp338_ = bala_ccode_base_module_get_ccode (self); |
| 9137 | _tmp339_ = _tmp338_; |
| 9138 | _tmp340_ = vcall; |
| 9139 | bala_ccode_function_add_return (_tmp339_, (BalaCCodeExpression*) _tmp340_); |
| 9140 | } |
| 9141 | _bala_ccode_node_unref0 (vcall)((vcall == ((void*)0)) ? ((void*)0) : (vcall = (bala_ccode_node_unref (vcall), ((void*)0)))); |
| 9142 | } else { |
| 9143 | BalaCCodeFunctionCall* vcall = NULL((void*)0); |
| 9144 | BalaCCodeExpression* _tmp341_; |
| 9145 | BalaProperty* _tmp342_; |
| 9146 | const gchar* _tmp343_; |
| 9147 | const gchar* _tmp344_; |
| 9148 | gchar* _tmp345_; |
| 9149 | gchar* _tmp346_; |
| 9150 | BalaCCodeMemberAccess* _tmp347_; |
| 9151 | BalaCCodeMemberAccess* _tmp348_; |
| 9152 | BalaCCodeFunctionCall* _tmp349_; |
| 9153 | BalaCCodeFunctionCall* _tmp350_; |
| 9154 | BalaCCodeFunctionCall* _tmp351_; |
| 9155 | BalaCCodeIdentifier* _tmp352_; |
| 9156 | BalaCCodeIdentifier* _tmp353_; |
| 9157 | BalaCCodeFunctionCall* _tmp354_; |
| 9158 | BalaCCodeIdentifier* _tmp355_; |
| 9159 | BalaCCodeIdentifier* _tmp356_; |
| 9160 | gboolean _tmp357_ = FALSE(0); |
| 9161 | BalaDataType* _tmp358_; |
| 9162 | BalaDataType* _tmp359_; |
| 9163 | BalaCCodeFunction* _tmp403_; |
| 9164 | BalaCCodeFunction* _tmp404_; |
| 9165 | BalaCCodeFunctionCall* _tmp405_; |
| 9166 | _tmp341_ = vcast; |
| 9167 | _tmp342_ = prop; |
| 9168 | _tmp343_ = bala_symbol_get_name ((BalaSymbol*) _tmp342_); |
| 9169 | _tmp344_ = _tmp343_; |
| 9170 | _tmp345_ = g_strdup_printf ("set_%s", _tmp344_); |
| 9171 | _tmp346_ = _tmp345_; |
| 9172 | _tmp347_ = bala_ccode_member_access_new_pointer (_tmp341_, _tmp346_); |
| 9173 | _tmp348_ = _tmp347_; |
| 9174 | _tmp349_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp348_); |
| 9175 | _tmp350_ = _tmp349_; |
| 9176 | _bala_ccode_node_unref0 (_tmp348_)((_tmp348_ == ((void*)0)) ? ((void*)0) : (_tmp348_ = (bala_ccode_node_unref (_tmp348_), ((void*)0)))); |
| 9177 | _g_free0 (_tmp346_)(_tmp346_ = (g_free (_tmp346_), ((void*)0))); |
| 9178 | vcall = _tmp350_; |
| 9179 | _tmp351_ = vcall; |
| 9180 | _tmp352_ = bala_ccode_identifier_new ("self"); |
| 9181 | _tmp353_ = _tmp352_; |
| 9182 | bala_ccode_function_call_add_argument (_tmp351_, (BalaCCodeExpression*) _tmp353_); |
| 9183 | _bala_ccode_node_unref0 (_tmp353_)((_tmp353_ == ((void*)0)) ? ((void*)0) : (_tmp353_ = (bala_ccode_node_unref (_tmp353_), ((void*)0)))); |
| 9184 | _tmp354_ = vcall; |
| 9185 | _tmp355_ = bala_ccode_identifier_new ("value"); |
| 9186 | _tmp356_ = _tmp355_; |
| 9187 | bala_ccode_function_call_add_argument (_tmp354_, (BalaCCodeExpression*) _tmp356_); |
| 9188 | _bala_ccode_node_unref0 (_tmp356_)((_tmp356_ == ((void*)0)) ? ((void*)0) : (_tmp356_ = (bala_ccode_node_unref (_tmp356_), ((void*)0)))); |
| 9189 | _tmp358_ = bala_property_accessor_get_value_type (acc); |
| 9190 | _tmp359_ = _tmp358_; |
| 9191 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp359_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp359_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 9192 | BalaProperty* _tmp360_; |
| 9193 | _tmp360_ = prop; |
| 9194 | _tmp357_ = bala_get_ccode_array_length ((BalaCodeNode*) _tmp360_); |
| 9195 | } else { |
| 9196 | _tmp357_ = FALSE(0); |
| 9197 | } |
| 9198 | if (_tmp357_) { |
| 9199 | BalaArrayType* array_type = NULL((void*)0); |
| 9200 | BalaDataType* _tmp361_; |
| 9201 | BalaDataType* _tmp362_; |
| 9202 | BalaArrayType* _tmp363_; |
| 9203 | _tmp361_ = bala_property_accessor_get_value_type (acc); |
| 9204 | _tmp362_ = _tmp361_; |
| 9205 | _tmp363_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp362_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp362_), ((bala_array_type_get_type ())))))); |
| 9206 | array_type = _tmp363_; |
| 9207 | { |
| 9208 | gint dim = 0; |
| 9209 | dim = 1; |
| 9210 | { |
| 9211 | gboolean _tmp364_ = FALSE(0); |
| 9212 | _tmp364_ = TRUE(!(0)); |
| 9213 | while (TRUE(!(0))) { |
| 9214 | BalaArrayType* _tmp366_; |
| 9215 | gint _tmp367_; |
| 9216 | gint _tmp368_; |
| 9217 | BalaCCodeIdentifier* len_expr = NULL((void*)0); |
| 9218 | gchar* _tmp369_; |
| 9219 | gchar* _tmp370_; |
| 9220 | BalaCCodeIdentifier* _tmp371_; |
| 9221 | BalaCCodeIdentifier* _tmp372_; |
| 9222 | BalaCCodeFunctionCall* _tmp373_; |
| 9223 | BalaCCodeIdentifier* _tmp374_; |
| 9224 | if (!_tmp364_) { |
| 9225 | gint _tmp365_; |
| 9226 | _tmp365_ = dim; |
| 9227 | dim = _tmp365_ + 1; |
| 9228 | } |
| 9229 | _tmp364_ = FALSE(0); |
| 9230 | _tmp366_ = array_type; |
| 9231 | _tmp367_ = bala_array_type_get_rank (_tmp366_); |
| 9232 | _tmp368_ = _tmp367_; |
| 9233 | if (!(dim <= _tmp368_)) { |
| 9234 | break; |
| 9235 | } |
| 9236 | _tmp369_ = bala_ccode_base_module_get_array_length_cname (self, "value", dim); |
| 9237 | _tmp370_ = _tmp369_; |
| 9238 | _tmp371_ = bala_ccode_identifier_new (_tmp370_); |
| 9239 | _tmp372_ = _tmp371_; |
| 9240 | _g_free0 (_tmp370_)(_tmp370_ = (g_free (_tmp370_), ((void*)0))); |
| 9241 | len_expr = _tmp372_; |
| 9242 | _tmp373_ = vcall; |
| 9243 | _tmp374_ = len_expr; |
| 9244 | bala_ccode_function_call_add_argument (_tmp373_, (BalaCCodeExpression*) _tmp374_); |
| 9245 | _bala_ccode_node_unref0 (len_expr)((len_expr == ((void*)0)) ? ((void*)0) : (len_expr = (bala_ccode_node_unref (len_expr), ((void*)0)))); |
| 9246 | } |
| 9247 | } |
| 9248 | } |
| 9249 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 9250 | } else { |
| 9251 | gboolean _tmp375_ = FALSE(0); |
| 9252 | gboolean _tmp376_ = FALSE(0); |
| 9253 | BalaDataType* _tmp377_; |
| 9254 | BalaDataType* _tmp378_; |
| 9255 | _tmp377_ = bala_property_accessor_get_value_type (acc); |
| 9256 | _tmp378_ = _tmp377_; |
| 9257 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp378_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp378_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 9258 | BalaProperty* _tmp379_; |
| 9259 | _tmp379_ = prop; |
| 9260 | _tmp376_ = bala_get_ccode_delegate_target ((BalaCodeNode*) _tmp379_); |
| 9261 | } else { |
| 9262 | _tmp376_ = FALSE(0); |
| 9263 | } |
| 9264 | if (_tmp376_) { |
| 9265 | BalaDataType* _tmp380_; |
| 9266 | BalaDataType* _tmp381_; |
| 9267 | BalaDelegate* _tmp382_; |
| 9268 | BalaDelegate* _tmp383_; |
| 9269 | gboolean _tmp384_; |
| 9270 | gboolean _tmp385_; |
| 9271 | _tmp380_ = bala_property_accessor_get_value_type (acc); |
| 9272 | _tmp381_ = _tmp380_; |
| 9273 | _tmp382_ = bala_delegate_type_get_delegate_symbol (G_TYPE_CHECK_INSTANCE_CAST (_tmp381_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp381_), ((bala_delegate_type_get_type ())))))); |
| 9274 | _tmp383_ = _tmp382_; |
| 9275 | _tmp384_ = bala_delegate_get_has_target (_tmp383_); |
| 9276 | _tmp385_ = _tmp384_; |
| 9277 | _tmp375_ = _tmp385_; |
| 9278 | } else { |
| 9279 | _tmp375_ = FALSE(0); |
| 9280 | } |
| 9281 | if (_tmp375_) { |
| 9282 | BalaCCodeFunctionCall* _tmp386_; |
| 9283 | gchar* _tmp387_; |
| 9284 | gchar* _tmp388_; |
| 9285 | BalaCCodeIdentifier* _tmp389_; |
| 9286 | BalaCCodeIdentifier* _tmp390_; |
| 9287 | gboolean _tmp391_ = FALSE(0); |
| 9288 | gboolean _tmp392_; |
| 9289 | gboolean _tmp393_; |
| 9290 | _tmp386_ = vcall; |
| 9291 | _tmp387_ = bala_ccode_base_module_get_delegate_target_cname (self, "value"); |
| 9292 | _tmp388_ = _tmp387_; |
| 9293 | _tmp389_ = bala_ccode_identifier_new (_tmp388_); |
| 9294 | _tmp390_ = _tmp389_; |
| 9295 | bala_ccode_function_call_add_argument (_tmp386_, (BalaCCodeExpression*) _tmp390_); |
| 9296 | _bala_ccode_node_unref0 (_tmp390_)((_tmp390_ == ((void*)0)) ? ((void*)0) : (_tmp390_ = (bala_ccode_node_unref (_tmp390_), ((void*)0)))); |
| 9297 | _g_free0 (_tmp388_)(_tmp388_ = (g_free (_tmp388_), ((void*)0))); |
| 9298 | _tmp392_ = bala_property_accessor_get_readable (acc); |
| 9299 | _tmp393_ = _tmp392_; |
| 9300 | if (!_tmp393_) { |
| 9301 | BalaDataType* _tmp394_; |
| 9302 | BalaDataType* _tmp395_; |
| 9303 | gboolean _tmp396_; |
| 9304 | gboolean _tmp397_; |
| 9305 | _tmp394_ = bala_property_accessor_get_value_type (acc); |
| 9306 | _tmp395_ = _tmp394_; |
| 9307 | _tmp396_ = bala_data_type_get_value_owned (_tmp395_); |
| 9308 | _tmp397_ = _tmp396_; |
| 9309 | _tmp391_ = _tmp397_; |
| 9310 | } else { |
| 9311 | _tmp391_ = FALSE(0); |
| 9312 | } |
| 9313 | if (_tmp391_) { |
| 9314 | BalaCCodeFunctionCall* _tmp398_; |
| 9315 | gchar* _tmp399_; |
| 9316 | gchar* _tmp400_; |
| 9317 | BalaCCodeIdentifier* _tmp401_; |
| 9318 | BalaCCodeIdentifier* _tmp402_; |
| 9319 | _tmp398_ = vcall; |
| 9320 | _tmp399_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cname (self, "value"); |
| 9321 | _tmp400_ = _tmp399_; |
| 9322 | _tmp401_ = bala_ccode_identifier_new (_tmp400_); |
| 9323 | _tmp402_ = _tmp401_; |
| 9324 | bala_ccode_function_call_add_argument (_tmp398_, (BalaCCodeExpression*) _tmp402_); |
| 9325 | _bala_ccode_node_unref0 (_tmp402_)((_tmp402_ == ((void*)0)) ? ((void*)0) : (_tmp402_ = (bala_ccode_node_unref (_tmp402_), ((void*)0)))); |
| 9326 | _g_free0 (_tmp400_)(_tmp400_ = (g_free (_tmp400_), ((void*)0))); |
| 9327 | } |
| 9328 | } |
| 9329 | } |
| 9330 | _tmp403_ = bala_ccode_base_module_get_ccode (self); |
| 9331 | _tmp404_ = _tmp403_; |
| 9332 | _tmp405_ = vcall; |
| 9333 | bala_ccode_function_add_expression (_tmp404_, (BalaCCodeExpression*) _tmp405_); |
| 9334 | _bala_ccode_node_unref0 (vcall)((vcall == ((void*)0)) ? ((void*)0) : (vcall = (bala_ccode_node_unref (vcall), ((void*)0)))); |
| 9335 | } |
| 9336 | bala_ccode_base_module_pop_function (self); |
| 9337 | _tmp406_ = self->cfile; |
| 9338 | _tmp407_ = function; |
| 9339 | bala_ccode_file_add_function (_tmp406_, _tmp407_); |
| 9340 | _bala_ccode_node_unref0 (vcast)((vcast == ((void*)0)) ? ((void*)0) : (vcast = (bala_ccode_node_unref (vcast), ((void*)0)))); |
| 9341 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 9342 | } |
| 9343 | _tmp409_ = prop; |
| 9344 | _tmp410_ = bala_property_get_is_abstract (_tmp409_); |
| 9345 | _tmp411_ = _tmp410_; |
| 9346 | if (!_tmp411_) { |
| 9347 | BalaBlock* _tmp412_; |
| 9348 | BalaBlock* _tmp413_; |
| 9349 | _tmp412_ = bala_subroutine_get_body ((BalaSubroutine*) acc); |
| 9350 | _tmp413_ = _tmp412_; |
| 9351 | _tmp408_ = _tmp413_ != NULL((void*)0); |
| 9352 | } else { |
| 9353 | _tmp408_ = FALSE(0); |
| 9354 | } |
| 9355 | if (_tmp408_) { |
| 9356 | gboolean _tmp414_ = FALSE(0); |
| 9357 | BalaProperty* _tmp415_; |
| 9358 | BalaProperty* _tmp416_; |
| 9359 | BalaProperty* _tmp417_; |
| 9360 | gboolean is_virtual = FALSE(0); |
| 9361 | gchar* cname = NULL((void*)0); |
| 9362 | gchar* _tmp421_; |
| 9363 | BalaCCodeFunction* function = NULL((void*)0); |
| 9364 | gboolean _tmp422_ = FALSE(0); |
| 9365 | gboolean _tmp423_ = FALSE(0); |
| 9366 | gboolean _tmp424_; |
| 9367 | gboolean _tmp425_; |
| 9368 | BalaObjectType* base_type = NULL((void*)0); |
| 9369 | BalaProperty* _tmp436_; |
| 9370 | BalaMemberBinding _tmp437_; |
| 9371 | BalaMemberBinding _tmp438_; |
| 9372 | gboolean _tmp469_ = FALSE(0); |
| 9373 | gboolean _tmp470_ = FALSE(0); |
| 9374 | gboolean _tmp471_; |
| 9375 | gboolean _tmp472_; |
| 9376 | gboolean _tmp477_ = FALSE(0); |
| 9377 | BalaDataType* _tmp478_; |
| 9378 | BalaDataType* _tmp479_; |
| 9379 | BalaCCodeFunction* _tmp575_; |
| 9380 | gboolean _tmp576_ = FALSE(0); |
| 9381 | BalaProperty* _tmp577_; |
| 9382 | BalaMemberBinding _tmp578_; |
| 9383 | BalaMemberBinding _tmp579_; |
| 9384 | gboolean _tmp587_ = FALSE(0); |
| 9385 | gboolean _tmp588_; |
| 9386 | gboolean _tmp589_; |
| 9387 | gboolean _tmp626_ = FALSE(0); |
| 9388 | gboolean _tmp627_ = FALSE(0); |
| 9389 | BalaCodeContext* _tmp628_; |
| 9390 | BalaSemanticAnalyzer* _tmp629_; |
| 9391 | BalaSemanticAnalyzer* _tmp630_; |
| 9392 | BalaProperty* _tmp631_; |
| 9393 | gboolean _tmp866_; |
| 9394 | gboolean _tmp867_; |
| 9395 | BalaCCodeFile* _tmp878_; |
| 9396 | BalaCCodeFunction* _tmp879_; |
| 9397 | _tmp415_ = prop; |
| 9398 | _tmp416_ = bala_property_get_base_property (_tmp415_); |
| 9399 | _tmp417_ = _tmp416_; |
| 9400 | if (_tmp417_ != NULL((void*)0)) { |
| 9401 | _tmp414_ = TRUE(!(0)); |
| 9402 | } else { |
| 9403 | BalaProperty* _tmp418_; |
| 9404 | BalaProperty* _tmp419_; |
| 9405 | BalaProperty* _tmp420_; |
| 9406 | _tmp418_ = prop; |
| 9407 | _tmp419_ = bala_property_get_base_interface_property (_tmp418_); |
| 9408 | _tmp420_ = _tmp419_; |
| 9409 | _tmp414_ = _tmp420_ != NULL((void*)0); |
| 9410 | } |
| 9411 | is_virtual = _tmp414_; |
| 9412 | _tmp421_ = bala_get_ccode_real_name ((BalaSymbol*) acc); |
| 9413 | cname = _tmp421_; |
| 9414 | _tmp424_ = bala_property_accessor_get_writable (acc); |
| 9415 | _tmp425_ = _tmp424_; |
| 9416 | if (_tmp425_) { |
| 9417 | _tmp423_ = TRUE(!(0)); |
| 9418 | } else { |
| 9419 | gboolean _tmp426_; |
| 9420 | gboolean _tmp427_; |
| 9421 | _tmp426_ = bala_property_accessor_get_construction (acc); |
| 9422 | _tmp427_ = _tmp426_; |
| 9423 | _tmp423_ = _tmp427_; |
| 9424 | } |
| 9425 | if (_tmp423_) { |
| 9426 | _tmp422_ = TRUE(!(0)); |
| 9427 | } else { |
| 9428 | _tmp422_ = returns_real_struct; |
| 9429 | } |
| 9430 | if (_tmp422_) { |
| 9431 | const gchar* _tmp428_; |
| 9432 | BalaCCodeFunction* _tmp429_; |
| 9433 | _tmp428_ = cname; |
| 9434 | _tmp429_ = bala_ccode_function_new (_tmp428_, "void"); |
| 9435 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 9436 | function = _tmp429_; |
| 9437 | } else { |
| 9438 | const gchar* _tmp430_; |
| 9439 | BalaDataType* _tmp431_; |
| 9440 | BalaDataType* _tmp432_; |
| 9441 | gchar* _tmp433_; |
| 9442 | gchar* _tmp434_; |
| 9443 | BalaCCodeFunction* _tmp435_; |
| 9444 | _tmp430_ = cname; |
| 9445 | _tmp431_ = bala_property_accessor_get_value_type (acc); |
| 9446 | _tmp432_ = _tmp431_; |
| 9447 | _tmp433_ = bala_get_ccode_name ((BalaCodeNode*) _tmp432_); |
| 9448 | _tmp434_ = _tmp433_; |
| 9449 | _tmp435_ = bala_ccode_function_new (_tmp430_, _tmp434_); |
| 9450 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 9451 | function = _tmp435_; |
| 9452 | _g_free0 (_tmp434_)(_tmp434_ = (g_free (_tmp434_), ((void*)0))); |
| 9453 | } |
| 9454 | base_type = NULL((void*)0); |
| 9455 | _tmp436_ = prop; |
| 9456 | _tmp437_ = bala_property_get_binding (_tmp436_); |
| 9457 | _tmp438_ = _tmp437_; |
| 9458 | if (_tmp438_ == BALA_MEMBER_BINDING_INSTANCE) { |
| 9459 | if (is_virtual) { |
| 9460 | BalaProperty* _tmp439_; |
| 9461 | BalaProperty* _tmp440_; |
| 9462 | BalaProperty* _tmp441_; |
| 9463 | BalaCCodeFunction* _tmp457_; |
| 9464 | BalaCCodeFunction* _tmp458_; |
| 9465 | BalaCCodeModifiers _tmp459_; |
| 9466 | BalaCCodeModifiers _tmp460_; |
| 9467 | BalaCCodeFunction* _tmp461_; |
| 9468 | BalaObjectType* _tmp462_; |
| 9469 | gchar* _tmp463_; |
| 9470 | gchar* _tmp464_; |
| 9471 | BalaCCodeParameter* _tmp465_; |
| 9472 | BalaCCodeParameter* _tmp466_; |
| 9473 | _tmp439_ = prop; |
| 9474 | _tmp440_ = bala_property_get_base_property (_tmp439_); |
| 9475 | _tmp441_ = _tmp440_; |
| 9476 | if (_tmp441_ != NULL((void*)0)) { |
| 9477 | BalaProperty* _tmp442_; |
| 9478 | BalaProperty* _tmp443_; |
| 9479 | BalaProperty* _tmp444_; |
| 9480 | BalaSymbol* _tmp445_; |
| 9481 | BalaSymbol* _tmp446_; |
| 9482 | BalaObjectType* _tmp447_; |
| 9483 | _tmp442_ = prop; |
| 9484 | _tmp443_ = bala_property_get_base_property (_tmp442_); |
| 9485 | _tmp444_ = _tmp443_; |
| 9486 | _tmp445_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp444_); |
| 9487 | _tmp446_ = _tmp445_; |
| 9488 | _tmp447_ = bala_object_type_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp446_, BALA_TYPE_OBJECT_TYPE_SYMBOL, BalaObjectTypeSymbol)(((BalaObjectTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp446_), ((bala_object_type_symbol_get_type ())))))); |
| 9489 | _bala_code_node_unref0 (base_type)((base_type == ((void*)0)) ? ((void*)0) : (base_type = (bala_code_node_unref (base_type), ((void*)0)))); |
| 9490 | base_type = _tmp447_; |
| 9491 | } else { |
| 9492 | BalaProperty* _tmp448_; |
| 9493 | BalaProperty* _tmp449_; |
| 9494 | BalaProperty* _tmp450_; |
| 9495 | _tmp448_ = prop; |
| 9496 | _tmp449_ = bala_property_get_base_interface_property (_tmp448_); |
| 9497 | _tmp450_ = _tmp449_; |
| 9498 | if (_tmp450_ != NULL((void*)0)) { |
| 9499 | BalaProperty* _tmp451_; |
| 9500 | BalaProperty* _tmp452_; |
| 9501 | BalaProperty* _tmp453_; |
| 9502 | BalaSymbol* _tmp454_; |
| 9503 | BalaSymbol* _tmp455_; |
| 9504 | BalaObjectType* _tmp456_; |
| 9505 | _tmp451_ = prop; |
| 9506 | _tmp452_ = bala_property_get_base_interface_property (_tmp451_); |
| 9507 | _tmp453_ = _tmp452_; |
| 9508 | _tmp454_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp453_); |
| 9509 | _tmp455_ = _tmp454_; |
| 9510 | _tmp456_ = bala_object_type_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp455_, BALA_TYPE_OBJECT_TYPE_SYMBOL, BalaObjectTypeSymbol)(((BalaObjectTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp455_), ((bala_object_type_symbol_get_type ())))))); |
| 9511 | _bala_code_node_unref0 (base_type)((base_type == ((void*)0)) ? ((void*)0) : (base_type = (bala_code_node_unref (base_type), ((void*)0)))); |
| 9512 | base_type = _tmp456_; |
| 9513 | } |
| 9514 | } |
| 9515 | _tmp457_ = function; |
| 9516 | _tmp458_ = function; |
| 9517 | _tmp459_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp458_); |
| 9518 | _tmp460_ = _tmp459_; |
| 9519 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp458_, _tmp460_ | BALA_CCODE_MODIFIERS_STATIC); |
| 9520 | _tmp461_ = function; |
| 9521 | _tmp462_ = base_type; |
| 9522 | _tmp463_ = bala_get_ccode_name ((BalaCodeNode*) _tmp462_); |
| 9523 | _tmp464_ = _tmp463_; |
| 9524 | _tmp465_ = bala_ccode_parameter_new ("base", _tmp464_); |
| 9525 | _tmp466_ = _tmp465_; |
| 9526 | bala_ccode_function_add_parameter (_tmp461_, _tmp466_); |
| 9527 | _bala_ccode_node_unref0 (_tmp466_)((_tmp466_ == ((void*)0)) ? ((void*)0) : (_tmp466_ = (bala_ccode_node_unref (_tmp466_), ((void*)0)))); |
| 9528 | _g_free0 (_tmp464_)(_tmp464_ = (g_free (_tmp464_), ((void*)0))); |
| 9529 | } else { |
| 9530 | BalaCCodeFunction* _tmp467_; |
| 9531 | BalaCCodeParameter* _tmp468_; |
| 9532 | _tmp467_ = function; |
| 9533 | _tmp468_ = cselfparam; |
| 9534 | bala_ccode_function_add_parameter (_tmp467_, _tmp468_); |
| 9535 | } |
| 9536 | } |
| 9537 | _tmp471_ = bala_property_accessor_get_writable (acc); |
| 9538 | _tmp472_ = _tmp471_; |
| 9539 | if (_tmp472_) { |
| 9540 | _tmp470_ = TRUE(!(0)); |
| 9541 | } else { |
| 9542 | gboolean _tmp473_; |
| 9543 | gboolean _tmp474_; |
| 9544 | _tmp473_ = bala_property_accessor_get_construction (acc); |
| 9545 | _tmp474_ = _tmp473_; |
| 9546 | _tmp470_ = _tmp474_; |
| 9547 | } |
| 9548 | if (_tmp470_) { |
| 9549 | _tmp469_ = TRUE(!(0)); |
| 9550 | } else { |
| 9551 | _tmp469_ = returns_real_struct; |
| 9552 | } |
| 9553 | if (_tmp469_) { |
| 9554 | BalaCCodeFunction* _tmp475_; |
| 9555 | BalaCCodeParameter* _tmp476_; |
| 9556 | _tmp475_ = function; |
| 9557 | _tmp476_ = cvalueparam; |
| 9558 | bala_ccode_function_add_parameter (_tmp475_, _tmp476_); |
| 9559 | } |
| 9560 | _tmp478_ = bala_property_accessor_get_value_type (acc); |
| 9561 | _tmp479_ = _tmp478_; |
| 9562 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp479_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp479_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 9563 | BalaProperty* _tmp480_; |
| 9564 | _tmp480_ = prop; |
| 9565 | _tmp477_ = bala_get_ccode_array_length ((BalaCodeNode*) _tmp480_); |
| 9566 | } else { |
| 9567 | _tmp477_ = FALSE(0); |
| 9568 | } |
| 9569 | if (_tmp477_) { |
| 9570 | BalaArrayType* array_type = NULL((void*)0); |
| 9571 | BalaDataType* _tmp481_; |
| 9572 | BalaDataType* _tmp482_; |
| 9573 | BalaArrayType* _tmp483_; |
| 9574 | gchar* length_ctype = NULL((void*)0); |
| 9575 | BalaProperty* _tmp484_; |
| 9576 | gchar* _tmp485_; |
| 9577 | _tmp481_ = bala_property_accessor_get_value_type (acc); |
| 9578 | _tmp482_ = _tmp481_; |
| 9579 | _tmp483_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp482_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp482_), ((bala_array_type_get_type ())))))); |
| 9580 | array_type = _tmp483_; |
| 9581 | _tmp484_ = prop; |
| 9582 | _tmp485_ = bala_get_ccode_array_length_type ((BalaCodeNode*) _tmp484_); |
| 9583 | length_ctype = _tmp485_; |
| 9584 | { |
| 9585 | gint dim = 0; |
| 9586 | dim = 1; |
| 9587 | { |
| 9588 | gboolean _tmp486_ = FALSE(0); |
| 9589 | _tmp486_ = TRUE(!(0)); |
| 9590 | while (TRUE(!(0))) { |
| 9591 | BalaArrayType* _tmp488_; |
| 9592 | gint _tmp489_; |
| 9593 | gint _tmp490_; |
| 9594 | const gchar* _tmp491_ = NULL((void*)0); |
| 9595 | gboolean _tmp492_; |
| 9596 | gboolean _tmp493_; |
| 9597 | gchar* _tmp494_ = NULL((void*)0); |
| 9598 | gboolean _tmp495_; |
| 9599 | gboolean _tmp496_; |
| 9600 | BalaCCodeFunction* _tmp501_; |
| 9601 | gchar* _tmp502_; |
| 9602 | gchar* _tmp503_; |
| 9603 | BalaCCodeParameter* _tmp504_; |
| 9604 | BalaCCodeParameter* _tmp505_; |
| 9605 | if (!_tmp486_) { |
| 9606 | gint _tmp487_; |
| 9607 | _tmp487_ = dim; |
| 9608 | dim = _tmp487_ + 1; |
| 9609 | } |
| 9610 | _tmp486_ = FALSE(0); |
| 9611 | _tmp488_ = array_type; |
| 9612 | _tmp489_ = bala_array_type_get_rank (_tmp488_); |
| 9613 | _tmp490_ = _tmp489_; |
| 9614 | if (!(dim <= _tmp490_)) { |
| 9615 | break; |
| 9616 | } |
| 9617 | _tmp492_ = bala_property_accessor_get_readable (acc); |
| 9618 | _tmp493_ = _tmp492_; |
| 9619 | if (_tmp493_) { |
| 9620 | _tmp491_ = "result"; |
| 9621 | } else { |
| 9622 | _tmp491_ = "value"; |
| 9623 | } |
| 9624 | _tmp495_ = bala_property_accessor_get_readable (acc); |
| 9625 | _tmp496_ = _tmp495_; |
| 9626 | if (_tmp496_) { |
| 9627 | const gchar* _tmp497_; |
| 9628 | gchar* _tmp498_; |
| 9629 | _tmp497_ = length_ctype; |
| 9630 | _tmp498_ = g_strconcat (_tmp497_, "*", NULL((void*)0)); |
| 9631 | _g_free0 (_tmp494_)(_tmp494_ = (g_free (_tmp494_), ((void*)0))); |
| 9632 | _tmp494_ = _tmp498_; |
| 9633 | } else { |
| 9634 | const gchar* _tmp499_; |
| 9635 | gchar* _tmp500_; |
| 9636 | _tmp499_ = length_ctype; |
| 9637 | _tmp500_ = g_strdup (_tmp499_); |
| 9638 | _g_free0 (_tmp494_)(_tmp494_ = (g_free (_tmp494_), ((void*)0))); |
| 9639 | _tmp494_ = _tmp500_; |
| 9640 | } |
| 9641 | _tmp501_ = function; |
| 9642 | _tmp502_ = bala_ccode_base_module_get_array_length_cname (self, _tmp491_, dim); |
| 9643 | _tmp503_ = _tmp502_; |
| 9644 | _tmp504_ = bala_ccode_parameter_new (_tmp503_, _tmp494_); |
| 9645 | _tmp505_ = _tmp504_; |
| 9646 | bala_ccode_function_add_parameter (_tmp501_, _tmp505_); |
| 9647 | _bala_ccode_node_unref0 (_tmp505_)((_tmp505_ == ((void*)0)) ? ((void*)0) : (_tmp505_ = (bala_ccode_node_unref (_tmp505_), ((void*)0)))); |
| 9648 | _g_free0 (_tmp503_)(_tmp503_ = (g_free (_tmp503_), ((void*)0))); |
| 9649 | _g_free0 (_tmp494_)(_tmp494_ = (g_free (_tmp494_), ((void*)0))); |
| 9650 | } |
| 9651 | } |
| 9652 | } |
| 9653 | _g_free0 (length_ctype)(length_ctype = (g_free (length_ctype), ((void*)0))); |
| 9654 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 9655 | } else { |
| 9656 | gboolean _tmp506_ = FALSE(0); |
| 9657 | gboolean _tmp507_ = FALSE(0); |
| 9658 | BalaDataType* _tmp508_; |
| 9659 | BalaDataType* _tmp509_; |
| 9660 | _tmp508_ = bala_property_accessor_get_value_type (acc); |
| 9661 | _tmp509_ = _tmp508_; |
| 9662 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp509_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp509_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 9663 | BalaProperty* _tmp510_; |
| 9664 | _tmp510_ = prop; |
| 9665 | _tmp507_ = bala_get_ccode_delegate_target ((BalaCodeNode*) _tmp510_); |
| 9666 | } else { |
| 9667 | _tmp507_ = FALSE(0); |
| 9668 | } |
| 9669 | if (_tmp507_) { |
| 9670 | BalaDataType* _tmp511_; |
| 9671 | BalaDataType* _tmp512_; |
| 9672 | BalaDelegate* _tmp513_; |
| 9673 | BalaDelegate* _tmp514_; |
| 9674 | gboolean _tmp515_; |
| 9675 | gboolean _tmp516_; |
| 9676 | _tmp511_ = bala_property_accessor_get_value_type (acc); |
| 9677 | _tmp512_ = _tmp511_; |
| 9678 | _tmp513_ = bala_delegate_type_get_delegate_symbol (G_TYPE_CHECK_INSTANCE_CAST (_tmp512_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp512_), ((bala_delegate_type_get_type ())))))); |
| 9679 | _tmp514_ = _tmp513_; |
| 9680 | _tmp515_ = bala_delegate_get_has_target (_tmp514_); |
| 9681 | _tmp516_ = _tmp515_; |
| 9682 | _tmp506_ = _tmp516_; |
| 9683 | } else { |
| 9684 | _tmp506_ = FALSE(0); |
| 9685 | } |
| 9686 | if (_tmp506_) { |
| 9687 | const gchar* _tmp517_ = NULL((void*)0); |
| 9688 | gboolean _tmp518_; |
| 9689 | gboolean _tmp519_; |
| 9690 | gchar* _tmp520_ = NULL((void*)0); |
| 9691 | gboolean _tmp521_; |
| 9692 | gboolean _tmp522_; |
| 9693 | BalaCCodeFunction* _tmp529_; |
| 9694 | gchar* _tmp530_; |
| 9695 | gchar* _tmp531_; |
| 9696 | BalaCCodeParameter* _tmp532_; |
| 9697 | BalaCCodeParameter* _tmp533_; |
| 9698 | gboolean _tmp534_ = FALSE(0); |
| 9699 | gboolean _tmp535_; |
| 9700 | gboolean _tmp536_; |
| 9701 | _tmp518_ = bala_property_accessor_get_readable (acc); |
| 9702 | _tmp519_ = _tmp518_; |
| 9703 | if (_tmp519_) { |
| 9704 | _tmp517_ = "result"; |
| 9705 | } else { |
| 9706 | _tmp517_ = "value"; |
| 9707 | } |
| 9708 | _tmp521_ = bala_property_accessor_get_readable (acc); |
| 9709 | _tmp522_ = _tmp521_; |
| 9710 | if (_tmp522_) { |
| 9711 | BalaDataType* _tmp523_; |
| 9712 | gchar* _tmp524_; |
| 9713 | gchar* _tmp525_; |
| 9714 | gchar* _tmp526_; |
| 9715 | _tmp523_ = self->delegate_target_type; |
| 9716 | _tmp524_ = bala_get_ccode_name ((BalaCodeNode*) _tmp523_); |
| 9717 | _tmp525_ = _tmp524_; |
| 9718 | _tmp526_ = g_strconcat (_tmp525_, "*", NULL((void*)0)); |
| 9719 | _g_free0 (_tmp520_)(_tmp520_ = (g_free (_tmp520_), ((void*)0))); |
| 9720 | _tmp520_ = _tmp526_; |
| 9721 | _g_free0 (_tmp525_)(_tmp525_ = (g_free (_tmp525_), ((void*)0))); |
| 9722 | } else { |
| 9723 | BalaDataType* _tmp527_; |
| 9724 | gchar* _tmp528_; |
| 9725 | _tmp527_ = self->delegate_target_type; |
| 9726 | _tmp528_ = bala_get_ccode_name ((BalaCodeNode*) _tmp527_); |
| 9727 | _g_free0 (_tmp520_)(_tmp520_ = (g_free (_tmp520_), ((void*)0))); |
| 9728 | _tmp520_ = _tmp528_; |
| 9729 | } |
| 9730 | _tmp529_ = function; |
| 9731 | _tmp530_ = bala_ccode_base_module_get_delegate_target_cname (self, _tmp517_); |
| 9732 | _tmp531_ = _tmp530_; |
| 9733 | _tmp532_ = bala_ccode_parameter_new (_tmp531_, _tmp520_); |
| 9734 | _tmp533_ = _tmp532_; |
| 9735 | bala_ccode_function_add_parameter (_tmp529_, _tmp533_); |
| 9736 | _bala_ccode_node_unref0 (_tmp533_)((_tmp533_ == ((void*)0)) ? ((void*)0) : (_tmp533_ = (bala_ccode_node_unref (_tmp533_), ((void*)0)))); |
| 9737 | _g_free0 (_tmp531_)(_tmp531_ = (g_free (_tmp531_), ((void*)0))); |
| 9738 | _tmp535_ = bala_property_accessor_get_readable (acc); |
| 9739 | _tmp536_ = _tmp535_; |
| 9740 | if (!_tmp536_) { |
| 9741 | BalaDataType* _tmp537_; |
| 9742 | BalaDataType* _tmp538_; |
| 9743 | gboolean _tmp539_; |
| 9744 | gboolean _tmp540_; |
| 9745 | _tmp537_ = bala_property_accessor_get_value_type (acc); |
| 9746 | _tmp538_ = _tmp537_; |
| 9747 | _tmp539_ = bala_data_type_get_value_owned (_tmp538_); |
| 9748 | _tmp540_ = _tmp539_; |
| 9749 | _tmp534_ = _tmp540_; |
| 9750 | } else { |
| 9751 | _tmp534_ = FALSE(0); |
| 9752 | } |
| 9753 | if (_tmp534_) { |
| 9754 | BalaCCodeFunction* _tmp541_; |
| 9755 | gchar* _tmp542_; |
| 9756 | gchar* _tmp543_; |
| 9757 | BalaDelegateType* _tmp544_; |
| 9758 | gchar* _tmp545_; |
| 9759 | gchar* _tmp546_; |
| 9760 | BalaCCodeParameter* _tmp547_; |
| 9761 | BalaCCodeParameter* _tmp548_; |
| 9762 | _tmp541_ = function; |
| 9763 | _tmp542_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cname (self, "value"); |
| 9764 | _tmp543_ = _tmp542_; |
| 9765 | _tmp544_ = self->delegate_target_destroy_type; |
| 9766 | _tmp545_ = bala_get_ccode_name ((BalaCodeNode*) _tmp544_); |
| 9767 | _tmp546_ = _tmp545_; |
| 9768 | _tmp547_ = bala_ccode_parameter_new (_tmp543_, _tmp546_); |
| 9769 | _tmp548_ = _tmp547_; |
| 9770 | bala_ccode_function_add_parameter (_tmp541_, _tmp548_); |
| 9771 | _bala_ccode_node_unref0 (_tmp548_)((_tmp548_ == ((void*)0)) ? ((void*)0) : (_tmp548_ = (bala_ccode_node_unref (_tmp548_), ((void*)0)))); |
| 9772 | _g_free0 (_tmp546_)(_tmp546_ = (g_free (_tmp546_), ((void*)0))); |
| 9773 | _g_free0 (_tmp543_)(_tmp543_ = (g_free (_tmp543_), ((void*)0))); |
| 9774 | } |
| 9775 | _g_free0 (_tmp520_)(_tmp520_ = (g_free (_tmp520_), ((void*)0))); |
| 9776 | } |
| 9777 | } |
| 9778 | if (!is_virtual) { |
| 9779 | gboolean _tmp549_ = FALSE(0); |
| 9780 | gboolean _tmp550_ = FALSE(0); |
| 9781 | BalaProperty* _tmp551_; |
| 9782 | _tmp551_ = prop; |
| 9783 | if (bala_symbol_is_private_symbol ((BalaSymbol*) _tmp551_)) { |
| 9784 | _tmp550_ = TRUE(!(0)); |
| 9785 | } else { |
| 9786 | gboolean _tmp552_ = FALSE(0); |
| 9787 | gboolean _tmp553_; |
| 9788 | gboolean _tmp554_; |
| 9789 | _tmp553_ = bala_property_accessor_get_readable (acc); |
| 9790 | _tmp554_ = _tmp553_; |
| 9791 | if (_tmp554_) { |
| 9792 | _tmp552_ = TRUE(!(0)); |
| 9793 | } else { |
| 9794 | gboolean _tmp555_; |
| 9795 | gboolean _tmp556_; |
| 9796 | _tmp555_ = bala_property_accessor_get_writable (acc); |
| 9797 | _tmp556_ = _tmp555_; |
| 9798 | _tmp552_ = _tmp556_; |
| 9799 | } |
| 9800 | _tmp550_ = !_tmp552_; |
| 9801 | } |
| 9802 | if (_tmp550_) { |
| 9803 | _tmp549_ = TRUE(!(0)); |
| 9804 | } else { |
| 9805 | BalaSymbolAccessibility _tmp557_; |
| 9806 | BalaSymbolAccessibility _tmp558_; |
| 9807 | _tmp557_ = bala_symbol_get_access ((BalaSymbol*) acc); |
| 9808 | _tmp558_ = _tmp557_; |
| 9809 | _tmp549_ = _tmp558_ == BALA_SYMBOL_ACCESSIBILITY_PRIVATE; |
| 9810 | } |
| 9811 | if (_tmp549_) { |
| 9812 | BalaCCodeFunction* _tmp559_; |
| 9813 | BalaCCodeFunction* _tmp560_; |
| 9814 | BalaCCodeModifiers _tmp561_; |
| 9815 | BalaCCodeModifiers _tmp562_; |
| 9816 | _tmp559_ = function; |
| 9817 | _tmp560_ = function; |
| 9818 | _tmp561_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp560_); |
| 9819 | _tmp562_ = _tmp561_; |
| 9820 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp560_, _tmp562_ | BALA_CCODE_MODIFIERS_STATIC); |
| 9821 | } else { |
| 9822 | gboolean _tmp563_ = FALSE(0); |
| 9823 | BalaCodeContext* _tmp564_; |
| 9824 | gboolean _tmp565_; |
| 9825 | gboolean _tmp566_; |
| 9826 | _tmp564_ = self->priv->_context; |
| 9827 | _tmp565_ = bala_code_context_get_hide_internal (_tmp564_); |
| 9828 | _tmp566_ = _tmp565_; |
| 9829 | if (_tmp566_) { |
| 9830 | gboolean _tmp567_ = FALSE(0); |
| 9831 | BalaProperty* _tmp568_; |
| 9832 | _tmp568_ = prop; |
| 9833 | if (bala_symbol_is_internal_symbol ((BalaSymbol*) _tmp568_)) { |
| 9834 | _tmp567_ = TRUE(!(0)); |
| 9835 | } else { |
| 9836 | BalaSymbolAccessibility _tmp569_; |
| 9837 | BalaSymbolAccessibility _tmp570_; |
| 9838 | _tmp569_ = bala_symbol_get_access ((BalaSymbol*) acc); |
| 9839 | _tmp570_ = _tmp569_; |
| 9840 | _tmp567_ = _tmp570_ == BALA_SYMBOL_ACCESSIBILITY_INTERNAL; |
| 9841 | } |
| 9842 | _tmp563_ = _tmp567_; |
| 9843 | } else { |
| 9844 | _tmp563_ = FALSE(0); |
| 9845 | } |
| 9846 | if (_tmp563_) { |
| 9847 | BalaCCodeFunction* _tmp571_; |
| 9848 | BalaCCodeFunction* _tmp572_; |
| 9849 | BalaCCodeModifiers _tmp573_; |
| 9850 | BalaCCodeModifiers _tmp574_; |
| 9851 | _tmp571_ = function; |
| 9852 | _tmp572_ = function; |
| 9853 | _tmp573_ = bala_ccode_node_get_modifiers ((BalaCCodeNode*) _tmp572_); |
| 9854 | _tmp574_ = _tmp573_; |
| 9855 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp572_, _tmp574_ | BALA_CCODE_MODIFIERS_INTERNAL); |
| 9856 | } |
| 9857 | } |
| 9858 | } |
| 9859 | _tmp575_ = function; |
| 9860 | bala_ccode_base_module_push_function (self, _tmp575_); |
| 9861 | _tmp577_ = prop; |
| 9862 | _tmp578_ = bala_property_get_binding (_tmp577_); |
| 9863 | _tmp579_ = _tmp578_; |
| 9864 | if (_tmp579_ == BALA_MEMBER_BINDING_INSTANCE) { |
| 9865 | _tmp576_ = !is_virtual; |
| 9866 | } else { |
| 9867 | _tmp576_ = FALSE(0); |
| 9868 | } |
| 9869 | if (_tmp576_) { |
| 9870 | gboolean _tmp580_ = FALSE(0); |
| 9871 | gboolean _tmp581_; |
| 9872 | gboolean _tmp582_; |
| 9873 | _tmp581_ = bala_property_accessor_get_readable (acc); |
| 9874 | _tmp582_ = _tmp581_; |
| 9875 | if (!_tmp582_) { |
| 9876 | _tmp580_ = TRUE(!(0)); |
| 9877 | } else { |
| 9878 | _tmp580_ = returns_real_struct; |
| 9879 | } |
| 9880 | if (_tmp580_) { |
| 9881 | BalaProperty* _tmp583_; |
| 9882 | BalaTypeSymbol* _tmp584_; |
| 9883 | _tmp583_ = prop; |
| 9884 | _tmp584_ = t; |
| 9885 | bala_ccode_base_module_create_property_type_check_statement (self, _tmp583_, FALSE(0), _tmp584_, TRUE(!(0)), "self"); |
| 9886 | } else { |
| 9887 | BalaProperty* _tmp585_; |
| 9888 | BalaTypeSymbol* _tmp586_; |
| 9889 | _tmp585_ = prop; |
| 9890 | _tmp586_ = t; |
| 9891 | bala_ccode_base_module_create_property_type_check_statement (self, _tmp585_, TRUE(!(0)), _tmp586_, TRUE(!(0)), "self"); |
| 9892 | } |
| 9893 | } |
| 9894 | _tmp588_ = bala_property_accessor_get_readable (acc); |
| 9895 | _tmp589_ = _tmp588_; |
| 9896 | if (_tmp589_) { |
| 9897 | _tmp587_ = !returns_real_struct; |
| 9898 | } else { |
| 9899 | _tmp587_ = FALSE(0); |
| 9900 | } |
| 9901 | if (_tmp587_) { |
| 9902 | gboolean _tmp590_ = FALSE(0); |
| 9903 | BalaBasicBlock* _tmp591_; |
| 9904 | BalaBasicBlock* _tmp592_; |
| 9905 | _tmp591_ = bala_subroutine_get_return_block ((BalaSubroutine*) acc); |
| 9906 | _tmp592_ = _tmp591_; |
| 9907 | if (_tmp592_ == NULL((void*)0)) { |
| 9908 | _tmp590_ = TRUE(!(0)); |
| 9909 | } else { |
| 9910 | BalaBasicBlock* _tmp593_; |
| 9911 | BalaBasicBlock* _tmp594_; |
| 9912 | BalaList* _tmp595_; |
| 9913 | gint _tmp596_; |
| 9914 | gint _tmp597_; |
| 9915 | _tmp593_ = bala_subroutine_get_return_block ((BalaSubroutine*) acc); |
| 9916 | _tmp594_ = _tmp593_; |
| 9917 | _tmp595_ = bala_basic_block_get_predecessors (_tmp594_); |
| 9918 | _tmp596_ = bala_collection_get_size ((BalaCollection*) _tmp595_); |
| 9919 | _tmp597_ = _tmp596_; |
| 9920 | _tmp590_ = _tmp597_ > 0; |
| 9921 | } |
| 9922 | if (_tmp590_) { |
| 9923 | BalaCCodeFunction* _tmp598_; |
| 9924 | BalaCCodeFunction* _tmp599_; |
| 9925 | BalaDataType* _tmp600_; |
| 9926 | BalaDataType* _tmp601_; |
| 9927 | gchar* _tmp602_; |
| 9928 | gchar* _tmp603_; |
| 9929 | BalaCCodeVariableDeclarator* _tmp604_; |
| 9930 | BalaCCodeVariableDeclarator* _tmp605_; |
| 9931 | _tmp598_ = bala_ccode_base_module_get_ccode (self); |
| 9932 | _tmp599_ = _tmp598_; |
| 9933 | _tmp600_ = bala_property_accessor_get_value_type (acc); |
| 9934 | _tmp601_ = _tmp600_; |
| 9935 | _tmp602_ = bala_get_ccode_name ((BalaCodeNode*) _tmp601_); |
| 9936 | _tmp603_ = _tmp602_; |
| 9937 | _tmp604_ = bala_ccode_variable_declarator_new ("result", NULL((void*)0), NULL((void*)0)); |
| 9938 | _tmp605_ = _tmp604_; |
| 9939 | bala_ccode_function_add_declaration (_tmp599_, _tmp603_, (BalaCCodeDeclarator*) _tmp605_, 0); |
| 9940 | _bala_ccode_node_unref0 (_tmp605_)((_tmp605_ == ((void*)0)) ? ((void*)0) : (_tmp605_ = (bala_ccode_node_unref (_tmp605_), ((void*)0)))); |
| 9941 | _g_free0 (_tmp603_)(_tmp603_ = (g_free (_tmp603_), ((void*)0))); |
| 9942 | } |
| 9943 | } |
| 9944 | if (is_virtual) { |
| 9945 | BalaCCodeFunction* _tmp606_; |
| 9946 | BalaCCodeFunction* _tmp607_; |
| 9947 | BalaDataType* _tmp608_; |
| 9948 | gchar* _tmp609_; |
| 9949 | gchar* _tmp610_; |
| 9950 | BalaCCodeVariableDeclarator* _tmp611_; |
| 9951 | BalaCCodeVariableDeclarator* _tmp612_; |
| 9952 | BalaCCodeFunction* _tmp613_; |
| 9953 | BalaCCodeFunction* _tmp614_; |
| 9954 | BalaCCodeIdentifier* _tmp615_; |
| 9955 | BalaCCodeIdentifier* _tmp616_; |
| 9956 | BalaObjectType* _tmp617_; |
| 9957 | BalaCCodeIdentifier* _tmp618_; |
| 9958 | BalaCCodeIdentifier* _tmp619_; |
| 9959 | BalaGLibValue* _tmp620_; |
| 9960 | BalaGLibValue* _tmp621_; |
| 9961 | BalaDataType* _tmp622_; |
| 9962 | BalaTargetValue* _tmp623_; |
| 9963 | BalaTargetValue* _tmp624_; |
| 9964 | BalaCCodeExpression* _tmp625_; |
| 9965 | _tmp606_ = bala_ccode_base_module_get_ccode (self); |
| 9966 | _tmp607_ = _tmp606_; |
| 9967 | _tmp608_ = this_type; |
| 9968 | _tmp609_ = bala_get_ccode_name ((BalaCodeNode*) _tmp608_); |
| 9969 | _tmp610_ = _tmp609_; |
| 9970 | _tmp611_ = bala_ccode_variable_declarator_new ("self", NULL((void*)0), NULL((void*)0)); |
| 9971 | _tmp612_ = _tmp611_; |
| 9972 | bala_ccode_function_add_declaration (_tmp607_, _tmp610_, (BalaCCodeDeclarator*) _tmp612_, 0); |
| 9973 | _bala_ccode_node_unref0 (_tmp612_)((_tmp612_ == ((void*)0)) ? ((void*)0) : (_tmp612_ = (bala_ccode_node_unref (_tmp612_), ((void*)0)))); |
| 9974 | _g_free0 (_tmp610_)(_tmp610_ = (g_free (_tmp610_), ((void*)0))); |
| 9975 | _tmp613_ = bala_ccode_base_module_get_ccode (self); |
| 9976 | _tmp614_ = _tmp613_; |
| 9977 | _tmp615_ = bala_ccode_identifier_new ("self"); |
| 9978 | _tmp616_ = _tmp615_; |
| 9979 | _tmp617_ = base_type; |
| 9980 | _tmp618_ = bala_ccode_identifier_new ("base"); |
| 9981 | _tmp619_ = _tmp618_; |
| 9982 | _tmp620_ = bala_glib_value_new ((BalaDataType*) _tmp617_, (BalaCCodeExpression*) _tmp619_, TRUE(!(0))); |
| 9983 | _tmp621_ = _tmp620_; |
| 9984 | _tmp622_ = this_type; |
| 9985 | _tmp623_ = bala_ccode_base_module_transform_value (self, (BalaTargetValue*) _tmp621_, _tmp622_, (BalaCodeNode*) acc); |
| 9986 | _tmp624_ = _tmp623_; |
| 9987 | _tmp625_ = bala_get_cvalue_ (_tmp624_); |
| 9988 | bala_ccode_function_add_assignment (_tmp614_, (BalaCCodeExpression*) _tmp616_, _tmp625_); |
| 9989 | _bala_target_value_unref0 (_tmp624_)((_tmp624_ == ((void*)0)) ? ((void*)0) : (_tmp624_ = (bala_target_value_unref (_tmp624_), ((void*)0)))); |
| 9990 | _bala_target_value_unref0 (_tmp621_)((_tmp621_ == ((void*)0)) ? ((void*)0) : (_tmp621_ = (bala_target_value_unref (_tmp621_), ((void*)0)))); |
| 9991 | _bala_ccode_node_unref0 (_tmp619_)((_tmp619_ == ((void*)0)) ? ((void*)0) : (_tmp619_ = (bala_ccode_node_unref (_tmp619_), ((void*)0)))); |
| 9992 | _bala_ccode_node_unref0 (_tmp616_)((_tmp616_ == ((void*)0)) ? ((void*)0) : (_tmp616_ = (bala_ccode_node_unref (_tmp616_), ((void*)0)))); |
| 9993 | } |
| 9994 | _tmp628_ = self->priv->_context; |
| 9995 | _tmp629_ = bala_code_context_get_analyzer (_tmp628_); |
| 9996 | _tmp630_ = _tmp629_; |
| 9997 | _tmp631_ = prop; |
| 9998 | if (bala_semantic_analyzer_is_gobject_property (_tmp630_, _tmp631_)) { |
| 9999 | BalaProperty* _tmp632_; |
| 10000 | gboolean _tmp633_; |
| 10001 | gboolean _tmp634_; |
| 10002 | _tmp632_ = prop; |
| 10003 | _tmp633_ = bala_property_get_notify (_tmp632_); |
| 10004 | _tmp634_ = _tmp633_; |
| 10005 | _tmp627_ = _tmp634_; |
| 10006 | } else { |
| 10007 | _tmp627_ = FALSE(0); |
| 10008 | } |
| 10009 | if (_tmp627_) { |
| 10010 | gboolean _tmp635_ = FALSE(0); |
| 10011 | gboolean _tmp636_; |
| 10012 | gboolean _tmp637_; |
| 10013 | _tmp636_ = bala_property_accessor_get_writable (acc); |
| 10014 | _tmp637_ = _tmp636_; |
| 10015 | if (_tmp637_) { |
| 10016 | _tmp635_ = TRUE(!(0)); |
| 10017 | } else { |
| 10018 | gboolean _tmp638_; |
| 10019 | gboolean _tmp639_; |
| 10020 | _tmp638_ = bala_property_accessor_get_construction (acc); |
| 10021 | _tmp639_ = _tmp638_; |
| 10022 | _tmp635_ = _tmp639_; |
| 10023 | } |
| 10024 | _tmp626_ = _tmp635_; |
| 10025 | } else { |
| 10026 | _tmp626_ = FALSE(0); |
| 10027 | } |
| 10028 | if (_tmp626_) { |
| 10029 | BalaCCodeFunctionCall* notify_call = NULL((void*)0); |
| 10030 | BalaCCodeIdentifier* _tmp640_; |
| 10031 | BalaCCodeIdentifier* _tmp641_; |
| 10032 | BalaCCodeFunctionCall* _tmp642_; |
| 10033 | BalaCCodeFunctionCall* _tmp643_; |
| 10034 | BalaCCodeFunctionCall* _tmp644_; |
| 10035 | BalaCCodeIdentifier* _tmp645_; |
| 10036 | BalaCCodeIdentifier* _tmp646_; |
| 10037 | BalaCCodeCastExpression* _tmp647_; |
| 10038 | BalaCCodeCastExpression* _tmp648_; |
| 10039 | BalaCCodeFunctionCall* _tmp649_; |
| 10040 | BalaProperty* _tmp650_; |
| 10041 | BalaCCodeExpression* _tmp651_; |
| 10042 | BalaCCodeExpression* _tmp652_; |
| 10043 | BalaPropertyAccessor* get_accessor = NULL((void*)0); |
| 10044 | BalaProperty* _tmp653_; |
| 10045 | BalaPropertyAccessor* _tmp654_; |
| 10046 | BalaPropertyAccessor* _tmp655_; |
| 10047 | BalaPropertyAccessor* _tmp656_; |
| 10048 | gboolean _tmp657_ = FALSE(0); |
| 10049 | BalaPropertyAccessor* _tmp658_; |
| 10050 | _tmp640_ = bala_ccode_identifier_new ("g_object_notify_by_pspec"); |
| 10051 | _tmp641_ = _tmp640_; |
| 10052 | _tmp642_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp641_); |
| 10053 | _tmp643_ = _tmp642_; |
| 10054 | _bala_ccode_node_unref0 (_tmp641_)((_tmp641_ == ((void*)0)) ? ((void*)0) : (_tmp641_ = (bala_ccode_node_unref (_tmp641_), ((void*)0)))); |
| 10055 | notify_call = _tmp643_; |
| 10056 | _tmp644_ = notify_call; |
| 10057 | _tmp645_ = bala_ccode_identifier_new ("self"); |
| 10058 | _tmp646_ = _tmp645_; |
| 10059 | _tmp647_ = bala_ccode_cast_expression_new ((BalaCCodeExpression*) _tmp646_, "GObject *"); |
| 10060 | _tmp648_ = _tmp647_; |
| 10061 | bala_ccode_function_call_add_argument (_tmp644_, (BalaCCodeExpression*) _tmp648_); |
| 10062 | _bala_ccode_node_unref0 (_tmp648_)((_tmp648_ == ((void*)0)) ? ((void*)0) : (_tmp648_ = (bala_ccode_node_unref (_tmp648_), ((void*)0)))); |
| 10063 | _bala_ccode_node_unref0 (_tmp646_)((_tmp646_ == ((void*)0)) ? ((void*)0) : (_tmp646_ = (bala_ccode_node_unref (_tmp646_), ((void*)0)))); |
| 10064 | _tmp649_ = notify_call; |
| 10065 | _tmp650_ = prop; |
| 10066 | _tmp651_ = bala_ccode_base_module_get_param_spec_cexpression (self, _tmp650_); |
| 10067 | _tmp652_ = _tmp651_; |
| 10068 | bala_ccode_function_call_add_argument (_tmp649_, _tmp652_); |
| 10069 | _bala_ccode_node_unref0 (_tmp652_)((_tmp652_ == ((void*)0)) ? ((void*)0) : (_tmp652_ = (bala_ccode_node_unref (_tmp652_), ((void*)0)))); |
| 10070 | _tmp653_ = prop; |
| 10071 | _tmp654_ = bala_property_get_get_accessor (_tmp653_); |
| 10072 | _tmp655_ = _tmp654_; |
| 10073 | _tmp656_ = _bala_code_node_ref0 (_tmp655_); |
| 10074 | get_accessor = _tmp656_; |
| 10075 | _tmp658_ = get_accessor; |
| 10076 | if (_tmp658_ != NULL((void*)0)) { |
| 10077 | BalaPropertyAccessor* _tmp659_; |
| 10078 | gboolean _tmp660_; |
| 10079 | gboolean _tmp661_; |
| 10080 | _tmp659_ = get_accessor; |
| 10081 | _tmp660_ = bala_property_accessor_get_automatic_body (_tmp659_); |
| 10082 | _tmp661_ = _tmp660_; |
| 10083 | _tmp657_ = _tmp661_; |
| 10084 | } else { |
| 10085 | _tmp657_ = FALSE(0); |
| 10086 | } |
| 10087 | if (_tmp657_) { |
| 10088 | BalaDataType* property_type = NULL((void*)0); |
| 10089 | BalaProperty* _tmp662_; |
| 10090 | BalaDataType* _tmp663_; |
| 10091 | BalaDataType* _tmp664_; |
| 10092 | BalaDataType* _tmp665_; |
| 10093 | BalaCCodeFunctionCall* get_call = NULL((void*)0); |
| 10094 | BalaPropertyAccessor* _tmp666_; |
| 10095 | gchar* _tmp667_; |
| 10096 | gchar* _tmp668_; |
| 10097 | BalaCCodeIdentifier* _tmp669_; |
| 10098 | BalaCCodeIdentifier* _tmp670_; |
| 10099 | BalaCCodeFunctionCall* _tmp671_; |
| 10100 | BalaCCodeFunctionCall* _tmp672_; |
| 10101 | const gchar* _tmp673_ = NULL((void*)0); |
| 10102 | BalaCCodeFunctionCall* _tmp674_; |
| 10103 | BalaCCodeIdentifier* _tmp675_; |
| 10104 | BalaCCodeIdentifier* _tmp676_; |
| 10105 | gboolean _tmp677_ = FALSE(0); |
| 10106 | BalaDataType* _tmp678_; |
| 10107 | BalaBlock* _tmp827_; |
| 10108 | BalaBlock* _tmp828_; |
| 10109 | BalaCCodeFunction* _tmp829_; |
| 10110 | BalaCCodeFunction* _tmp830_; |
| 10111 | BalaCCodeFunctionCall* _tmp831_; |
| 10112 | BalaCCodeFunction* _tmp832_; |
| 10113 | BalaCCodeFunction* _tmp833_; |
| 10114 | BalaProperty* _tmp834_; |
| 10115 | BalaPropertyAccessor* _tmp835_; |
| 10116 | BalaPropertyAccessor* _tmp836_; |
| 10117 | BalaDataType* _tmp837_; |
| 10118 | BalaDataType* _tmp838_; |
| 10119 | _tmp662_ = prop; |
| 10120 | _tmp663_ = bala_property_get_property_type (_tmp662_); |
| 10121 | _tmp664_ = _tmp663_; |
| 10122 | _tmp665_ = _bala_code_node_ref0 (_tmp664_); |
| 10123 | property_type = _tmp665_; |
| 10124 | _tmp666_ = get_accessor; |
| 10125 | _tmp667_ = bala_get_ccode_real_name ((BalaSymbol*) _tmp666_); |
| 10126 | _tmp668_ = _tmp667_; |
| 10127 | _tmp669_ = bala_ccode_identifier_new (_tmp668_); |
| 10128 | _tmp670_ = _tmp669_; |
| 10129 | _tmp671_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp670_); |
| 10130 | _tmp672_ = _tmp671_; |
| 10131 | _bala_ccode_node_unref0 (_tmp670_)((_tmp670_ == ((void*)0)) ? ((void*)0) : (_tmp670_ = (bala_ccode_node_unref (_tmp670_), ((void*)0)))); |
| 10132 | _g_free0 (_tmp668_)(_tmp668_ = (g_free (_tmp668_), ((void*)0))); |
| 10133 | get_call = _tmp672_; |
| 10134 | if (is_virtual) { |
| 10135 | _tmp673_ = "base"; |
| 10136 | } else { |
| 10137 | _tmp673_ = "self"; |
| 10138 | } |
| 10139 | _tmp674_ = get_call; |
| 10140 | _tmp675_ = bala_ccode_identifier_new (_tmp673_); |
| 10141 | _tmp676_ = _tmp675_; |
| 10142 | bala_ccode_function_call_add_argument (_tmp674_, (BalaCCodeExpression*) _tmp676_); |
| 10143 | _bala_ccode_node_unref0 (_tmp676_)((_tmp676_ == ((void*)0)) ? ((void*)0) : (_tmp676_ = (bala_ccode_node_unref (_tmp676_), ((void*)0)))); |
| 10144 | _tmp678_ = property_type; |
| 10145 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp678_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp678_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 10146 | BalaProperty* _tmp679_; |
| 10147 | _tmp679_ = prop; |
| 10148 | _tmp677_ = bala_get_ccode_array_length ((BalaCodeNode*) _tmp679_); |
| 10149 | } else { |
| 10150 | _tmp677_ = FALSE(0); |
| 10151 | } |
| 10152 | if (_tmp677_) { |
| 10153 | BalaCCodeFunction* _tmp680_; |
| 10154 | BalaCCodeFunction* _tmp681_; |
| 10155 | BalaDataType* _tmp682_; |
| 10156 | gchar* _tmp683_; |
| 10157 | gchar* _tmp684_; |
| 10158 | BalaCCodeVariableDeclarator* _tmp685_; |
| 10159 | BalaCCodeVariableDeclarator* _tmp686_; |
| 10160 | BalaCCodeFunction* _tmp687_; |
| 10161 | BalaCCodeFunction* _tmp688_; |
| 10162 | BalaProperty* _tmp689_; |
| 10163 | gchar* _tmp690_; |
| 10164 | gchar* _tmp691_; |
| 10165 | BalaCCodeVariableDeclarator* _tmp692_; |
| 10166 | BalaCCodeVariableDeclarator* _tmp693_; |
| 10167 | BalaCCodeFunctionCall* _tmp694_; |
| 10168 | BalaCCodeIdentifier* _tmp695_; |
| 10169 | BalaCCodeIdentifier* _tmp696_; |
| 10170 | BalaCCodeUnaryExpression* _tmp697_; |
| 10171 | BalaCCodeUnaryExpression* _tmp698_; |
| 10172 | BalaCCodeFunction* _tmp699_; |
| 10173 | BalaCCodeFunction* _tmp700_; |
| 10174 | BalaCCodeIdentifier* _tmp701_; |
| 10175 | BalaCCodeIdentifier* _tmp702_; |
| 10176 | BalaCCodeFunctionCall* _tmp703_; |
| 10177 | BalaCCodeFunction* _tmp704_; |
| 10178 | BalaCCodeFunction* _tmp705_; |
| 10179 | BalaCCodeIdentifier* _tmp706_; |
| 10180 | BalaCCodeIdentifier* _tmp707_; |
| 10181 | BalaCCodeIdentifier* _tmp708_; |
| 10182 | BalaCCodeIdentifier* _tmp709_; |
| 10183 | BalaCCodeBinaryExpression* _tmp710_; |
| 10184 | BalaCCodeBinaryExpression* _tmp711_; |
| 10185 | _tmp680_ = bala_ccode_base_module_get_ccode (self); |
| 10186 | _tmp681_ = _tmp680_; |
| 10187 | _tmp682_ = property_type; |
| 10188 | _tmp683_ = bala_get_ccode_name ((BalaCodeNode*) _tmp682_); |
| 10189 | _tmp684_ = _tmp683_; |
| 10190 | _tmp685_ = bala_ccode_variable_declarator_new ("old_value", NULL((void*)0), NULL((void*)0)); |
| 10191 | _tmp686_ = _tmp685_; |
| 10192 | bala_ccode_function_add_declaration (_tmp681_, _tmp684_, (BalaCCodeDeclarator*) _tmp686_, 0); |
| 10193 | _bala_ccode_node_unref0 (_tmp686_)((_tmp686_ == ((void*)0)) ? ((void*)0) : (_tmp686_ = (bala_ccode_node_unref (_tmp686_), ((void*)0)))); |
| 10194 | _g_free0 (_tmp684_)(_tmp684_ = (g_free (_tmp684_), ((void*)0))); |
| 10195 | _tmp687_ = bala_ccode_base_module_get_ccode (self); |
| 10196 | _tmp688_ = _tmp687_; |
| 10197 | _tmp689_ = prop; |
| 10198 | _tmp690_ = bala_get_ccode_array_length_type ((BalaCodeNode*) _tmp689_); |
| 10199 | _tmp691_ = _tmp690_; |
| 10200 | _tmp692_ = bala_ccode_variable_declarator_new ("old_value_length", NULL((void*)0), NULL((void*)0)); |
| 10201 | _tmp693_ = _tmp692_; |
| 10202 | bala_ccode_function_add_declaration (_tmp688_, _tmp691_, (BalaCCodeDeclarator*) _tmp693_, 0); |
| 10203 | _bala_ccode_node_unref0 (_tmp693_)((_tmp693_ == ((void*)0)) ? ((void*)0) : (_tmp693_ = (bala_ccode_node_unref (_tmp693_), ((void*)0)))); |
| 10204 | _g_free0 (_tmp691_)(_tmp691_ = (g_free (_tmp691_), ((void*)0))); |
| 10205 | _tmp694_ = get_call; |
| 10206 | _tmp695_ = bala_ccode_identifier_new ("old_value_length"); |
| 10207 | _tmp696_ = _tmp695_; |
| 10208 | _tmp697_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, (BalaCCodeExpression*) _tmp696_); |
| 10209 | _tmp698_ = _tmp697_; |
| 10210 | bala_ccode_function_call_add_argument (_tmp694_, (BalaCCodeExpression*) _tmp698_); |
| 10211 | _bala_ccode_node_unref0 (_tmp698_)((_tmp698_ == ((void*)0)) ? ((void*)0) : (_tmp698_ = (bala_ccode_node_unref (_tmp698_), ((void*)0)))); |
| 10212 | _bala_ccode_node_unref0 (_tmp696_)((_tmp696_ == ((void*)0)) ? ((void*)0) : (_tmp696_ = (bala_ccode_node_unref (_tmp696_), ((void*)0)))); |
| 10213 | _tmp699_ = bala_ccode_base_module_get_ccode (self); |
| 10214 | _tmp700_ = _tmp699_; |
| 10215 | _tmp701_ = bala_ccode_identifier_new ("old_value"); |
| 10216 | _tmp702_ = _tmp701_; |
| 10217 | _tmp703_ = get_call; |
| 10218 | bala_ccode_function_add_assignment (_tmp700_, (BalaCCodeExpression*) _tmp702_, (BalaCCodeExpression*) _tmp703_); |
| 10219 | _bala_ccode_node_unref0 (_tmp702_)((_tmp702_ == ((void*)0)) ? ((void*)0) : (_tmp702_ = (bala_ccode_node_unref (_tmp702_), ((void*)0)))); |
| 10220 | _tmp704_ = bala_ccode_base_module_get_ccode (self); |
| 10221 | _tmp705_ = _tmp704_; |
| 10222 | _tmp706_ = bala_ccode_identifier_new ("old_value"); |
| 10223 | _tmp707_ = _tmp706_; |
| 10224 | _tmp708_ = bala_ccode_identifier_new ("value"); |
| 10225 | _tmp709_ = _tmp708_; |
| 10226 | _tmp710_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_INEQUALITY, (BalaCCodeExpression*) _tmp707_, (BalaCCodeExpression*) _tmp709_); |
| 10227 | _tmp711_ = _tmp710_; |
| 10228 | bala_ccode_function_open_if (_tmp705_, (BalaCCodeExpression*) _tmp711_); |
| 10229 | _bala_ccode_node_unref0 (_tmp711_)((_tmp711_ == ((void*)0)) ? ((void*)0) : (_tmp711_ = (bala_ccode_node_unref (_tmp711_), ((void*)0)))); |
| 10230 | _bala_ccode_node_unref0 (_tmp709_)((_tmp709_ == ((void*)0)) ? ((void*)0) : (_tmp709_ = (bala_ccode_node_unref (_tmp709_), ((void*)0)))); |
| 10231 | _bala_ccode_node_unref0 (_tmp707_)((_tmp707_ == ((void*)0)) ? ((void*)0) : (_tmp707_ = (bala_ccode_node_unref (_tmp707_), ((void*)0)))); |
| 10232 | } else { |
| 10233 | BalaDataType* _tmp712_; |
| 10234 | BalaDataType* _tmp713_; |
| 10235 | _tmp712_ = property_type; |
| 10236 | _tmp713_ = self->string_type; |
| 10237 | if (bala_data_type_compatible (_tmp712_, _tmp713_)) { |
| 10238 | BalaCCodeFunction* _tmp714_; |
| 10239 | BalaCCodeFunction* _tmp715_; |
| 10240 | BalaDataType* _tmp716_; |
| 10241 | gchar* _tmp717_; |
| 10242 | gchar* _tmp718_; |
| 10243 | BalaCCodeVariableDeclarator* _tmp719_; |
| 10244 | BalaCCodeVariableDeclarator* _tmp720_; |
| 10245 | BalaCCodeFunction* _tmp721_; |
| 10246 | BalaCCodeFunction* _tmp722_; |
| 10247 | BalaCCodeIdentifier* _tmp723_; |
| 10248 | BalaCCodeIdentifier* _tmp724_; |
| 10249 | BalaCCodeFunctionCall* _tmp725_; |
| 10250 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 10251 | BalaCodeContext* _tmp726_; |
| 10252 | BalaProfile _tmp727_; |
| 10253 | BalaProfile _tmp728_; |
| 10254 | BalaCCodeFunctionCall* _tmp740_; |
| 10255 | BalaCCodeIdentifier* _tmp741_; |
| 10256 | BalaCCodeIdentifier* _tmp742_; |
| 10257 | BalaCCodeFunctionCall* _tmp743_; |
| 10258 | BalaCCodeIdentifier* _tmp744_; |
| 10259 | BalaCCodeIdentifier* _tmp745_; |
| 10260 | BalaCCodeFunction* _tmp746_; |
| 10261 | BalaCCodeFunction* _tmp747_; |
| 10262 | BalaCCodeFunctionCall* _tmp748_; |
| 10263 | BalaCCodeConstant* _tmp749_; |
| 10264 | BalaCCodeConstant* _tmp750_; |
| 10265 | BalaCCodeBinaryExpression* _tmp751_; |
| 10266 | BalaCCodeBinaryExpression* _tmp752_; |
| 10267 | _tmp714_ = bala_ccode_base_module_get_ccode (self); |
| 10268 | _tmp715_ = _tmp714_; |
| 10269 | _tmp716_ = property_type; |
| 10270 | _tmp717_ = bala_get_ccode_name ((BalaCodeNode*) _tmp716_); |
| 10271 | _tmp718_ = _tmp717_; |
| 10272 | _tmp719_ = bala_ccode_variable_declarator_new ("old_value", NULL((void*)0), NULL((void*)0)); |
| 10273 | _tmp720_ = _tmp719_; |
| 10274 | bala_ccode_function_add_declaration (_tmp715_, _tmp718_, (BalaCCodeDeclarator*) _tmp720_, 0); |
| 10275 | _bala_ccode_node_unref0 (_tmp720_)((_tmp720_ == ((void*)0)) ? ((void*)0) : (_tmp720_ = (bala_ccode_node_unref (_tmp720_), ((void*)0)))); |
| 10276 | _g_free0 (_tmp718_)(_tmp718_ = (g_free (_tmp718_), ((void*)0))); |
| 10277 | _tmp721_ = bala_ccode_base_module_get_ccode (self); |
| 10278 | _tmp722_ = _tmp721_; |
| 10279 | _tmp723_ = bala_ccode_identifier_new ("old_value"); |
| 10280 | _tmp724_ = _tmp723_; |
| 10281 | _tmp725_ = get_call; |
| 10282 | bala_ccode_function_add_assignment (_tmp722_, (BalaCCodeExpression*) _tmp724_, (BalaCCodeExpression*) _tmp725_); |
| 10283 | _bala_ccode_node_unref0 (_tmp724_)((_tmp724_ == ((void*)0)) ? ((void*)0) : (_tmp724_ = (bala_ccode_node_unref (_tmp724_), ((void*)0)))); |
| 10284 | _tmp726_ = self->priv->_context; |
| 10285 | _tmp727_ = bala_code_context_get_profile (_tmp726_); |
| 10286 | _tmp728_ = _tmp727_; |
| 10287 | if (_tmp728_ == BALA_PROFILE_POSIX) { |
| 10288 | BalaCCodeFile* _tmp729_; |
| 10289 | BalaCCodeIdentifier* _tmp730_; |
| 10290 | BalaCCodeIdentifier* _tmp731_; |
| 10291 | gchar* _tmp732_; |
| 10292 | gchar* _tmp733_; |
| 10293 | BalaCCodeIdentifier* _tmp734_; |
| 10294 | BalaCCodeIdentifier* _tmp735_; |
| 10295 | BalaCCodeFunctionCall* _tmp736_; |
| 10296 | _tmp729_ = self->cfile; |
| 10297 | bala_ccode_file_add_include (_tmp729_, "string.h", FALSE(0)); |
| 10298 | _tmp730_ = bala_ccode_identifier_new ("strcmp"); |
| 10299 | _tmp731_ = _tmp730_; |
| 10300 | _tmp732_ = bala_ccode_base_module_generate_cmp_wrapper (self, _tmp731_); |
| 10301 | _tmp733_ = _tmp732_; |
| 10302 | _tmp734_ = bala_ccode_identifier_new (_tmp733_); |
| 10303 | _tmp735_ = _tmp734_; |
| 10304 | _tmp736_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp735_); |
| 10305 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 10306 | ccall = _tmp736_; |
| 10307 | _bala_ccode_node_unref0 (_tmp735_)((_tmp735_ == ((void*)0)) ? ((void*)0) : (_tmp735_ = (bala_ccode_node_unref (_tmp735_), ((void*)0)))); |
| 10308 | _g_free0 (_tmp733_)(_tmp733_ = (g_free (_tmp733_), ((void*)0))); |
| 10309 | _bala_ccode_node_unref0 (_tmp731_)((_tmp731_ == ((void*)0)) ? ((void*)0) : (_tmp731_ = (bala_ccode_node_unref (_tmp731_), ((void*)0)))); |
| 10310 | } else { |
| 10311 | BalaCCodeIdentifier* _tmp737_; |
| 10312 | BalaCCodeIdentifier* _tmp738_; |
| 10313 | BalaCCodeFunctionCall* _tmp739_; |
| 10314 | _tmp737_ = bala_ccode_identifier_new ("g_strcmp0"); |
| 10315 | _tmp738_ = _tmp737_; |
| 10316 | _tmp739_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp738_); |
| 10317 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 10318 | ccall = _tmp739_; |
| 10319 | _bala_ccode_node_unref0 (_tmp738_)((_tmp738_ == ((void*)0)) ? ((void*)0) : (_tmp738_ = (bala_ccode_node_unref (_tmp738_), ((void*)0)))); |
| 10320 | } |
| 10321 | _tmp740_ = ccall; |
| 10322 | _tmp741_ = bala_ccode_identifier_new ("value"); |
| 10323 | _tmp742_ = _tmp741_; |
| 10324 | bala_ccode_function_call_add_argument (_tmp740_, (BalaCCodeExpression*) _tmp742_); |
| 10325 | _bala_ccode_node_unref0 (_tmp742_)((_tmp742_ == ((void*)0)) ? ((void*)0) : (_tmp742_ = (bala_ccode_node_unref (_tmp742_), ((void*)0)))); |
| 10326 | _tmp743_ = ccall; |
| 10327 | _tmp744_ = bala_ccode_identifier_new ("old_value"); |
| 10328 | _tmp745_ = _tmp744_; |
| 10329 | bala_ccode_function_call_add_argument (_tmp743_, (BalaCCodeExpression*) _tmp745_); |
| 10330 | _bala_ccode_node_unref0 (_tmp745_)((_tmp745_ == ((void*)0)) ? ((void*)0) : (_tmp745_ = (bala_ccode_node_unref (_tmp745_), ((void*)0)))); |
| 10331 | _tmp746_ = bala_ccode_base_module_get_ccode (self); |
| 10332 | _tmp747_ = _tmp746_; |
| 10333 | _tmp748_ = ccall; |
| 10334 | _tmp749_ = bala_ccode_constant_new ("0"); |
| 10335 | _tmp750_ = _tmp749_; |
| 10336 | _tmp751_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_INEQUALITY, (BalaCCodeExpression*) _tmp748_, (BalaCCodeExpression*) _tmp750_); |
| 10337 | _tmp752_ = _tmp751_; |
| 10338 | bala_ccode_function_open_if (_tmp747_, (BalaCCodeExpression*) _tmp752_); |
| 10339 | _bala_ccode_node_unref0 (_tmp752_)((_tmp752_ == ((void*)0)) ? ((void*)0) : (_tmp752_ = (bala_ccode_node_unref (_tmp752_), ((void*)0)))); |
| 10340 | _bala_ccode_node_unref0 (_tmp750_)((_tmp750_ == ((void*)0)) ? ((void*)0) : (_tmp750_ = (bala_ccode_node_unref (_tmp750_), ((void*)0)))); |
| 10341 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 10342 | } else { |
| 10343 | BalaDataType* _tmp753_; |
| 10344 | _tmp753_ = property_type; |
| 10345 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp753_, BALA_TYPE_STRUCT_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp753_); GType __t = ((bala_struct_value_type_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 10346 | BalaCCodeFunction* _tmp754_; |
| 10347 | BalaCCodeFunction* _tmp755_; |
| 10348 | BalaDataType* _tmp756_; |
| 10349 | gchar* _tmp757_; |
| 10350 | gchar* _tmp758_; |
| 10351 | BalaCCodeVariableDeclarator* _tmp759_; |
| 10352 | BalaCCodeVariableDeclarator* _tmp760_; |
| 10353 | BalaDataType* _tmp761_; |
| 10354 | gboolean _tmp762_; |
| 10355 | gboolean _tmp763_; |
| 10356 | gchar* equalfunc = NULL((void*)0); |
| 10357 | BalaDataType* _tmp777_; |
| 10358 | BalaTypeSymbol* _tmp778_; |
| 10359 | BalaTypeSymbol* _tmp779_; |
| 10360 | gchar* _tmp780_; |
| 10361 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 10362 | const gchar* _tmp781_; |
| 10363 | BalaCCodeIdentifier* _tmp782_; |
| 10364 | BalaCCodeIdentifier* _tmp783_; |
| 10365 | BalaCCodeFunctionCall* _tmp784_; |
| 10366 | BalaCCodeFunctionCall* _tmp785_; |
| 10367 | BalaCCodeFunctionCall* _tmp786_; |
| 10368 | BalaCCodeIdentifier* _tmp787_; |
| 10369 | BalaCCodeIdentifier* _tmp788_; |
| 10370 | BalaDataType* _tmp789_; |
| 10371 | gboolean _tmp790_; |
| 10372 | gboolean _tmp791_; |
| 10373 | BalaCCodeFunction* _tmp800_; |
| 10374 | BalaCCodeFunction* _tmp801_; |
| 10375 | BalaCCodeFunctionCall* _tmp802_; |
| 10376 | BalaCCodeConstant* _tmp803_; |
| 10377 | BalaCCodeConstant* _tmp804_; |
| 10378 | BalaCCodeBinaryExpression* _tmp805_; |
| 10379 | BalaCCodeBinaryExpression* _tmp806_; |
| 10380 | _tmp754_ = bala_ccode_base_module_get_ccode (self); |
| 10381 | _tmp755_ = _tmp754_; |
| 10382 | _tmp756_ = property_type; |
| 10383 | _tmp757_ = bala_get_ccode_name ((BalaCodeNode*) _tmp756_); |
| 10384 | _tmp758_ = _tmp757_; |
| 10385 | _tmp759_ = bala_ccode_variable_declarator_new ("old_value", NULL((void*)0), NULL((void*)0)); |
| 10386 | _tmp760_ = _tmp759_; |
| 10387 | bala_ccode_function_add_declaration (_tmp755_, _tmp758_, (BalaCCodeDeclarator*) _tmp760_, 0); |
| 10388 | _bala_ccode_node_unref0 (_tmp760_)((_tmp760_ == ((void*)0)) ? ((void*)0) : (_tmp760_ = (bala_ccode_node_unref (_tmp760_), ((void*)0)))); |
| 10389 | _g_free0 (_tmp758_)(_tmp758_ = (g_free (_tmp758_), ((void*)0))); |
| 10390 | _tmp761_ = property_type; |
| 10391 | _tmp762_ = bala_data_type_get_nullable (_tmp761_); |
| 10392 | _tmp763_ = _tmp762_; |
| 10393 | if (_tmp763_) { |
| 10394 | BalaCCodeFunction* _tmp764_; |
| 10395 | BalaCCodeFunction* _tmp765_; |
| 10396 | BalaCCodeIdentifier* _tmp766_; |
| 10397 | BalaCCodeIdentifier* _tmp767_; |
| 10398 | BalaCCodeFunctionCall* _tmp768_; |
| 10399 | _tmp764_ = bala_ccode_base_module_get_ccode (self); |
| 10400 | _tmp765_ = _tmp764_; |
| 10401 | _tmp766_ = bala_ccode_identifier_new ("old_value"); |
| 10402 | _tmp767_ = _tmp766_; |
| 10403 | _tmp768_ = get_call; |
| 10404 | bala_ccode_function_add_assignment (_tmp765_, (BalaCCodeExpression*) _tmp767_, (BalaCCodeExpression*) _tmp768_); |
| 10405 | _bala_ccode_node_unref0 (_tmp767_)((_tmp767_ == ((void*)0)) ? ((void*)0) : (_tmp767_ = (bala_ccode_node_unref (_tmp767_), ((void*)0)))); |
| 10406 | } else { |
| 10407 | BalaCCodeFunctionCall* _tmp769_; |
| 10408 | BalaCCodeIdentifier* _tmp770_; |
| 10409 | BalaCCodeIdentifier* _tmp771_; |
| 10410 | BalaCCodeUnaryExpression* _tmp772_; |
| 10411 | BalaCCodeUnaryExpression* _tmp773_; |
| 10412 | BalaCCodeFunction* _tmp774_; |
| 10413 | BalaCCodeFunction* _tmp775_; |
| 10414 | BalaCCodeFunctionCall* _tmp776_; |
| 10415 | _tmp769_ = get_call; |
| 10416 | _tmp770_ = bala_ccode_identifier_new ("old_value"); |
| 10417 | _tmp771_ = _tmp770_; |
| 10418 | _tmp772_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, (BalaCCodeExpression*) _tmp771_); |
| 10419 | _tmp773_ = _tmp772_; |
| 10420 | bala_ccode_function_call_add_argument (_tmp769_, (BalaCCodeExpression*) _tmp773_); |
| 10421 | _bala_ccode_node_unref0 (_tmp773_)((_tmp773_ == ((void*)0)) ? ((void*)0) : (_tmp773_ = (bala_ccode_node_unref (_tmp773_), ((void*)0)))); |
| 10422 | _bala_ccode_node_unref0 (_tmp771_)((_tmp771_ == ((void*)0)) ? ((void*)0) : (_tmp771_ = (bala_ccode_node_unref (_tmp771_), ((void*)0)))); |
| 10423 | _tmp774_ = bala_ccode_base_module_get_ccode (self); |
| 10424 | _tmp775_ = _tmp774_; |
| 10425 | _tmp776_ = get_call; |
| 10426 | bala_ccode_function_add_expression (_tmp775_, (BalaCCodeExpression*) _tmp776_); |
| 10427 | } |
| 10428 | _tmp777_ = property_type; |
| 10429 | _tmp778_ = bala_data_type_get_type_symbol (_tmp777_); |
| 10430 | _tmp779_ = _tmp778_; |
| 10431 | _tmp780_ = bala_ccode_base_module_generate_struct_equal_function (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp779_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp779_), ((bala_struct_get_type ())))))); |
| 10432 | equalfunc = _tmp780_; |
| 10433 | _tmp781_ = equalfunc; |
| 10434 | _tmp782_ = bala_ccode_identifier_new (_tmp781_); |
| 10435 | _tmp783_ = _tmp782_; |
| 10436 | _tmp784_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp783_); |
| 10437 | _tmp785_ = _tmp784_; |
| 10438 | _bala_ccode_node_unref0 (_tmp783_)((_tmp783_ == ((void*)0)) ? ((void*)0) : (_tmp783_ = (bala_ccode_node_unref (_tmp783_), ((void*)0)))); |
| 10439 | ccall = _tmp785_; |
| 10440 | _tmp786_ = ccall; |
| 10441 | _tmp787_ = bala_ccode_identifier_new ("value"); |
| 10442 | _tmp788_ = _tmp787_; |
| 10443 | bala_ccode_function_call_add_argument (_tmp786_, (BalaCCodeExpression*) _tmp788_); |
| 10444 | _bala_ccode_node_unref0 (_tmp788_)((_tmp788_ == ((void*)0)) ? ((void*)0) : (_tmp788_ = (bala_ccode_node_unref (_tmp788_), ((void*)0)))); |
| 10445 | _tmp789_ = property_type; |
| 10446 | _tmp790_ = bala_data_type_get_nullable (_tmp789_); |
| 10447 | _tmp791_ = _tmp790_; |
| 10448 | if (_tmp791_) { |
| 10449 | BalaCCodeFunctionCall* _tmp792_; |
| 10450 | BalaCCodeIdentifier* _tmp793_; |
| 10451 | BalaCCodeIdentifier* _tmp794_; |
| 10452 | _tmp792_ = ccall; |
| 10453 | _tmp793_ = bala_ccode_identifier_new ("old_value"); |
| 10454 | _tmp794_ = _tmp793_; |
| 10455 | bala_ccode_function_call_add_argument (_tmp792_, (BalaCCodeExpression*) _tmp794_); |
| 10456 | _bala_ccode_node_unref0 (_tmp794_)((_tmp794_ == ((void*)0)) ? ((void*)0) : (_tmp794_ = (bala_ccode_node_unref (_tmp794_), ((void*)0)))); |
| 10457 | } else { |
| 10458 | BalaCCodeFunctionCall* _tmp795_; |
| 10459 | BalaCCodeIdentifier* _tmp796_; |
| 10460 | BalaCCodeIdentifier* _tmp797_; |
| 10461 | BalaCCodeUnaryExpression* _tmp798_; |
| 10462 | BalaCCodeUnaryExpression* _tmp799_; |
| 10463 | _tmp795_ = ccall; |
| 10464 | _tmp796_ = bala_ccode_identifier_new ("old_value"); |
| 10465 | _tmp797_ = _tmp796_; |
| 10466 | _tmp798_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, (BalaCCodeExpression*) _tmp797_); |
| 10467 | _tmp799_ = _tmp798_; |
| 10468 | bala_ccode_function_call_add_argument (_tmp795_, (BalaCCodeExpression*) _tmp799_); |
| 10469 | _bala_ccode_node_unref0 (_tmp799_)((_tmp799_ == ((void*)0)) ? ((void*)0) : (_tmp799_ = (bala_ccode_node_unref (_tmp799_), ((void*)0)))); |
| 10470 | _bala_ccode_node_unref0 (_tmp797_)((_tmp797_ == ((void*)0)) ? ((void*)0) : (_tmp797_ = (bala_ccode_node_unref (_tmp797_), ((void*)0)))); |
| 10471 | } |
| 10472 | _tmp800_ = bala_ccode_base_module_get_ccode (self); |
| 10473 | _tmp801_ = _tmp800_; |
| 10474 | _tmp802_ = ccall; |
| 10475 | _tmp803_ = bala_ccode_constant_new ("TRUE"); |
| 10476 | _tmp804_ = _tmp803_; |
| 10477 | _tmp805_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_INEQUALITY, (BalaCCodeExpression*) _tmp802_, (BalaCCodeExpression*) _tmp804_); |
| 10478 | _tmp806_ = _tmp805_; |
| 10479 | bala_ccode_function_open_if (_tmp801_, (BalaCCodeExpression*) _tmp806_); |
| 10480 | _bala_ccode_node_unref0 (_tmp806_)((_tmp806_ == ((void*)0)) ? ((void*)0) : (_tmp806_ = (bala_ccode_node_unref (_tmp806_), ((void*)0)))); |
| 10481 | _bala_ccode_node_unref0 (_tmp804_)((_tmp804_ == ((void*)0)) ? ((void*)0) : (_tmp804_ = (bala_ccode_node_unref (_tmp804_), ((void*)0)))); |
| 10482 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 10483 | _g_free0 (equalfunc)(equalfunc = (g_free (equalfunc), ((void*)0))); |
| 10484 | } else { |
| 10485 | BalaCCodeFunction* _tmp807_; |
| 10486 | BalaCCodeFunction* _tmp808_; |
| 10487 | BalaDataType* _tmp809_; |
| 10488 | gchar* _tmp810_; |
| 10489 | gchar* _tmp811_; |
| 10490 | BalaCCodeVariableDeclarator* _tmp812_; |
| 10491 | BalaCCodeVariableDeclarator* _tmp813_; |
| 10492 | BalaCCodeFunction* _tmp814_; |
| 10493 | BalaCCodeFunction* _tmp815_; |
| 10494 | BalaCCodeIdentifier* _tmp816_; |
| 10495 | BalaCCodeIdentifier* _tmp817_; |
| 10496 | BalaCCodeFunctionCall* _tmp818_; |
| 10497 | BalaCCodeFunction* _tmp819_; |
| 10498 | BalaCCodeFunction* _tmp820_; |
| 10499 | BalaCCodeIdentifier* _tmp821_; |
| 10500 | BalaCCodeIdentifier* _tmp822_; |
| 10501 | BalaCCodeIdentifier* _tmp823_; |
| 10502 | BalaCCodeIdentifier* _tmp824_; |
| 10503 | BalaCCodeBinaryExpression* _tmp825_; |
| 10504 | BalaCCodeBinaryExpression* _tmp826_; |
| 10505 | _tmp807_ = bala_ccode_base_module_get_ccode (self); |
| 10506 | _tmp808_ = _tmp807_; |
| 10507 | _tmp809_ = property_type; |
| 10508 | _tmp810_ = bala_get_ccode_name ((BalaCodeNode*) _tmp809_); |
| 10509 | _tmp811_ = _tmp810_; |
| 10510 | _tmp812_ = bala_ccode_variable_declarator_new ("old_value", NULL((void*)0), NULL((void*)0)); |
| 10511 | _tmp813_ = _tmp812_; |
| 10512 | bala_ccode_function_add_declaration (_tmp808_, _tmp811_, (BalaCCodeDeclarator*) _tmp813_, 0); |
| 10513 | _bala_ccode_node_unref0 (_tmp813_)((_tmp813_ == ((void*)0)) ? ((void*)0) : (_tmp813_ = (bala_ccode_node_unref (_tmp813_), ((void*)0)))); |
| 10514 | _g_free0 (_tmp811_)(_tmp811_ = (g_free (_tmp811_), ((void*)0))); |
| 10515 | _tmp814_ = bala_ccode_base_module_get_ccode (self); |
| 10516 | _tmp815_ = _tmp814_; |
| 10517 | _tmp816_ = bala_ccode_identifier_new ("old_value"); |
| 10518 | _tmp817_ = _tmp816_; |
| 10519 | _tmp818_ = get_call; |
| 10520 | bala_ccode_function_add_assignment (_tmp815_, (BalaCCodeExpression*) _tmp817_, (BalaCCodeExpression*) _tmp818_); |
| 10521 | _bala_ccode_node_unref0 (_tmp817_)((_tmp817_ == ((void*)0)) ? ((void*)0) : (_tmp817_ = (bala_ccode_node_unref (_tmp817_), ((void*)0)))); |
| 10522 | _tmp819_ = bala_ccode_base_module_get_ccode (self); |
| 10523 | _tmp820_ = _tmp819_; |
| 10524 | _tmp821_ = bala_ccode_identifier_new ("old_value"); |
| 10525 | _tmp822_ = _tmp821_; |
| 10526 | _tmp823_ = bala_ccode_identifier_new ("value"); |
| 10527 | _tmp824_ = _tmp823_; |
| 10528 | _tmp825_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_INEQUALITY, (BalaCCodeExpression*) _tmp822_, (BalaCCodeExpression*) _tmp824_); |
| 10529 | _tmp826_ = _tmp825_; |
| 10530 | bala_ccode_function_open_if (_tmp820_, (BalaCCodeExpression*) _tmp826_); |
| 10531 | _bala_ccode_node_unref0 (_tmp826_)((_tmp826_ == ((void*)0)) ? ((void*)0) : (_tmp826_ = (bala_ccode_node_unref (_tmp826_), ((void*)0)))); |
| 10532 | _bala_ccode_node_unref0 (_tmp824_)((_tmp824_ == ((void*)0)) ? ((void*)0) : (_tmp824_ = (bala_ccode_node_unref (_tmp824_), ((void*)0)))); |
| 10533 | _bala_ccode_node_unref0 (_tmp822_)((_tmp822_ == ((void*)0)) ? ((void*)0) : (_tmp822_ = (bala_ccode_node_unref (_tmp822_), ((void*)0)))); |
| 10534 | } |
| 10535 | } |
| 10536 | } |
| 10537 | _tmp827_ = bala_subroutine_get_body ((BalaSubroutine*) acc); |
| 10538 | _tmp828_ = _tmp827_; |
| 10539 | bala_code_node_emit ((BalaCodeNode*) _tmp828_, (BalaCodeGenerator*) self); |
| 10540 | _tmp829_ = bala_ccode_base_module_get_ccode (self); |
| 10541 | _tmp830_ = _tmp829_; |
| 10542 | _tmp831_ = notify_call; |
| 10543 | bala_ccode_function_add_expression (_tmp830_, (BalaCCodeExpression*) _tmp831_); |
| 10544 | _tmp832_ = bala_ccode_base_module_get_ccode (self); |
| 10545 | _tmp833_ = _tmp832_; |
| 10546 | bala_ccode_function_close (_tmp833_); |
| 10547 | _tmp834_ = prop; |
| 10548 | _tmp835_ = bala_property_get_get_accessor (_tmp834_); |
| 10549 | _tmp836_ = _tmp835_; |
| 10550 | _tmp837_ = bala_property_accessor_get_value_type (_tmp836_); |
| 10551 | _tmp838_ = _tmp837_; |
| 10552 | if (bala_data_type_is_disposable (_tmp838_)) { |
| 10553 | BalaGLibValue* old_value = NULL((void*)0); |
| 10554 | BalaProperty* _tmp839_; |
| 10555 | BalaPropertyAccessor* _tmp840_; |
| 10556 | BalaPropertyAccessor* _tmp841_; |
| 10557 | BalaDataType* _tmp842_; |
| 10558 | BalaDataType* _tmp843_; |
| 10559 | BalaCCodeIdentifier* _tmp844_; |
| 10560 | BalaCCodeIdentifier* _tmp845_; |
| 10561 | BalaGLibValue* _tmp846_; |
| 10562 | BalaGLibValue* _tmp847_; |
| 10563 | gboolean _tmp848_ = FALSE(0); |
| 10564 | BalaDataType* _tmp849_; |
| 10565 | BalaCCodeFunction* _tmp854_; |
| 10566 | BalaCCodeFunction* _tmp855_; |
| 10567 | BalaGLibValue* _tmp856_; |
| 10568 | BalaCCodeExpression* _tmp857_; |
| 10569 | BalaCCodeExpression* _tmp858_; |
| 10570 | _tmp839_ = prop; |
| 10571 | _tmp840_ = bala_property_get_get_accessor (_tmp839_); |
| 10572 | _tmp841_ = _tmp840_; |
| 10573 | _tmp842_ = bala_property_accessor_get_value_type (_tmp841_); |
| 10574 | _tmp843_ = _tmp842_; |
| 10575 | _tmp844_ = bala_ccode_identifier_new ("old_value"); |
| 10576 | _tmp845_ = _tmp844_; |
| 10577 | _tmp846_ = bala_glib_value_new (_tmp843_, (BalaCCodeExpression*) _tmp845_, TRUE(!(0))); |
| 10578 | _tmp847_ = _tmp846_; |
| 10579 | _bala_ccode_node_unref0 (_tmp845_)((_tmp845_ == ((void*)0)) ? ((void*)0) : (_tmp845_ = (bala_ccode_node_unref (_tmp845_), ((void*)0)))); |
| 10580 | old_value = _tmp847_; |
| 10581 | _tmp849_ = property_type; |
| 10582 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp849_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp849_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 10583 | BalaProperty* _tmp850_; |
| 10584 | _tmp850_ = prop; |
| 10585 | _tmp848_ = bala_get_ccode_array_length ((BalaCodeNode*) _tmp850_); |
| 10586 | } else { |
| 10587 | _tmp848_ = FALSE(0); |
| 10588 | } |
| 10589 | if (_tmp848_) { |
| 10590 | BalaGLibValue* _tmp851_; |
| 10591 | BalaCCodeIdentifier* _tmp852_; |
| 10592 | BalaCCodeIdentifier* _tmp853_; |
| 10593 | _tmp851_ = old_value; |
| 10594 | _tmp852_ = bala_ccode_identifier_new ("old_value_length"); |
| 10595 | _tmp853_ = _tmp852_; |
| 10596 | bala_glib_value_append_array_length_cvalue (_tmp851_, (BalaCCodeExpression*) _tmp853_); |
| 10597 | _bala_ccode_node_unref0 (_tmp853_)((_tmp853_ == ((void*)0)) ? ((void*)0) : (_tmp853_ = (bala_ccode_node_unref (_tmp853_), ((void*)0)))); |
| 10598 | } |
| 10599 | _tmp854_ = bala_ccode_base_module_get_ccode (self); |
| 10600 | _tmp855_ = _tmp854_; |
| 10601 | _tmp856_ = old_value; |
| 10602 | _tmp857_ = bala_ccode_base_module_destroy_value (self, (BalaTargetValue*) _tmp856_, FALSE(0)); |
| 10603 | _tmp858_ = _tmp857_; |
| 10604 | bala_ccode_function_add_expression (_tmp855_, _tmp858_); |
| 10605 | _bala_ccode_node_unref0 (_tmp858_)((_tmp858_ == ((void*)0)) ? ((void*)0) : (_tmp858_ = (bala_ccode_node_unref (_tmp858_), ((void*)0)))); |
| 10606 | _bala_target_value_unref0 (old_value)((old_value == ((void*)0)) ? ((void*)0) : (old_value = (bala_target_value_unref (old_value), ((void*)0)))); |
| 10607 | } |
| 10608 | _bala_ccode_node_unref0 (get_call)((get_call == ((void*)0)) ? ((void*)0) : (get_call = (bala_ccode_node_unref (get_call), ((void*)0)))); |
| 10609 | _bala_code_node_unref0 (property_type)((property_type == ((void*)0)) ? ((void*)0) : (property_type = (bala_code_node_unref (property_type), ((void*)0)))); |
| 10610 | } else { |
| 10611 | BalaBlock* _tmp859_; |
| 10612 | BalaBlock* _tmp860_; |
| 10613 | BalaCCodeFunction* _tmp861_; |
| 10614 | BalaCCodeFunction* _tmp862_; |
| 10615 | BalaCCodeFunctionCall* _tmp863_; |
| 10616 | _tmp859_ = bala_subroutine_get_body ((BalaSubroutine*) acc); |
| 10617 | _tmp860_ = _tmp859_; |
| 10618 | bala_code_node_emit ((BalaCodeNode*) _tmp860_, (BalaCodeGenerator*) self); |
| 10619 | _tmp861_ = bala_ccode_base_module_get_ccode (self); |
| 10620 | _tmp862_ = _tmp861_; |
| 10621 | _tmp863_ = notify_call; |
| 10622 | bala_ccode_function_add_expression (_tmp862_, (BalaCCodeExpression*) _tmp863_); |
| 10623 | } |
| 10624 | _bala_code_node_unref0 (get_accessor)((get_accessor == ((void*)0)) ? ((void*)0) : (get_accessor = ( bala_code_node_unref (get_accessor), ((void*)0)))); |
| 10625 | _bala_ccode_node_unref0 (notify_call)((notify_call == ((void*)0)) ? ((void*)0) : (notify_call = (bala_ccode_node_unref (notify_call), ((void*)0)))); |
| 10626 | } else { |
| 10627 | BalaBlock* _tmp864_; |
| 10628 | BalaBlock* _tmp865_; |
| 10629 | _tmp864_ = bala_subroutine_get_body ((BalaSubroutine*) acc); |
| 10630 | _tmp865_ = _tmp864_; |
| 10631 | bala_code_node_emit ((BalaCodeNode*) _tmp865_, (BalaCodeGenerator*) self); |
| 10632 | } |
| 10633 | _tmp866_ = bala_ccode_base_module_get_current_method_inner_error (self); |
| 10634 | _tmp867_ = _tmp866_; |
| 10635 | if (_tmp867_) { |
| 10636 | BalaCCodeFunction* _tmp868_; |
| 10637 | BalaCCodeFunction* _tmp869_; |
| 10638 | gint _tmp870_; |
| 10639 | gint _tmp871_; |
| 10640 | gchar* _tmp872_; |
| 10641 | gchar* _tmp873_; |
| 10642 | BalaCCodeConstant* _tmp874_; |
| 10643 | BalaCCodeConstant* _tmp875_; |
| 10644 | BalaCCodeVariableDeclarator* _tmp876_; |
| 10645 | BalaCCodeVariableDeclarator* _tmp877_; |
| 10646 | _tmp868_ = bala_ccode_base_module_get_ccode (self); |
| 10647 | _tmp869_ = _tmp868_; |
| 10648 | _tmp870_ = bala_ccode_base_module_get_current_inner_error_id (self); |
| 10649 | _tmp871_ = _tmp870_; |
| 10650 | _tmp872_ = g_strdup_printf ("_inner_error%d_", _tmp871_); |
| 10651 | _tmp873_ = _tmp872_; |
| 10652 | _tmp874_ = bala_ccode_constant_new ("NULL"); |
| 10653 | _tmp875_ = _tmp874_; |
| 10654 | _tmp876_ = bala_ccode_variable_declarator_new_zero (_tmp873_, (BalaCCodeExpression*) _tmp875_, NULL((void*)0)); |
| 10655 | _tmp877_ = _tmp876_; |
| 10656 | bala_ccode_function_add_declaration (_tmp869_, "GError*", (BalaCCodeDeclarator*) _tmp877_, 0); |
| 10657 | _bala_ccode_node_unref0 (_tmp877_)((_tmp877_ == ((void*)0)) ? ((void*)0) : (_tmp877_ = (bala_ccode_node_unref (_tmp877_), ((void*)0)))); |
| 10658 | _bala_ccode_node_unref0 (_tmp875_)((_tmp875_ == ((void*)0)) ? ((void*)0) : (_tmp875_ = (bala_ccode_node_unref (_tmp875_), ((void*)0)))); |
| 10659 | _g_free0 (_tmp873_)(_tmp873_ = (g_free (_tmp873_), ((void*)0))); |
| 10660 | } |
| 10661 | bala_ccode_base_module_pop_function (self); |
| 10662 | _tmp878_ = self->cfile; |
| 10663 | _tmp879_ = function; |
| 10664 | bala_ccode_file_add_function (_tmp878_, _tmp879_); |
| 10665 | _bala_code_node_unref0 (base_type)((base_type == ((void*)0)) ? ((void*)0) : (base_type = (bala_code_node_unref (base_type), ((void*)0)))); |
| 10666 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 10667 | _g_free0 (cname)(cname = (g_free (cname), ((void*)0))); |
| 10668 | } |
| 10669 | bala_ccode_base_module_pop_line (self); |
| 10670 | bala_ccode_base_module_pop_context (self); |
| 10671 | _bala_ccode_node_unref0 (cvalueparam)((cvalueparam == ((void*)0)) ? ((void*)0) : (cvalueparam = (bala_ccode_node_unref (cvalueparam), ((void*)0)))); |
| 10672 | _bala_ccode_node_unref0 (cselfparam)((cselfparam == ((void*)0)) ? ((void*)0) : (cselfparam = (bala_ccode_node_unref (cselfparam), ((void*)0)))); |
| 10673 | _bala_code_node_unref0 (this_type)((this_type == ((void*)0)) ? ((void*)0) : (this_type = (bala_code_node_unref (this_type), ((void*)0)))); |
| 10674 | _bala_code_node_unref0 (t)((t == ((void*)0)) ? ((void*)0) : (t = (bala_code_node_unref ( t), ((void*)0)))); |
| 10675 | _bala_code_node_unref0 (prop)((prop == ((void*)0)) ? ((void*)0) : (prop = (bala_code_node_unref (prop), ((void*)0)))); |
| 10676 | } |
| 10677 | |
| 10678 | static void |
| 10679 | bala_ccode_base_module_real_visit_destructor (BalaCodeVisitor* base, |
| 10680 | BalaDestructor* d) |
| 10681 | { |
| 10682 | BalaCCodeBaseModule * self; |
| 10683 | gboolean _tmp0_ = FALSE(0); |
| 10684 | BalaMemberBinding _tmp1_; |
| 10685 | BalaMemberBinding _tmp2_; |
| 10686 | self = (BalaCCodeBaseModule*) base; |
| 10687 | g_return_if_fail (d != NULL)do { if ((d != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "d != NULL"); return ; } } while (0); |
| 10688 | _tmp1_ = bala_destructor_get_binding (d); |
| 10689 | _tmp2_ = _tmp1_; |
| 10690 | if (_tmp2_ == BALA_MEMBER_BINDING_STATIC) { |
| 10691 | _tmp0_ = !self->in_plugin; |
| 10692 | } else { |
| 10693 | _tmp0_ = FALSE(0); |
| 10694 | } |
| 10695 | if (_tmp0_) { |
| 10696 | BalaSourceReference* _tmp3_; |
| 10697 | BalaSourceReference* _tmp4_; |
| 10698 | _tmp3_ = bala_code_node_get_source_reference ((BalaCodeNode*) d); |
| 10699 | _tmp4_ = _tmp3_; |
| 10700 | bala_report_error (_tmp4_, "static destructors are only supported for dynamic types"); |
| 10701 | bala_code_node_set_error ((BalaCodeNode*) d, TRUE(!(0))); |
| 10702 | return; |
| 10703 | } |
| 10704 | } |
| 10705 | |
| 10706 | gint |
| 10707 | bala_ccode_base_module_get_block_id (BalaCCodeBaseModule* self, |
| 10708 | BalaBlock* b) |
| 10709 | { |
| 10710 | gint _result_ = 0; |
| 10711 | BalaMap* _tmp0_; |
| 10712 | gpointer _tmp1_; |
| 10713 | gint result = 0; |
| 10714 | g_return_val_if_fail (self != NULL, 0)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (0); } } while (0); |
| 10715 | g_return_val_if_fail (b != NULL, 0)do { if ((b != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "b != NULL"); return (0); } } while (0); |
| 10716 | _tmp0_ = self->priv->block_map; |
| 10717 | _tmp1_ = bala_map_get (_tmp0_, b); |
| 10718 | _result_ = (gint) ((gintptr) _tmp1_); |
| 10719 | if (_result_ == 0) { |
| 10720 | gint _tmp2_; |
| 10721 | BalaMap* _tmp3_; |
| 10722 | self->priv->next_block_id = self->priv->next_block_id + 1; |
| 10723 | _tmp2_ = self->priv->next_block_id; |
| 10724 | _result_ = _tmp2_; |
| 10725 | _tmp3_ = self->priv->block_map; |
| 10726 | bala_map_set (_tmp3_, b, (gpointer) ((gintptr) _result_)); |
| 10727 | } |
| 10728 | result = _result_; |
| 10729 | return result; |
| 10730 | } |
| 10731 | |
| 10732 | gboolean |
| 10733 | bala_ccode_base_module_no_implicit_copy (BalaCCodeBaseModule* self, |
| 10734 | BalaDataType* type) |
| 10735 | { |
| 10736 | BalaClass* cl = NULL((void*)0); |
| 10737 | BalaTypeSymbol* _tmp0_; |
| 10738 | BalaTypeSymbol* _tmp1_; |
| 10739 | gboolean _tmp2_ = FALSE(0); |
| 10740 | gboolean _tmp3_ = FALSE(0); |
| 10741 | gboolean result = FALSE(0); |
| 10742 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 10743 | g_return_val_if_fail (type != NULL, FALSE)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return ((0)); } } while (0); |
| 10744 | _tmp0_ = bala_data_type_get_type_symbol (type); |
| 10745 | _tmp1_ = _tmp0_; |
| 10746 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp1_) : NULL((void*)0); |
| 10747 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 10748 | _tmp3_ = TRUE(!(0)); |
| 10749 | } else { |
| 10750 | _tmp3_ = G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_array_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 10751 | } |
| 10752 | if (_tmp3_) { |
| 10753 | _tmp2_ = TRUE(!(0)); |
| 10754 | } else { |
| 10755 | gboolean _tmp4_ = FALSE(0); |
| 10756 | gboolean _tmp5_ = FALSE(0); |
| 10757 | gboolean _tmp6_ = FALSE(0); |
| 10758 | BalaClass* _tmp7_; |
| 10759 | _tmp7_ = cl; |
| 10760 | if (_tmp7_ != NULL((void*)0)) { |
| 10761 | BalaClass* _tmp8_; |
| 10762 | gboolean _tmp9_; |
| 10763 | gboolean _tmp10_; |
| 10764 | _tmp8_ = cl; |
| 10765 | _tmp9_ = bala_class_get_is_immutable (_tmp8_); |
| 10766 | _tmp10_ = _tmp9_; |
| 10767 | _tmp6_ = !_tmp10_; |
| 10768 | } else { |
| 10769 | _tmp6_ = FALSE(0); |
| 10770 | } |
| 10771 | if (_tmp6_) { |
| 10772 | BalaClass* _tmp11_; |
| 10773 | _tmp11_ = cl; |
| 10774 | _tmp5_ = !bala_is_reference_counting ((BalaTypeSymbol*) _tmp11_); |
| 10775 | } else { |
| 10776 | _tmp5_ = FALSE(0); |
| 10777 | } |
| 10778 | if (_tmp5_) { |
| 10779 | BalaClass* _tmp12_; |
| 10780 | _tmp12_ = cl; |
| 10781 | _tmp4_ = !bala_get_ccode_is_gboxed ((BalaTypeSymbol*) _tmp12_); |
| 10782 | } else { |
| 10783 | _tmp4_ = FALSE(0); |
| 10784 | } |
| 10785 | _tmp2_ = _tmp4_; |
| 10786 | } |
| 10787 | result = _tmp2_; |
| 10788 | return result; |
| 10789 | } |
| 10790 | |
| 10791 | static void |
| 10792 | bala_ccode_base_module_capture_parameter (BalaCCodeBaseModule* self, |
| 10793 | BalaParameter* param, |
| 10794 | BalaCCodeStruct* data, |
| 10795 | gint block_id) |
| 10796 | { |
| 10797 | BalaDataType* _tmp0_; |
| 10798 | BalaDataType* _tmp1_; |
| 10799 | BalaCCodeFile* _tmp2_; |
| 10800 | BalaDataType* param_type = NULL((void*)0); |
| 10801 | BalaDataType* _tmp3_; |
| 10802 | BalaDataType* _tmp4_; |
| 10803 | BalaDataType* _tmp5_; |
| 10804 | BalaDataType* _tmp6_; |
| 10805 | BalaDataType* _tmp7_; |
| 10806 | gboolean _tmp8_; |
| 10807 | gboolean _tmp9_; |
| 10808 | BalaDataType* _tmp13_; |
| 10809 | gchar* _tmp14_; |
| 10810 | gchar* _tmp15_; |
| 10811 | gchar* _tmp16_; |
| 10812 | gchar* _tmp17_; |
| 10813 | BalaDataType* _tmp18_; |
| 10814 | BalaCCodeDeclaratorSuffix* _tmp19_; |
| 10815 | BalaCCodeDeclaratorSuffix* _tmp20_; |
| 10816 | BalaTargetValue* value = NULL((void*)0); |
| 10817 | BalaTargetValue* _tmp21_; |
| 10818 | BalaArrayType* array_type = NULL((void*)0); |
| 10819 | BalaDataType* _tmp22_; |
| 10820 | BalaDataType* _tmp23_; |
| 10821 | BalaArrayType* _tmp24_; |
| 10822 | BalaDelegateType* deleg_type = NULL((void*)0); |
| 10823 | BalaDataType* _tmp25_; |
| 10824 | BalaDataType* _tmp26_; |
| 10825 | BalaDelegateType* _tmp27_; |
| 10826 | gboolean _tmp28_ = FALSE(0); |
| 10827 | gboolean _tmp29_ = FALSE(0); |
| 10828 | BalaArrayType* _tmp30_; |
| 10829 | BalaTargetValue* _tmp66_; |
| 10830 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 10831 | g_return_if_fail (param != NULL)do { if ((param != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "param != NULL" ); return; } } while (0); |
| 10832 | g_return_if_fail (data != NULL)do { if ((data != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "data != NULL" ); return; } } while (0); |
| 10833 | _tmp0_ = bala_variable_get_variable_type ((BalaVariable*) param); |
| 10834 | _tmp1_ = _tmp0_; |
| 10835 | _tmp2_ = self->cfile; |
| 10836 | bala_ccode_base_module_generate_type_declaration (self, _tmp1_, _tmp2_); |
| 10837 | _tmp3_ = bala_variable_get_variable_type ((BalaVariable*) param); |
| 10838 | _tmp4_ = _tmp3_; |
| 10839 | _tmp5_ = bala_data_type_copy (_tmp4_); |
| 10840 | param_type = _tmp5_; |
| 10841 | _tmp6_ = bala_variable_get_variable_type ((BalaVariable*) param); |
| 10842 | _tmp7_ = _tmp6_; |
| 10843 | _tmp8_ = bala_data_type_get_value_owned (_tmp7_); |
| 10844 | _tmp9_ = _tmp8_; |
| 10845 | if (!_tmp9_) { |
| 10846 | BalaDataType* _tmp10_; |
| 10847 | BalaDataType* _tmp11_; |
| 10848 | BalaDataType* _tmp12_; |
| 10849 | _tmp10_ = param_type; |
| 10850 | _tmp11_ = bala_variable_get_variable_type ((BalaVariable*) param); |
| 10851 | _tmp12_ = _tmp11_; |
| 10852 | bala_data_type_set_value_owned (_tmp10_, !bala_ccode_base_module_no_implicit_copy (self, _tmp12_)); |
| 10853 | } |
| 10854 | _tmp13_ = param_type; |
| 10855 | _tmp14_ = bala_get_ccode_name ((BalaCodeNode*) _tmp13_); |
| 10856 | _tmp15_ = _tmp14_; |
| 10857 | _tmp16_ = bala_get_ccode_name ((BalaCodeNode*) param); |
| 10858 | _tmp17_ = _tmp16_; |
| 10859 | _tmp18_ = param_type; |
| 10860 | _tmp19_ = bala_ccode_base_module_get_ccode_declarator_suffix (self, _tmp18_); |
| 10861 | _tmp20_ = _tmp19_; |
| 10862 | bala_ccode_struct_add_field (data, _tmp15_, _tmp17_, 0, _tmp20_); |
| 10863 | _bala_ccode_declarator_suffix_unref0 (_tmp20_)((_tmp20_ == ((void*)0)) ? ((void*)0) : (_tmp20_ = (bala_ccode_declarator_suffix_unref (_tmp20_), ((void*)0)))); |
| 10864 | _g_free0 (_tmp17_)(_tmp17_ = (g_free (_tmp17_), ((void*)0))); |
| 10865 | _g_free0 (_tmp15_)(_tmp15_ = (g_free (_tmp15_), ((void*)0))); |
| 10866 | bala_parameter_set_captured (param, FALSE(0)); |
| 10867 | _tmp21_ = bala_code_generator_load_parameter ((BalaCodeGenerator*) self, param, NULL((void*)0)); |
| 10868 | value = _tmp21_; |
| 10869 | _tmp22_ = bala_variable_get_variable_type ((BalaVariable*) param); |
| 10870 | _tmp23_ = _tmp22_; |
| 10871 | _tmp24_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp23_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp23_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) _tmp23_) : NULL((void*)0)); |
| 10872 | array_type = _tmp24_; |
| 10873 | _tmp25_ = bala_variable_get_variable_type ((BalaVariable*) param); |
| 10874 | _tmp26_ = _tmp25_; |
| 10875 | _tmp27_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp26_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp26_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaDelegateType*) _tmp26_) : NULL((void*)0)); |
| 10876 | deleg_type = _tmp27_; |
| 10877 | _tmp30_ = array_type; |
| 10878 | if (_tmp30_ != NULL((void*)0)) { |
| 10879 | _tmp29_ = bala_get_ccode_array_length ((BalaCodeNode*) param); |
| 10880 | } else { |
| 10881 | _tmp29_ = FALSE(0); |
| 10882 | } |
| 10883 | if (_tmp29_) { |
| 10884 | BalaArrayType* _tmp31_; |
| 10885 | gboolean _tmp32_; |
| 10886 | gboolean _tmp33_; |
| 10887 | _tmp31_ = array_type; |
| 10888 | _tmp32_ = bala_array_type_get_fixed_length (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp31_), ((bala_array_type_get_type ())))))); |
| 10889 | _tmp33_ = _tmp32_; |
| 10890 | _tmp28_ = !_tmp33_; |
| 10891 | } else { |
| 10892 | _tmp28_ = FALSE(0); |
| 10893 | } |
| 10894 | if (_tmp28_) { |
| 10895 | gchar* length_ctype = NULL((void*)0); |
| 10896 | gchar* _tmp34_; |
| 10897 | _tmp34_ = bala_get_ccode_array_length_type ((BalaCodeNode*) param); |
| 10898 | length_ctype = _tmp34_; |
| 10899 | { |
| 10900 | gint dim = 0; |
| 10901 | dim = 1; |
| 10902 | { |
| 10903 | gboolean _tmp35_ = FALSE(0); |
| 10904 | _tmp35_ = TRUE(!(0)); |
| 10905 | while (TRUE(!(0))) { |
| 10906 | BalaArrayType* _tmp37_; |
| 10907 | gint _tmp38_; |
| 10908 | gint _tmp39_; |
| 10909 | const gchar* _tmp40_; |
| 10910 | gchar* _tmp41_; |
| 10911 | gchar* _tmp42_; |
| 10912 | if (!_tmp35_) { |
| 10913 | gint _tmp36_; |
| 10914 | _tmp36_ = dim; |
| 10915 | dim = _tmp36_ + 1; |
| 10916 | } |
| 10917 | _tmp35_ = FALSE(0); |
| 10918 | _tmp37_ = array_type; |
| 10919 | _tmp38_ = bala_array_type_get_rank (_tmp37_); |
| 10920 | _tmp39_ = _tmp38_; |
| 10921 | if (!(dim <= _tmp39_)) { |
| 10922 | break; |
| 10923 | } |
| 10924 | _tmp40_ = length_ctype; |
| 10925 | _tmp41_ = bala_ccode_base_module_get_variable_array_length_cname (self, (BalaVariable*) param, dim); |
| 10926 | _tmp42_ = _tmp41_; |
| 10927 | bala_ccode_struct_add_field (data, _tmp40_, _tmp42_, 0, NULL((void*)0)); |
| 10928 | _g_free0 (_tmp42_)(_tmp42_ = (g_free (_tmp42_), ((void*)0))); |
| 10929 | } |
| 10930 | } |
| 10931 | } |
| 10932 | _g_free0 (length_ctype)(length_ctype = (g_free (length_ctype), ((void*)0))); |
| 10933 | } else { |
| 10934 | gboolean _tmp43_ = FALSE(0); |
| 10935 | BalaDelegateType* _tmp44_; |
| 10936 | _tmp44_ = deleg_type; |
| 10937 | if (_tmp44_ != NULL((void*)0)) { |
| 10938 | BalaDelegateType* _tmp45_; |
| 10939 | BalaDelegate* _tmp46_; |
| 10940 | BalaDelegate* _tmp47_; |
| 10941 | gboolean _tmp48_; |
| 10942 | gboolean _tmp49_; |
| 10943 | _tmp45_ = deleg_type; |
| 10944 | _tmp46_ = bala_delegate_type_get_delegate_symbol (_tmp45_); |
| 10945 | _tmp47_ = _tmp46_; |
| 10946 | _tmp48_ = bala_delegate_get_has_target (_tmp47_); |
| 10947 | _tmp49_ = _tmp48_; |
| 10948 | _tmp43_ = _tmp49_; |
| 10949 | } else { |
| 10950 | _tmp43_ = FALSE(0); |
| 10951 | } |
| 10952 | if (_tmp43_) { |
| 10953 | BalaDataType* _tmp50_; |
| 10954 | gchar* _tmp51_; |
| 10955 | gchar* _tmp52_; |
| 10956 | gchar* _tmp53_; |
| 10957 | gchar* _tmp54_; |
| 10958 | BalaDataType* _tmp55_; |
| 10959 | BalaDataType* _tmp56_; |
| 10960 | _tmp50_ = self->delegate_target_type; |
| 10961 | _tmp51_ = bala_get_ccode_name ((BalaCodeNode*) _tmp50_); |
| 10962 | _tmp52_ = _tmp51_; |
| 10963 | _tmp53_ = bala_get_ccode_delegate_target_name ((BalaVariable*) param); |
| 10964 | _tmp54_ = _tmp53_; |
| 10965 | bala_ccode_struct_add_field (data, _tmp52_, _tmp54_, 0, NULL((void*)0)); |
| 10966 | _g_free0 (_tmp54_)(_tmp54_ = (g_free (_tmp54_), ((void*)0))); |
| 10967 | _g_free0 (_tmp52_)(_tmp52_ = (g_free (_tmp52_), ((void*)0))); |
| 10968 | _tmp55_ = bala_variable_get_variable_type ((BalaVariable*) param); |
| 10969 | _tmp56_ = _tmp55_; |
| 10970 | if (bala_data_type_is_disposable (_tmp56_)) { |
| 10971 | BalaDelegateType* _tmp57_; |
| 10972 | gchar* _tmp58_; |
| 10973 | gchar* _tmp59_; |
| 10974 | gchar* _tmp60_; |
| 10975 | gchar* _tmp61_; |
| 10976 | BalaTargetValue* lvalue = NULL((void*)0); |
| 10977 | BalaTargetValue* _tmp62_; |
| 10978 | BalaTargetValue* _tmp63_; |
| 10979 | BalaTargetValue* _tmp64_; |
| 10980 | BalaCCodeExpression* _tmp65_; |
| 10981 | _tmp57_ = self->delegate_target_destroy_type; |
| 10982 | _tmp58_ = bala_get_ccode_name ((BalaCodeNode*) _tmp57_); |
| 10983 | _tmp59_ = _tmp58_; |
| 10984 | _tmp60_ = bala_get_ccode_delegate_target_destroy_notify_name ((BalaVariable*) param); |
| 10985 | _tmp61_ = _tmp60_; |
| 10986 | bala_ccode_struct_add_field (data, _tmp59_, _tmp61_, 0, NULL((void*)0)); |
| 10987 | _g_free0 (_tmp61_)(_tmp61_ = (g_free (_tmp61_), ((void*)0))); |
| 10988 | _g_free0 (_tmp59_)(_tmp59_ = (g_free (_tmp59_), ((void*)0))); |
| 10989 | _tmp62_ = bala_ccode_base_module_get_parameter_cvalue (self, param); |
| 10990 | lvalue = _tmp62_; |
| 10991 | _tmp63_ = value; |
| 10992 | _tmp64_ = lvalue; |
| 10993 | _tmp65_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cvalue (self, _tmp64_); |
| 10994 | _bala_ccode_node_unref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)->delegate_target_destroy_notify_cvalue)(((((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp63_), ((bala_glib_value_get_type ())))))->delegate_target_destroy_notify_cvalue == ((void*)0)) ? ((void*)0) : ((((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance*) (_tmp63_), ((bala_glib_value_get_type ())) )))->delegate_target_destroy_notify_cvalue = (bala_ccode_node_unref ((((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp63_), ((bala_glib_value_get_type ())))))->delegate_target_destroy_notify_cvalue ), ((void*)0)))); |
| 10995 | G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp63_), ((bala_glib_value_get_type ())))))->delegate_target_destroy_notify_cvalue = _tmp65_; |
| 10996 | _bala_target_value_unref0 (lvalue)((lvalue == ((void*)0)) ? ((void*)0) : (lvalue = (bala_target_value_unref (lvalue), ((void*)0)))); |
| 10997 | } |
| 10998 | } |
| 10999 | } |
| 11000 | bala_parameter_set_captured (param, TRUE(!(0))); |
| 11001 | _tmp66_ = value; |
| 11002 | bala_code_generator_store_parameter ((BalaCodeGenerator*) self, param, _tmp66_, TRUE(!(0)), NULL((void*)0)); |
| 11003 | _bala_code_node_unref0 (deleg_type)((deleg_type == ((void*)0)) ? ((void*)0) : (deleg_type = (bala_code_node_unref (deleg_type), ((void*)0)))); |
| 11004 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 11005 | _bala_target_value_unref0 (value)((value == ((void*)0)) ? ((void*)0) : (value = (bala_target_value_unref (value), ((void*)0)))); |
| 11006 | _bala_code_node_unref0 (param_type)((param_type == ((void*)0)) ? ((void*)0) : (param_type = (bala_code_node_unref (param_type), ((void*)0)))); |
| 11007 | } |
| 11008 | |
| 11009 | static void |
| 11010 | bala_ccode_base_module_real_visit_block (BalaCodeVisitor* base, |
| 11011 | BalaBlock* b) |
| 11012 | { |
| 11013 | BalaCCodeBaseModule * self; |
| 11014 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 11015 | BalaList* local_vars = NULL((void*)0); |
| 11016 | BalaList* _tmp1_; |
| 11017 | BalaList* _tmp2_; |
| 11018 | gboolean _tmp3_ = FALSE(0); |
| 11019 | gboolean _tmp4_ = FALSE(0); |
| 11020 | BalaCodeNode* _tmp5_; |
| 11021 | BalaCodeNode* _tmp6_; |
| 11022 | gboolean _tmp13_ = FALSE(0); |
| 11023 | BalaCodeNode* _tmp14_; |
| 11024 | BalaCodeNode* _tmp15_; |
| 11025 | gboolean _tmp59_; |
| 11026 | gboolean _tmp60_; |
| 11027 | gboolean reachable_exit_block = FALSE(0); |
| 11028 | gboolean _tmp1011_ = FALSE(0); |
| 11029 | gboolean _tmp1012_ = FALSE(0); |
| 11030 | BalaCodeNode* _tmp1013_; |
| 11031 | BalaCodeNode* _tmp1014_; |
| 11032 | BalaCCodeBaseModuleEmitContext* _tmp1021_; |
| 11033 | self = (BalaCCodeBaseModule*) base; |
| 11034 | g_return_if_fail (b != NULL)do { if ((b != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "b != NULL"); return ; } } while (0); |
| 11035 | _tmp0_ = self->emit_context; |
| 11036 | bala_ccode_base_module_emit_context_push_symbol (_tmp0_, (BalaSymbol*) b); |
| 11037 | _tmp1_ = bala_block_get_local_variables (b); |
| 11038 | _tmp2_ = _bala_iterable_ref0 (_tmp1_); |
| 11039 | local_vars = _tmp2_; |
| 11040 | _tmp5_ = bala_code_node_get_parent_node ((BalaCodeNode*) b); |
| 11041 | _tmp6_ = _tmp5_; |
| 11042 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, BALA_TYPE_BLOCK)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp6_); GType __t = ((bala_block_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 11043 | _tmp4_ = TRUE(!(0)); |
| 11044 | } else { |
| 11045 | BalaCodeNode* _tmp7_; |
| 11046 | BalaCodeNode* _tmp8_; |
| 11047 | _tmp7_ = bala_code_node_get_parent_node ((BalaCodeNode*) b); |
| 11048 | _tmp8_ = _tmp7_; |
| 11049 | _tmp4_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, BALA_TYPE_SWITCH_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp8_); GType __t = ((bala_switch_statement_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 11050 | } |
| 11051 | if (_tmp4_) { |
| 11052 | _tmp3_ = TRUE(!(0)); |
| 11053 | } else { |
| 11054 | BalaCodeNode* _tmp9_; |
| 11055 | BalaCodeNode* _tmp10_; |
| 11056 | _tmp9_ = bala_code_node_get_parent_node ((BalaCodeNode*) b); |
| 11057 | _tmp10_ = _tmp9_; |
| 11058 | _tmp3_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, BALA_TYPE_TRY_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp10_); GType __t = ((bala_try_statement_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 11059 | } |
| 11060 | if (_tmp3_) { |
| 11061 | BalaCCodeFunction* _tmp11_; |
| 11062 | BalaCCodeFunction* _tmp12_; |
| 11063 | _tmp11_ = bala_ccode_base_module_get_ccode (self); |
| 11064 | _tmp12_ = _tmp11_; |
| 11065 | bala_ccode_function_open_block (_tmp12_); |
| 11066 | } |
| 11067 | _tmp14_ = bala_code_node_get_parent_node ((BalaCodeNode*) b); |
| 11068 | _tmp15_ = _tmp14_; |
| 11069 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, BALA_TYPE_TRY_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp15_); GType __t = ((bala_try_statement_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 11070 | BalaCodeNode* _tmp16_; |
| 11071 | BalaCodeNode* _tmp17_; |
| 11072 | BalaBlock* _tmp18_; |
| 11073 | BalaBlock* _tmp19_; |
| 11074 | _tmp16_ = bala_code_node_get_parent_node ((BalaCodeNode*) b); |
| 11075 | _tmp17_ = _tmp16_; |
| 11076 | _tmp18_ = bala_try_statement_get_finally_body (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, BALA_TYPE_TRY_STATEMENT, BalaTryStatement)(((BalaTryStatement*) g_type_check_instance_cast ((GTypeInstance *) (_tmp17_), ((bala_try_statement_get_type ())))))); |
| 11077 | _tmp19_ = _tmp18_; |
| 11078 | _tmp13_ = b == _tmp19_; |
| 11079 | } else { |
| 11080 | _tmp13_ = FALSE(0); |
| 11081 | } |
| 11082 | if (_tmp13_) { |
| 11083 | BalaCodeNode* _tmp20_; |
| 11084 | BalaCodeNode* _tmp21_; |
| 11085 | BalaBlock* _tmp22_; |
| 11086 | BalaBlock* _tmp23_; |
| 11087 | gboolean _tmp24_; |
| 11088 | gboolean _tmp25_; |
| 11089 | _tmp20_ = bala_code_node_get_parent_node ((BalaCodeNode*) b); |
| 11090 | _tmp21_ = _tmp20_; |
| 11091 | _tmp22_ = bala_try_statement_get_body (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, BALA_TYPE_TRY_STATEMENT, BalaTryStatement)(((BalaTryStatement*) g_type_check_instance_cast ((GTypeInstance *) (_tmp21_), ((bala_try_statement_get_type ())))))); |
| 11092 | _tmp23_ = _tmp22_; |
| 11093 | _tmp24_ = bala_code_node_get_tree_can_fail ((BalaCodeNode*) _tmp23_); |
| 11094 | _tmp25_ = _tmp24_; |
| 11095 | if (_tmp25_) { |
| 11096 | if (bala_ccode_base_module_is_in_coroutine (self)) { |
| 11097 | gboolean _tmp26_ = FALSE(0); |
| 11098 | gint _tmp27_; |
| 11099 | gint _tmp28_; |
| 11100 | _tmp27_ = bala_ccode_base_module_get_current_inner_error_id (self); |
| 11101 | _tmp28_ = _tmp27_; |
| 11102 | if (_tmp28_ > 0) { |
| 11103 | gboolean _tmp29_ = FALSE(0); |
| 11104 | BalaMap* _tmp30_; |
| 11105 | BalaMethod* _tmp31_; |
| 11106 | BalaMethod* _tmp32_; |
| 11107 | _tmp30_ = self->priv->method_inner_error_var_count; |
| 11108 | _tmp31_ = bala_ccode_base_module_get_current_method (self); |
| 11109 | _tmp32_ = _tmp31_; |
| 11110 | if (!bala_map_contains (_tmp30_, _tmp32_)) { |
| 11111 | _tmp29_ = TRUE(!(0)); |
| 11112 | } else { |
| 11113 | BalaMap* _tmp33_; |
| 11114 | BalaMethod* _tmp34_; |
| 11115 | BalaMethod* _tmp35_; |
| 11116 | gpointer _tmp36_; |
| 11117 | gint _tmp37_; |
| 11118 | gint _tmp38_; |
| 11119 | _tmp33_ = self->priv->method_inner_error_var_count; |
| 11120 | _tmp34_ = bala_ccode_base_module_get_current_method (self); |
| 11121 | _tmp35_ = _tmp34_; |
| 11122 | _tmp36_ = bala_map_get (_tmp33_, _tmp35_); |
| 11123 | _tmp37_ = bala_ccode_base_module_get_current_inner_error_id (self); |
| 11124 | _tmp38_ = _tmp37_; |
| 11125 | _tmp29_ = ((gint) ((gintptr) _tmp36_)) < _tmp38_; |
| 11126 | } |
| 11127 | _tmp26_ = _tmp29_; |
| 11128 | } else { |
| 11129 | _tmp26_ = FALSE(0); |
| 11130 | } |
| 11131 | if (_tmp26_) { |
| 11132 | BalaCCodeStruct* _tmp39_; |
| 11133 | gint _tmp40_; |
| 11134 | gint _tmp41_; |
| 11135 | gchar* _tmp42_; |
| 11136 | gchar* _tmp43_; |
| 11137 | BalaMap* _tmp44_; |
| 11138 | BalaMethod* _tmp45_; |
| 11139 | BalaMethod* _tmp46_; |
| 11140 | gint _tmp47_; |
| 11141 | gint _tmp48_; |
| 11142 | _tmp39_ = self->closure_struct; |
| 11143 | _tmp40_ = bala_ccode_base_module_get_current_inner_error_id (self); |
| 11144 | _tmp41_ = _tmp40_; |
| 11145 | _tmp42_ = g_strdup_printf ("_inner_error%d_", _tmp41_); |
| 11146 | _tmp43_ = _tmp42_; |
| 11147 | bala_ccode_struct_add_field (_tmp39_, "GError*", _tmp43_, 0, NULL((void*)0)); |
| 11148 | _g_free0 (_tmp43_)(_tmp43_ = (g_free (_tmp43_), ((void*)0))); |
| 11149 | _tmp44_ = self->priv->method_inner_error_var_count; |
| 11150 | _tmp45_ = bala_ccode_base_module_get_current_method (self); |
| 11151 | _tmp46_ = _tmp45_; |
| 11152 | _tmp47_ = bala_ccode_base_module_get_current_inner_error_id (self); |
| 11153 | _tmp48_ = _tmp47_; |
| 11154 | bala_map_set (_tmp44_, _tmp46_, (gpointer) ((gintptr) _tmp48_)); |
| 11155 | } |
| 11156 | } else { |
| 11157 | BalaCCodeFunction* _tmp49_; |
| 11158 | BalaCCodeFunction* _tmp50_; |
| 11159 | gint _tmp51_; |
| 11160 | gint _tmp52_; |
| 11161 | gchar* _tmp53_; |
| 11162 | gchar* _tmp54_; |
| 11163 | BalaCCodeConstant* _tmp55_; |
| 11164 | BalaCCodeConstant* _tmp56_; |
| 11165 | BalaCCodeVariableDeclarator* _tmp57_; |
| 11166 | BalaCCodeVariableDeclarator* _tmp58_; |
| 11167 | _tmp49_ = bala_ccode_base_module_get_ccode (self); |
| 11168 | _tmp50_ = _tmp49_; |
| 11169 | _tmp51_ = bala_ccode_base_module_get_current_inner_error_id (self); |
| 11170 | _tmp52_ = _tmp51_; |
| 11171 | _tmp53_ = g_strdup_printf ("_inner_error%d_", _tmp52_); |
| 11172 | _tmp54_ = _tmp53_; |
| 11173 | _tmp55_ = bala_ccode_constant_new ("NULL"); |
| 11174 | _tmp56_ = _tmp55_; |
| 11175 | _tmp57_ = bala_ccode_variable_declarator_new_zero (_tmp54_, (BalaCCodeExpression*) _tmp56_, NULL((void*)0)); |
| 11176 | _tmp58_ = _tmp57_; |
| 11177 | bala_ccode_function_add_declaration (_tmp50_, "GError*", (BalaCCodeDeclarator*) _tmp58_, 0); |
| 11178 | _bala_ccode_node_unref0 (_tmp58_)((_tmp58_ == ((void*)0)) ? ((void*)0) : (_tmp58_ = (bala_ccode_node_unref (_tmp58_), ((void*)0)))); |
| 11179 | _bala_ccode_node_unref0 (_tmp56_)((_tmp56_ == ((void*)0)) ? ((void*)0) : (_tmp56_ = (bala_ccode_node_unref (_tmp56_), ((void*)0)))); |
| 11180 | _g_free0 (_tmp54_)(_tmp54_ = (g_free (_tmp54_), ((void*)0))); |
| 11181 | } |
| 11182 | } |
| 11183 | } |
| 11184 | _tmp59_ = bala_block_get_captured (b); |
| 11185 | _tmp60_ = _tmp59_; |
| 11186 | if (_tmp60_) { |
| 11187 | BalaBlock* parent_block = NULL((void*)0); |
| 11188 | BalaSymbol* _tmp61_; |
| 11189 | BalaSymbol* _tmp62_; |
| 11190 | BalaBlock* _tmp63_; |
| 11191 | BalaBlock* _tmp64_; |
| 11192 | gint block_id = 0; |
| 11193 | gchar* struct_name = NULL((void*)0); |
| 11194 | gchar* _tmp65_; |
| 11195 | BalaCCodeStruct* data = NULL((void*)0); |
| 11196 | const gchar* _tmp66_; |
| 11197 | gchar* _tmp67_; |
| 11198 | gchar* _tmp68_; |
| 11199 | BalaCCodeStruct* _tmp69_; |
| 11200 | BalaCCodeStruct* _tmp70_; |
| 11201 | BalaCCodeStruct* _tmp71_; |
| 11202 | BalaBlock* _tmp72_; |
| 11203 | BalaCCodeFunctionCall* data_alloc = NULL((void*)0); |
| 11204 | BalaCCodeIdentifier* _tmp237_; |
| 11205 | BalaCCodeIdentifier* _tmp238_; |
| 11206 | BalaCCodeFunctionCall* _tmp239_; |
| 11207 | BalaCCodeFunctionCall* _tmp240_; |
| 11208 | BalaCCodeFunctionCall* _tmp241_; |
| 11209 | const gchar* _tmp242_; |
| 11210 | BalaCCodeIdentifier* _tmp243_; |
| 11211 | BalaCCodeIdentifier* _tmp244_; |
| 11212 | BalaCCodeFunction* _tmp260_; |
| 11213 | BalaCCodeFunction* _tmp261_; |
| 11214 | gchar* _tmp262_; |
| 11215 | gchar* _tmp263_; |
| 11216 | BalaCCodeExpression* _tmp264_; |
| 11217 | BalaCCodeExpression* _tmp265_; |
| 11218 | BalaCCodeFunctionCall* _tmp266_; |
| 11219 | BalaCCodeFunction* _tmp267_; |
| 11220 | BalaCCodeFunction* _tmp268_; |
| 11221 | gchar* _tmp269_; |
| 11222 | gchar* _tmp270_; |
| 11223 | BalaCCodeExpression* _tmp271_; |
| 11224 | BalaCCodeExpression* _tmp272_; |
| 11225 | BalaCCodeMemberAccess* _tmp273_; |
| 11226 | BalaCCodeMemberAccess* _tmp274_; |
| 11227 | BalaCCodeIdentifier* _tmp275_; |
| 11228 | BalaCCodeIdentifier* _tmp276_; |
| 11229 | BalaBlock* _tmp277_; |
| 11230 | BalaSymbol* _tmp382_; |
| 11231 | BalaSymbol* _tmp383_; |
| 11232 | BalaCCodeTypeDefinition* _typedef_ = NULL((void*)0); |
| 11233 | const gchar* _tmp490_; |
| 11234 | gchar* _tmp491_; |
| 11235 | gchar* _tmp492_; |
| 11236 | const gchar* _tmp493_; |
| 11237 | BalaCCodeVariableDeclarator* _tmp494_; |
| 11238 | BalaCCodeVariableDeclarator* _tmp495_; |
| 11239 | BalaCCodeTypeDefinition* _tmp496_; |
| 11240 | BalaCCodeTypeDefinition* _tmp497_; |
| 11241 | BalaCCodeFile* _tmp498_; |
| 11242 | BalaCCodeTypeDefinition* _tmp499_; |
| 11243 | BalaCCodeFile* _tmp500_; |
| 11244 | BalaCCodeStruct* _tmp501_; |
| 11245 | BalaCCodeFunction* ref_fun = NULL((void*)0); |
| 11246 | gchar* _tmp502_; |
| 11247 | gchar* _tmp503_; |
| 11248 | const gchar* _tmp504_; |
| 11249 | gchar* _tmp505_; |
| 11250 | gchar* _tmp506_; |
| 11251 | BalaCCodeFunction* _tmp507_; |
| 11252 | BalaCCodeFunction* _tmp508_; |
| 11253 | BalaCCodeFunction* _tmp509_; |
| 11254 | gchar* _tmp510_; |
| 11255 | gchar* _tmp511_; |
| 11256 | const gchar* _tmp512_; |
| 11257 | gchar* _tmp513_; |
| 11258 | gchar* _tmp514_; |
| 11259 | BalaCCodeParameter* _tmp515_; |
| 11260 | BalaCCodeParameter* _tmp516_; |
| 11261 | BalaCCodeFunction* _tmp517_; |
| 11262 | BalaCCodeFunction* _tmp518_; |
| 11263 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 11264 | BalaCCodeIdentifier* _tmp519_; |
| 11265 | BalaCCodeIdentifier* _tmp520_; |
| 11266 | BalaCCodeFunctionCall* _tmp521_; |
| 11267 | BalaCCodeFunctionCall* _tmp522_; |
| 11268 | BalaCCodeFunctionCall* _tmp523_; |
| 11269 | gchar* _tmp524_; |
| 11270 | gchar* _tmp525_; |
| 11271 | BalaCCodeIdentifier* _tmp526_; |
| 11272 | BalaCCodeIdentifier* _tmp527_; |
| 11273 | BalaCCodeMemberAccess* _tmp528_; |
| 11274 | BalaCCodeMemberAccess* _tmp529_; |
| 11275 | BalaCCodeUnaryExpression* _tmp530_; |
| 11276 | BalaCCodeUnaryExpression* _tmp531_; |
| 11277 | BalaCCodeFunction* _tmp532_; |
| 11278 | BalaCCodeFunction* _tmp533_; |
| 11279 | BalaCCodeFunctionCall* _tmp534_; |
| 11280 | BalaCCodeFunction* _tmp535_; |
| 11281 | BalaCCodeFunction* _tmp536_; |
| 11282 | gchar* _tmp537_; |
| 11283 | gchar* _tmp538_; |
| 11284 | BalaCCodeIdentifier* _tmp539_; |
| 11285 | BalaCCodeIdentifier* _tmp540_; |
| 11286 | BalaCCodeFile* _tmp541_; |
| 11287 | BalaCCodeFunction* _tmp542_; |
| 11288 | BalaCCodeFile* _tmp543_; |
| 11289 | BalaCCodeFunction* _tmp544_; |
| 11290 | BalaCCodeFunction* unref_fun = NULL((void*)0); |
| 11291 | gchar* _tmp545_; |
| 11292 | gchar* _tmp546_; |
| 11293 | BalaCCodeFunction* _tmp547_; |
| 11294 | BalaCCodeFunction* _tmp548_; |
| 11295 | BalaCCodeFunction* _tmp549_; |
| 11296 | BalaCCodeParameter* _tmp550_; |
| 11297 | BalaCCodeParameter* _tmp551_; |
| 11298 | BalaCCodeFunction* _tmp552_; |
| 11299 | BalaCCodeFunction* _tmp553_; |
| 11300 | BalaCCodeFunction* _tmp554_; |
| 11301 | BalaCCodeFunction* _tmp555_; |
| 11302 | const gchar* _tmp556_; |
| 11303 | gchar* _tmp557_; |
| 11304 | gchar* _tmp558_; |
| 11305 | gchar* _tmp559_; |
| 11306 | gchar* _tmp560_; |
| 11307 | BalaCCodeIdentifier* _tmp561_; |
| 11308 | BalaCCodeIdentifier* _tmp562_; |
| 11309 | const gchar* _tmp563_; |
| 11310 | gchar* _tmp564_; |
| 11311 | gchar* _tmp565_; |
| 11312 | BalaCCodeCastExpression* _tmp566_; |
| 11313 | BalaCCodeCastExpression* _tmp567_; |
| 11314 | BalaCCodeVariableDeclarator* _tmp568_; |
| 11315 | BalaCCodeVariableDeclarator* _tmp569_; |
| 11316 | BalaCCodeIdentifier* _tmp570_; |
| 11317 | BalaCCodeIdentifier* _tmp571_; |
| 11318 | BalaCCodeFunctionCall* _tmp572_; |
| 11319 | BalaCCodeFunctionCall* _tmp573_; |
| 11320 | gchar* _tmp574_; |
| 11321 | gchar* _tmp575_; |
| 11322 | BalaCCodeIdentifier* _tmp576_; |
| 11323 | BalaCCodeIdentifier* _tmp577_; |
| 11324 | BalaCCodeMemberAccess* _tmp578_; |
| 11325 | BalaCCodeMemberAccess* _tmp579_; |
| 11326 | BalaCCodeUnaryExpression* _tmp580_; |
| 11327 | BalaCCodeUnaryExpression* _tmp581_; |
| 11328 | BalaCCodeFunction* _tmp582_; |
| 11329 | BalaCCodeFunction* _tmp583_; |
| 11330 | BalaCCodeFunctionCall* _tmp584_; |
| 11331 | BalaCCodeExpression* outer_block = NULL((void*)0); |
| 11332 | gchar* _tmp585_; |
| 11333 | gchar* _tmp586_; |
| 11334 | BalaCCodeIdentifier* _tmp587_; |
| 11335 | BalaCCodeExpression* _tmp588_; |
| 11336 | BalaBlock* parent_closure_block = NULL((void*)0); |
| 11337 | BalaDataType* this_type = NULL((void*)0); |
| 11338 | BalaDataType* _tmp599_; |
| 11339 | BalaDataType* _tmp600_; |
| 11340 | BalaDataType* _tmp601_; |
| 11341 | BalaMethod* _tmp616_; |
| 11342 | BalaMethod* _tmp617_; |
| 11343 | BalaSymbol* _tmp717_; |
| 11344 | BalaSymbol* _tmp718_; |
| 11345 | BalaBlock* _tmp789_; |
| 11346 | BalaCCodeFunctionCall* data_free = NULL((void*)0); |
| 11347 | BalaCCodeIdentifier* _tmp839_; |
| 11348 | BalaCCodeIdentifier* _tmp840_; |
| 11349 | BalaCCodeFunctionCall* _tmp841_; |
| 11350 | BalaCCodeFunctionCall* _tmp842_; |
| 11351 | BalaCCodeFunctionCall* _tmp843_; |
| 11352 | const gchar* _tmp844_; |
| 11353 | BalaCCodeIdentifier* _tmp845_; |
| 11354 | BalaCCodeIdentifier* _tmp846_; |
| 11355 | BalaCCodeFunctionCall* _tmp847_; |
| 11356 | gchar* _tmp848_; |
| 11357 | gchar* _tmp849_; |
| 11358 | BalaCCodeIdentifier* _tmp850_; |
| 11359 | BalaCCodeIdentifier* _tmp851_; |
| 11360 | BalaCCodeFunction* _tmp852_; |
| 11361 | BalaCCodeFunction* _tmp853_; |
| 11362 | BalaCCodeFunctionCall* _tmp854_; |
| 11363 | BalaCCodeFunction* _tmp855_; |
| 11364 | BalaCCodeFunction* _tmp856_; |
| 11365 | BalaCCodeFile* _tmp857_; |
| 11366 | BalaCCodeFunction* _tmp858_; |
| 11367 | BalaCCodeFile* _tmp859_; |
| 11368 | BalaCCodeFunction* _tmp860_; |
| 11369 | _tmp61_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 11370 | _tmp62_ = _tmp61_; |
| 11371 | _tmp63_ = bala_ccode_base_module_next_closure_block (self, _tmp62_); |
| 11372 | _tmp64_ = _bala_code_node_ref0 (_tmp63_); |
| 11373 | parent_block = _tmp64_; |
| 11374 | block_id = bala_ccode_base_module_get_block_id (self, b); |
| 11375 | _tmp65_ = g_strdup_printf ("Block%dData", block_id); |
| 11376 | struct_name = _tmp65_; |
| 11377 | _tmp66_ = struct_name; |
| 11378 | _tmp67_ = g_strconcat ("_", _tmp66_, NULL((void*)0)); |
| 11379 | _tmp68_ = _tmp67_; |
| 11380 | _tmp69_ = bala_ccode_struct_new (_tmp68_); |
| 11381 | _tmp70_ = _tmp69_; |
| 11382 | _g_free0 (_tmp68_)(_tmp68_ = (g_free (_tmp68_), ((void*)0))); |
| 11383 | data = _tmp70_; |
| 11384 | _tmp71_ = data; |
| 11385 | bala_ccode_struct_add_field (_tmp71_, "int", "_ref_count_", 0, NULL((void*)0)); |
| 11386 | _tmp72_ = parent_block; |
| 11387 | if (_tmp72_ != NULL((void*)0)) { |
| 11388 | gint parent_block_id = 0; |
| 11389 | BalaBlock* _tmp73_; |
| 11390 | BalaCCodeStruct* _tmp74_; |
| 11391 | gchar* _tmp75_; |
| 11392 | gchar* _tmp76_; |
| 11393 | gchar* _tmp77_; |
| 11394 | gchar* _tmp78_; |
| 11395 | _tmp73_ = parent_block; |
| 11396 | parent_block_id = bala_ccode_base_module_get_block_id (self, _tmp73_); |
| 11397 | _tmp74_ = data; |
| 11398 | _tmp75_ = g_strdup_printf ("Block%dData *", parent_block_id); |
| 11399 | _tmp76_ = _tmp75_; |
| 11400 | _tmp77_ = g_strdup_printf ("_data%d_", parent_block_id); |
| 11401 | _tmp78_ = _tmp77_; |
| 11402 | bala_ccode_struct_add_field (_tmp74_, _tmp76_, _tmp78_, 0, NULL((void*)0)); |
| 11403 | _g_free0 (_tmp78_)(_tmp78_ = (g_free (_tmp78_), ((void*)0))); |
| 11404 | _g_free0 (_tmp76_)(_tmp76_ = (g_free (_tmp76_), ((void*)0))); |
| 11405 | } else { |
| 11406 | BalaDataType* this_type = NULL((void*)0); |
| 11407 | BalaDataType* _tmp79_; |
| 11408 | BalaDataType* _tmp80_; |
| 11409 | BalaMethod* _tmp85_; |
| 11410 | BalaMethod* _tmp86_; |
| 11411 | _tmp79_ = bala_ccode_base_module_get_this_type (self); |
| 11412 | this_type = _tmp79_; |
| 11413 | _tmp80_ = this_type; |
| 11414 | if (_tmp80_ != NULL((void*)0)) { |
| 11415 | BalaCCodeStruct* _tmp81_; |
| 11416 | BalaDataType* _tmp82_; |
| 11417 | gchar* _tmp83_; |
| 11418 | gchar* _tmp84_; |
| 11419 | _tmp81_ = data; |
| 11420 | _tmp82_ = this_type; |
| 11421 | _tmp83_ = bala_get_ccode_name ((BalaCodeNode*) _tmp82_); |
| 11422 | _tmp84_ = _tmp83_; |
| 11423 | bala_ccode_struct_add_field (_tmp81_, _tmp84_, "self", 0, NULL((void*)0)); |
| 11424 | _g_free0 (_tmp84_)(_tmp84_ = (g_free (_tmp84_), ((void*)0))); |
| 11425 | } |
| 11426 | _tmp85_ = bala_ccode_base_module_get_current_method (self); |
| 11427 | _tmp86_ = _tmp85_; |
| 11428 | if (_tmp86_ != NULL((void*)0)) { |
| 11429 | { |
| 11430 | BalaList* _type_param_list = NULL((void*)0); |
| 11431 | BalaMethod* _tmp87_; |
| 11432 | BalaMethod* _tmp88_; |
| 11433 | BalaList* _tmp89_; |
| 11434 | BalaList* _tmp90_; |
| 11435 | gint _type_param_size = 0; |
| 11436 | BalaList* _tmp91_; |
| 11437 | gint _tmp92_; |
| 11438 | gint _tmp93_; |
| 11439 | gint _type_param_index = 0; |
| 11440 | _tmp87_ = bala_ccode_base_module_get_current_method (self); |
| 11441 | _tmp88_ = _tmp87_; |
| 11442 | _tmp89_ = bala_method_get_type_parameters (_tmp88_); |
| 11443 | _tmp90_ = _bala_iterable_ref0 (_tmp89_); |
| 11444 | _type_param_list = _tmp90_; |
| 11445 | _tmp91_ = _type_param_list; |
| 11446 | _tmp92_ = bala_collection_get_size ((BalaCollection*) _tmp91_); |
| 11447 | _tmp93_ = _tmp92_; |
| 11448 | _type_param_size = _tmp93_; |
| 11449 | _type_param_index = -1; |
| 11450 | while (TRUE(!(0))) { |
| 11451 | gint _tmp94_; |
| 11452 | gint _tmp95_; |
| 11453 | BalaTypeParameter* type_param = NULL((void*)0); |
| 11454 | BalaList* _tmp96_; |
| 11455 | gpointer _tmp97_; |
| 11456 | gchar* func_name = NULL((void*)0); |
| 11457 | BalaTypeParameter* _tmp98_; |
| 11458 | const gchar* _tmp99_; |
| 11459 | const gchar* _tmp100_; |
| 11460 | gchar* _tmp101_; |
| 11461 | gchar* _tmp102_; |
| 11462 | gchar* _tmp103_; |
| 11463 | BalaCCodeStruct* _tmp104_; |
| 11464 | const gchar* _tmp105_; |
| 11465 | BalaTypeParameter* _tmp106_; |
| 11466 | const gchar* _tmp107_; |
| 11467 | const gchar* _tmp108_; |
| 11468 | gchar* _tmp109_; |
| 11469 | gchar* _tmp110_; |
| 11470 | gchar* _tmp111_; |
| 11471 | BalaCCodeStruct* _tmp112_; |
| 11472 | const gchar* _tmp113_; |
| 11473 | BalaTypeParameter* _tmp114_; |
| 11474 | const gchar* _tmp115_; |
| 11475 | const gchar* _tmp116_; |
| 11476 | gchar* _tmp117_; |
| 11477 | gchar* _tmp118_; |
| 11478 | gchar* _tmp119_; |
| 11479 | BalaCCodeStruct* _tmp120_; |
| 11480 | const gchar* _tmp121_; |
| 11481 | _type_param_index = _type_param_index + 1; |
| 11482 | _tmp94_ = _type_param_index; |
| 11483 | _tmp95_ = _type_param_size; |
| 11484 | if (!(_tmp94_ < _tmp95_)) { |
| 11485 | break; |
| 11486 | } |
| 11487 | _tmp96_ = _type_param_list; |
| 11488 | _tmp97_ = bala_list_get (_tmp96_, _type_param_index); |
| 11489 | type_param = (BalaTypeParameter*) _tmp97_; |
| 11490 | _tmp98_ = type_param; |
| 11491 | _tmp99_ = bala_symbol_get_name ((BalaSymbol*) _tmp98_); |
| 11492 | _tmp100_ = _tmp99_; |
| 11493 | _tmp101_ = g_ascii_strdown (_tmp100_, (gssize) -1); |
| 11494 | _tmp102_ = _tmp101_; |
| 11495 | _tmp103_ = g_strdup_printf ("%s_type", _tmp102_); |
| 11496 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 11497 | func_name = _tmp103_; |
| 11498 | _g_free0 (_tmp102_)(_tmp102_ = (g_free (_tmp102_), ((void*)0))); |
| 11499 | _tmp104_ = data; |
| 11500 | _tmp105_ = func_name; |
| 11501 | bala_ccode_struct_add_field (_tmp104_, "GType", _tmp105_, 0, NULL((void*)0)); |
| 11502 | _tmp106_ = type_param; |
| 11503 | _tmp107_ = bala_symbol_get_name ((BalaSymbol*) _tmp106_); |
| 11504 | _tmp108_ = _tmp107_; |
| 11505 | _tmp109_ = g_ascii_strdown (_tmp108_, (gssize) -1); |
| 11506 | _tmp110_ = _tmp109_; |
| 11507 | _tmp111_ = g_strdup_printf ("%s_dup_func", _tmp110_); |
| 11508 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 11509 | func_name = _tmp111_; |
| 11510 | _g_free0 (_tmp110_)(_tmp110_ = (g_free (_tmp110_), ((void*)0))); |
| 11511 | _tmp112_ = data; |
| 11512 | _tmp113_ = func_name; |
| 11513 | bala_ccode_struct_add_field (_tmp112_, "GBoxedCopyFunc", _tmp113_, 0, NULL((void*)0)); |
| 11514 | _tmp114_ = type_param; |
| 11515 | _tmp115_ = bala_symbol_get_name ((BalaSymbol*) _tmp114_); |
| 11516 | _tmp116_ = _tmp115_; |
| 11517 | _tmp117_ = g_ascii_strdown (_tmp116_, (gssize) -1); |
| 11518 | _tmp118_ = _tmp117_; |
| 11519 | _tmp119_ = g_strdup_printf ("%s_destroy_func", _tmp118_); |
| 11520 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 11521 | func_name = _tmp119_; |
| 11522 | _g_free0 (_tmp118_)(_tmp118_ = (g_free (_tmp118_), ((void*)0))); |
| 11523 | _tmp120_ = data; |
| 11524 | _tmp121_ = func_name; |
| 11525 | bala_ccode_struct_add_field (_tmp120_, "GDestroyNotify", _tmp121_, 0, NULL((void*)0)); |
| 11526 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 11527 | _bala_code_node_unref0 (type_param)((type_param == ((void*)0)) ? ((void*)0) : (type_param = (bala_code_node_unref (type_param), ((void*)0)))); |
| 11528 | } |
| 11529 | _bala_iterable_unref0 (_type_param_list)((_type_param_list == ((void*)0)) ? ((void*)0) : (_type_param_list = (bala_iterable_unref (_type_param_list), ((void*)0)))); |
| 11530 | } |
| 11531 | } |
| 11532 | } |
| 11533 | { |
| 11534 | BalaList* _local_list = NULL((void*)0); |
| 11535 | BalaList* _tmp122_; |
| 11536 | BalaList* _tmp123_; |
| 11537 | gint _local_size = 0; |
| 11538 | BalaList* _tmp124_; |
| 11539 | gint _tmp125_; |
| 11540 | gint _tmp126_; |
| 11541 | gint _local_index = 0; |
| 11542 | _tmp122_ = local_vars; |
| 11543 | _tmp123_ = _bala_iterable_ref0 (_tmp122_); |
| 11544 | _local_list = _tmp123_; |
| 11545 | _tmp124_ = _local_list; |
| 11546 | _tmp125_ = bala_collection_get_size ((BalaCollection*) _tmp124_); |
| 11547 | _tmp126_ = _tmp125_; |
| 11548 | _local_size = _tmp126_; |
| 11549 | _local_index = -1; |
| 11550 | while (TRUE(!(0))) { |
| 11551 | gint _tmp127_; |
| 11552 | gint _tmp128_; |
| 11553 | BalaLocalVariable* local = NULL((void*)0); |
| 11554 | BalaList* _tmp129_; |
| 11555 | gpointer _tmp130_; |
| 11556 | BalaLocalVariable* _tmp131_; |
| 11557 | gboolean _tmp132_; |
| 11558 | gboolean _tmp133_; |
| 11559 | _local_index = _local_index + 1; |
| 11560 | _tmp127_ = _local_index; |
| 11561 | _tmp128_ = _local_size; |
| 11562 | if (!(_tmp127_ < _tmp128_)) { |
| 11563 | break; |
| 11564 | } |
| 11565 | _tmp129_ = _local_list; |
| 11566 | _tmp130_ = bala_list_get (_tmp129_, _local_index); |
| 11567 | local = (BalaLocalVariable*) _tmp130_; |
| 11568 | _tmp131_ = local; |
| 11569 | _tmp132_ = bala_local_variable_get_captured (_tmp131_); |
| 11570 | _tmp133_ = _tmp132_; |
| 11571 | if (_tmp133_) { |
| 11572 | BalaLocalVariable* _tmp134_; |
| 11573 | BalaDataType* _tmp135_; |
| 11574 | BalaDataType* _tmp136_; |
| 11575 | BalaCCodeFile* _tmp137_; |
| 11576 | BalaCCodeStruct* _tmp138_; |
| 11577 | BalaLocalVariable* _tmp139_; |
| 11578 | BalaDataType* _tmp140_; |
| 11579 | BalaDataType* _tmp141_; |
| 11580 | gchar* _tmp142_; |
| 11581 | gchar* _tmp143_; |
| 11582 | BalaLocalVariable* _tmp144_; |
| 11583 | gchar* _tmp145_; |
| 11584 | gchar* _tmp146_; |
| 11585 | BalaLocalVariable* _tmp147_; |
| 11586 | BalaDataType* _tmp148_; |
| 11587 | BalaDataType* _tmp149_; |
| 11588 | BalaCCodeDeclaratorSuffix* _tmp150_; |
| 11589 | BalaCCodeDeclaratorSuffix* _tmp151_; |
| 11590 | gboolean _tmp152_ = FALSE(0); |
| 11591 | BalaLocalVariable* _tmp153_; |
| 11592 | BalaDataType* _tmp154_; |
| 11593 | BalaDataType* _tmp155_; |
| 11594 | _tmp134_ = local; |
| 11595 | _tmp135_ = bala_variable_get_variable_type ((BalaVariable*) _tmp134_); |
| 11596 | _tmp136_ = _tmp135_; |
| 11597 | _tmp137_ = self->cfile; |
| 11598 | bala_ccode_base_module_generate_type_declaration (self, _tmp136_, _tmp137_); |
| 11599 | _tmp138_ = data; |
| 11600 | _tmp139_ = local; |
| 11601 | _tmp140_ = bala_variable_get_variable_type ((BalaVariable*) _tmp139_); |
| 11602 | _tmp141_ = _tmp140_; |
| 11603 | _tmp142_ = bala_get_ccode_name ((BalaCodeNode*) _tmp141_); |
| 11604 | _tmp143_ = _tmp142_; |
| 11605 | _tmp144_ = local; |
| 11606 | _tmp145_ = bala_ccode_base_module_get_local_cname (self, _tmp144_); |
| 11607 | _tmp146_ = _tmp145_; |
| 11608 | _tmp147_ = local; |
| 11609 | _tmp148_ = bala_variable_get_variable_type ((BalaVariable*) _tmp147_); |
| 11610 | _tmp149_ = _tmp148_; |
| 11611 | _tmp150_ = bala_ccode_base_module_get_ccode_declarator_suffix (self, _tmp149_); |
| 11612 | _tmp151_ = _tmp150_; |
| 11613 | bala_ccode_struct_add_field (_tmp138_, _tmp143_, _tmp146_, 0, _tmp151_); |
| 11614 | _bala_ccode_declarator_suffix_unref0 (_tmp151_)((_tmp151_ == ((void*)0)) ? ((void*)0) : (_tmp151_ = (bala_ccode_declarator_suffix_unref (_tmp151_), ((void*)0)))); |
| 11615 | _g_free0 (_tmp146_)(_tmp146_ = (g_free (_tmp146_), ((void*)0))); |
| 11616 | _g_free0 (_tmp143_)(_tmp143_ = (g_free (_tmp143_), ((void*)0))); |
| 11617 | _tmp153_ = local; |
| 11618 | _tmp154_ = bala_variable_get_variable_type ((BalaVariable*) _tmp153_); |
| 11619 | _tmp155_ = _tmp154_; |
| 11620 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp155_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp155_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 11621 | BalaLocalVariable* _tmp156_; |
| 11622 | BalaDataType* _tmp157_; |
| 11623 | BalaDataType* _tmp158_; |
| 11624 | gboolean _tmp159_; |
| 11625 | gboolean _tmp160_; |
| 11626 | _tmp156_ = local; |
| 11627 | _tmp157_ = bala_variable_get_variable_type ((BalaVariable*) _tmp156_); |
| 11628 | _tmp158_ = _tmp157_; |
| 11629 | _tmp159_ = bala_array_type_get_fixed_length (G_TYPE_CHECK_INSTANCE_CAST (_tmp158_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp158_), ((bala_array_type_get_type ())))))); |
| 11630 | _tmp160_ = _tmp159_; |
| 11631 | _tmp152_ = !_tmp160_; |
| 11632 | } else { |
| 11633 | _tmp152_ = FALSE(0); |
| 11634 | } |
| 11635 | if (_tmp152_) { |
| 11636 | BalaArrayType* array_type = NULL((void*)0); |
| 11637 | BalaLocalVariable* _tmp161_; |
| 11638 | BalaDataType* _tmp162_; |
| 11639 | BalaDataType* _tmp163_; |
| 11640 | BalaArrayType* _tmp164_; |
| 11641 | gchar* length_ctype = NULL((void*)0); |
| 11642 | BalaArrayType* _tmp165_; |
| 11643 | gchar* _tmp166_; |
| 11644 | BalaCCodeStruct* _tmp179_; |
| 11645 | const gchar* _tmp180_; |
| 11646 | BalaLocalVariable* _tmp181_; |
| 11647 | gchar* _tmp182_; |
| 11648 | gchar* _tmp183_; |
| 11649 | gchar* _tmp184_; |
| 11650 | gchar* _tmp185_; |
| 11651 | _tmp161_ = local; |
| 11652 | _tmp162_ = bala_variable_get_variable_type ((BalaVariable*) _tmp161_); |
| 11653 | _tmp163_ = _tmp162_; |
| 11654 | _tmp164_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp163_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp163_), ((bala_array_type_get_type ())))))); |
| 11655 | array_type = _tmp164_; |
| 11656 | _tmp165_ = array_type; |
| 11657 | _tmp166_ = bala_get_ccode_array_length_type ((BalaCodeNode*) _tmp165_); |
| 11658 | length_ctype = _tmp166_; |
| 11659 | { |
| 11660 | gint dim = 0; |
| 11661 | dim = 1; |
| 11662 | { |
| 11663 | gboolean _tmp167_ = FALSE(0); |
| 11664 | _tmp167_ = TRUE(!(0)); |
| 11665 | while (TRUE(!(0))) { |
| 11666 | BalaArrayType* _tmp169_; |
| 11667 | gint _tmp170_; |
| 11668 | gint _tmp171_; |
| 11669 | BalaCCodeStruct* _tmp172_; |
| 11670 | const gchar* _tmp173_; |
| 11671 | BalaLocalVariable* _tmp174_; |
| 11672 | gchar* _tmp175_; |
| 11673 | gchar* _tmp176_; |
| 11674 | gchar* _tmp177_; |
| 11675 | gchar* _tmp178_; |
| 11676 | if (!_tmp167_) { |
| 11677 | gint _tmp168_; |
| 11678 | _tmp168_ = dim; |
| 11679 | dim = _tmp168_ + 1; |
| 11680 | } |
| 11681 | _tmp167_ = FALSE(0); |
| 11682 | _tmp169_ = array_type; |
| 11683 | _tmp170_ = bala_array_type_get_rank (_tmp169_); |
| 11684 | _tmp171_ = _tmp170_; |
| 11685 | if (!(dim <= _tmp171_)) { |
| 11686 | break; |
| 11687 | } |
| 11688 | _tmp172_ = data; |
| 11689 | _tmp173_ = length_ctype; |
| 11690 | _tmp174_ = local; |
| 11691 | _tmp175_ = bala_ccode_base_module_get_local_cname (self, _tmp174_); |
| 11692 | _tmp176_ = _tmp175_; |
| 11693 | _tmp177_ = bala_ccode_base_module_get_array_length_cname (self, _tmp176_, dim); |
| 11694 | _tmp178_ = _tmp177_; |
| 11695 | bala_ccode_struct_add_field (_tmp172_, _tmp173_, _tmp178_, 0, NULL((void*)0)); |
| 11696 | _g_free0 (_tmp178_)(_tmp178_ = (g_free (_tmp178_), ((void*)0))); |
| 11697 | _g_free0 (_tmp176_)(_tmp176_ = (g_free (_tmp176_), ((void*)0))); |
| 11698 | } |
| 11699 | } |
| 11700 | } |
| 11701 | _tmp179_ = data; |
| 11702 | _tmp180_ = length_ctype; |
| 11703 | _tmp181_ = local; |
| 11704 | _tmp182_ = bala_ccode_base_module_get_local_cname (self, _tmp181_); |
| 11705 | _tmp183_ = _tmp182_; |
| 11706 | _tmp184_ = bala_ccode_base_module_get_array_size_cname (self, _tmp183_); |
| 11707 | _tmp185_ = _tmp184_; |
| 11708 | bala_ccode_struct_add_field (_tmp179_, _tmp180_, _tmp185_, 0, NULL((void*)0)); |
| 11709 | _g_free0 (_tmp185_)(_tmp185_ = (g_free (_tmp185_), ((void*)0))); |
| 11710 | _g_free0 (_tmp183_)(_tmp183_ = (g_free (_tmp183_), ((void*)0))); |
| 11711 | _g_free0 (length_ctype)(length_ctype = (g_free (length_ctype), ((void*)0))); |
| 11712 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 11713 | } else { |
| 11714 | gboolean _tmp186_ = FALSE(0); |
| 11715 | BalaLocalVariable* _tmp187_; |
| 11716 | BalaDataType* _tmp188_; |
| 11717 | BalaDataType* _tmp189_; |
| 11718 | _tmp187_ = local; |
| 11719 | _tmp188_ = bala_variable_get_variable_type ((BalaVariable*) _tmp187_); |
| 11720 | _tmp189_ = _tmp188_; |
| 11721 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp189_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp189_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 11722 | BalaLocalVariable* _tmp190_; |
| 11723 | BalaDataType* _tmp191_; |
| 11724 | BalaDataType* _tmp192_; |
| 11725 | BalaDelegate* _tmp193_; |
| 11726 | BalaDelegate* _tmp194_; |
| 11727 | gboolean _tmp195_; |
| 11728 | gboolean _tmp196_; |
| 11729 | _tmp190_ = local; |
| 11730 | _tmp191_ = bala_variable_get_variable_type ((BalaVariable*) _tmp190_); |
| 11731 | _tmp192_ = _tmp191_; |
| 11732 | _tmp193_ = bala_delegate_type_get_delegate_symbol (G_TYPE_CHECK_INSTANCE_CAST (_tmp192_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp192_), ((bala_delegate_type_get_type ())))))); |
| 11733 | _tmp194_ = _tmp193_; |
| 11734 | _tmp195_ = bala_delegate_get_has_target (_tmp194_); |
| 11735 | _tmp196_ = _tmp195_; |
| 11736 | _tmp186_ = _tmp196_; |
| 11737 | } else { |
| 11738 | _tmp186_ = FALSE(0); |
| 11739 | } |
| 11740 | if (_tmp186_) { |
| 11741 | BalaCCodeStruct* _tmp197_; |
| 11742 | BalaDataType* _tmp198_; |
| 11743 | gchar* _tmp199_; |
| 11744 | gchar* _tmp200_; |
| 11745 | BalaLocalVariable* _tmp201_; |
| 11746 | gchar* _tmp202_; |
| 11747 | gchar* _tmp203_; |
| 11748 | gchar* _tmp204_; |
| 11749 | gchar* _tmp205_; |
| 11750 | BalaLocalVariable* _tmp206_; |
| 11751 | BalaDataType* _tmp207_; |
| 11752 | BalaDataType* _tmp208_; |
| 11753 | _tmp197_ = data; |
| 11754 | _tmp198_ = self->delegate_target_type; |
| 11755 | _tmp199_ = bala_get_ccode_name ((BalaCodeNode*) _tmp198_); |
| 11756 | _tmp200_ = _tmp199_; |
| 11757 | _tmp201_ = local; |
| 11758 | _tmp202_ = bala_ccode_base_module_get_local_cname (self, _tmp201_); |
| 11759 | _tmp203_ = _tmp202_; |
| 11760 | _tmp204_ = bala_ccode_base_module_get_delegate_target_cname (self, _tmp203_); |
| 11761 | _tmp205_ = _tmp204_; |
| 11762 | bala_ccode_struct_add_field (_tmp197_, _tmp200_, _tmp205_, 0, NULL((void*)0)); |
| 11763 | _g_free0 (_tmp205_)(_tmp205_ = (g_free (_tmp205_), ((void*)0))); |
| 11764 | _g_free0 (_tmp203_)(_tmp203_ = (g_free (_tmp203_), ((void*)0))); |
| 11765 | _g_free0 (_tmp200_)(_tmp200_ = (g_free (_tmp200_), ((void*)0))); |
| 11766 | _tmp206_ = local; |
| 11767 | _tmp207_ = bala_variable_get_variable_type ((BalaVariable*) _tmp206_); |
| 11768 | _tmp208_ = _tmp207_; |
| 11769 | if (bala_data_type_is_disposable (_tmp208_)) { |
| 11770 | BalaCCodeStruct* _tmp209_; |
| 11771 | BalaDelegateType* _tmp210_; |
| 11772 | gchar* _tmp211_; |
| 11773 | gchar* _tmp212_; |
| 11774 | BalaLocalVariable* _tmp213_; |
| 11775 | gchar* _tmp214_; |
| 11776 | gchar* _tmp215_; |
| 11777 | gchar* _tmp216_; |
| 11778 | gchar* _tmp217_; |
| 11779 | _tmp209_ = data; |
| 11780 | _tmp210_ = self->delegate_target_destroy_type; |
| 11781 | _tmp211_ = bala_get_ccode_name ((BalaCodeNode*) _tmp210_); |
| 11782 | _tmp212_ = _tmp211_; |
| 11783 | _tmp213_ = local; |
| 11784 | _tmp214_ = bala_ccode_base_module_get_local_cname (self, _tmp213_); |
| 11785 | _tmp215_ = _tmp214_; |
| 11786 | _tmp216_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cname (self, _tmp215_); |
| 11787 | _tmp217_ = _tmp216_; |
| 11788 | bala_ccode_struct_add_field (_tmp209_, _tmp212_, _tmp217_, 0, NULL((void*)0)); |
| 11789 | _g_free0 (_tmp217_)(_tmp217_ = (g_free (_tmp217_), ((void*)0))); |
| 11790 | _g_free0 (_tmp215_)(_tmp215_ = (g_free (_tmp215_), ((void*)0))); |
| 11791 | _g_free0 (_tmp212_)(_tmp212_ = (g_free (_tmp212_), ((void*)0))); |
| 11792 | } |
| 11793 | } else { |
| 11794 | BalaLocalVariable* _tmp218_; |
| 11795 | BalaDataType* _tmp219_; |
| 11796 | BalaDataType* _tmp220_; |
| 11797 | BalaTypeSymbol* _tmp221_; |
| 11798 | BalaTypeSymbol* _tmp222_; |
| 11799 | BalaCodeContext* _tmp223_; |
| 11800 | BalaSemanticAnalyzer* _tmp224_; |
| 11801 | BalaSemanticAnalyzer* _tmp225_; |
| 11802 | BalaDataType* _tmp226_; |
| 11803 | BalaTypeSymbol* _tmp227_; |
| 11804 | BalaTypeSymbol* _tmp228_; |
| 11805 | _tmp218_ = local; |
| 11806 | _tmp219_ = bala_variable_get_variable_type ((BalaVariable*) _tmp218_); |
| 11807 | _tmp220_ = _tmp219_; |
| 11808 | _tmp221_ = bala_data_type_get_type_symbol (_tmp220_); |
| 11809 | _tmp222_ = _tmp221_; |
| 11810 | _tmp223_ = self->priv->_context; |
| 11811 | _tmp224_ = bala_code_context_get_analyzer (_tmp223_); |
| 11812 | _tmp225_ = _tmp224_; |
| 11813 | _tmp226_ = _tmp225_->va_list_type; |
| 11814 | _tmp227_ = bala_data_type_get_type_symbol (_tmp226_); |
| 11815 | _tmp228_ = _tmp227_; |
| 11816 | if (_tmp222_ == _tmp228_) { |
| 11817 | BalaLocalVariable* _tmp229_; |
| 11818 | BalaSourceReference* _tmp230_; |
| 11819 | BalaSourceReference* _tmp231_; |
| 11820 | BalaLocalVariable* _tmp232_; |
| 11821 | gchar* _tmp233_; |
| 11822 | gchar* _tmp234_; |
| 11823 | gchar* _tmp235_; |
| 11824 | gchar* _tmp236_; |
| 11825 | _tmp229_ = local; |
| 11826 | _tmp230_ = bala_code_node_get_source_reference ((BalaCodeNode*) _tmp229_); |
| 11827 | _tmp231_ = _tmp230_; |
| 11828 | _tmp232_ = local; |
| 11829 | _tmp233_ = bala_symbol_get_full_name ((BalaSymbol*) _tmp232_); |
| 11830 | _tmp234_ = _tmp233_; |
| 11831 | _tmp235_ = g_strdup_printf ("internal: Capturing `va_list' variable `%s' is not allowed", _tmp234_); |
| 11832 | _tmp236_ = _tmp235_; |
| 11833 | bala_report_error (_tmp231_, _tmp236_); |
| 11834 | _g_free0 (_tmp236_)(_tmp236_ = (g_free (_tmp236_), ((void*)0))); |
| 11835 | _g_free0 (_tmp234_)(_tmp234_ = (g_free (_tmp234_), ((void*)0))); |
| 11836 | bala_code_node_set_error ((BalaCodeNode*) b, TRUE(!(0))); |
| 11837 | } |
| 11838 | } |
| 11839 | } |
| 11840 | } |
| 11841 | _bala_code_node_unref0 (local)((local == ((void*)0)) ? ((void*)0) : (local = (bala_code_node_unref (local), ((void*)0)))); |
| 11842 | } |
| 11843 | _bala_iterable_unref0 (_local_list)((_local_list == ((void*)0)) ? ((void*)0) : (_local_list = (bala_iterable_unref (_local_list), ((void*)0)))); |
| 11844 | } |
| 11845 | _tmp237_ = bala_ccode_identifier_new ("g_slice_new0"); |
| 11846 | _tmp238_ = _tmp237_; |
| 11847 | _tmp239_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp238_); |
| 11848 | _tmp240_ = _tmp239_; |
| 11849 | _bala_ccode_node_unref0 (_tmp238_)((_tmp238_ == ((void*)0)) ? ((void*)0) : (_tmp238_ = (bala_ccode_node_unref (_tmp238_), ((void*)0)))); |
| 11850 | data_alloc = _tmp240_; |
| 11851 | _tmp241_ = data_alloc; |
| 11852 | _tmp242_ = struct_name; |
| 11853 | _tmp243_ = bala_ccode_identifier_new (_tmp242_); |
| 11854 | _tmp244_ = _tmp243_; |
| 11855 | bala_ccode_function_call_add_argument (_tmp241_, (BalaCCodeExpression*) _tmp244_); |
| 11856 | _bala_ccode_node_unref0 (_tmp244_)((_tmp244_ == ((void*)0)) ? ((void*)0) : (_tmp244_ = (bala_ccode_node_unref (_tmp244_), ((void*)0)))); |
| 11857 | if (bala_ccode_base_module_is_in_coroutine (self)) { |
| 11858 | BalaCCodeStruct* _tmp245_; |
| 11859 | const gchar* _tmp246_; |
| 11860 | gchar* _tmp247_; |
| 11861 | gchar* _tmp248_; |
| 11862 | gchar* _tmp249_; |
| 11863 | gchar* _tmp250_; |
| 11864 | _tmp245_ = self->closure_struct; |
| 11865 | _tmp246_ = struct_name; |
| 11866 | _tmp247_ = g_strconcat (_tmp246_, "*", NULL((void*)0)); |
| 11867 | _tmp248_ = _tmp247_; |
| 11868 | _tmp249_ = g_strdup_printf ("_data%d_", block_id); |
| 11869 | _tmp250_ = _tmp249_; |
| 11870 | bala_ccode_struct_add_field (_tmp245_, _tmp248_, _tmp250_, 0, NULL((void*)0)); |
| 11871 | _g_free0 (_tmp250_)(_tmp250_ = (g_free (_tmp250_), ((void*)0))); |
| 11872 | _g_free0 (_tmp248_)(_tmp248_ = (g_free (_tmp248_), ((void*)0))); |
| 11873 | } else { |
| 11874 | BalaCCodeFunction* _tmp251_; |
| 11875 | BalaCCodeFunction* _tmp252_; |
| 11876 | const gchar* _tmp253_; |
| 11877 | gchar* _tmp254_; |
| 11878 | gchar* _tmp255_; |
| 11879 | gchar* _tmp256_; |
| 11880 | gchar* _tmp257_; |
| 11881 | BalaCCodeVariableDeclarator* _tmp258_; |
| 11882 | BalaCCodeVariableDeclarator* _tmp259_; |
| 11883 | _tmp251_ = bala_ccode_base_module_get_ccode (self); |
| 11884 | _tmp252_ = _tmp251_; |
| 11885 | _tmp253_ = struct_name; |
| 11886 | _tmp254_ = g_strconcat (_tmp253_, "*", NULL((void*)0)); |
| 11887 | _tmp255_ = _tmp254_; |
| 11888 | _tmp256_ = g_strdup_printf ("_data%d_", block_id); |
| 11889 | _tmp257_ = _tmp256_; |
| 11890 | _tmp258_ = bala_ccode_variable_declarator_new (_tmp257_, NULL((void*)0), NULL((void*)0)); |
| 11891 | _tmp259_ = _tmp258_; |
| 11892 | bala_ccode_function_add_declaration (_tmp252_, _tmp255_, (BalaCCodeDeclarator*) _tmp259_, 0); |
| 11893 | _bala_ccode_node_unref0 (_tmp259_)((_tmp259_ == ((void*)0)) ? ((void*)0) : (_tmp259_ = (bala_ccode_node_unref (_tmp259_), ((void*)0)))); |
| 11894 | _g_free0 (_tmp257_)(_tmp257_ = (g_free (_tmp257_), ((void*)0))); |
| 11895 | _g_free0 (_tmp255_)(_tmp255_ = (g_free (_tmp255_), ((void*)0))); |
| 11896 | } |
| 11897 | _tmp260_ = bala_ccode_base_module_get_ccode (self); |
| 11898 | _tmp261_ = _tmp260_; |
| 11899 | _tmp262_ = g_strdup_printf ("_data%d_", block_id); |
| 11900 | _tmp263_ = _tmp262_; |
| 11901 | _tmp264_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp263_); |
| 11902 | _tmp265_ = _tmp264_; |
| 11903 | _tmp266_ = data_alloc; |
| 11904 | bala_ccode_function_add_assignment (_tmp261_, _tmp265_, (BalaCCodeExpression*) _tmp266_); |
| 11905 | _bala_ccode_node_unref0 (_tmp265_)((_tmp265_ == ((void*)0)) ? ((void*)0) : (_tmp265_ = (bala_ccode_node_unref (_tmp265_), ((void*)0)))); |
| 11906 | _g_free0 (_tmp263_)(_tmp263_ = (g_free (_tmp263_), ((void*)0))); |
| 11907 | _tmp267_ = bala_ccode_base_module_get_ccode (self); |
| 11908 | _tmp268_ = _tmp267_; |
| 11909 | _tmp269_ = g_strdup_printf ("_data%d_", block_id); |
| 11910 | _tmp270_ = _tmp269_; |
| 11911 | _tmp271_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp270_); |
| 11912 | _tmp272_ = _tmp271_; |
| 11913 | _tmp273_ = bala_ccode_member_access_new_pointer (_tmp272_, "_ref_count_"); |
| 11914 | _tmp274_ = _tmp273_; |
| 11915 | _tmp275_ = bala_ccode_identifier_new ("1"); |
| 11916 | _tmp276_ = _tmp275_; |
| 11917 | bala_ccode_function_add_assignment (_tmp268_, (BalaCCodeExpression*) _tmp274_, (BalaCCodeExpression*) _tmp276_); |
| 11918 | _bala_ccode_node_unref0 (_tmp276_)((_tmp276_ == ((void*)0)) ? ((void*)0) : (_tmp276_ = (bala_ccode_node_unref (_tmp276_), ((void*)0)))); |
| 11919 | _bala_ccode_node_unref0 (_tmp274_)((_tmp274_ == ((void*)0)) ? ((void*)0) : (_tmp274_ = (bala_ccode_node_unref (_tmp274_), ((void*)0)))); |
| 11920 | _bala_ccode_node_unref0 (_tmp272_)((_tmp272_ == ((void*)0)) ? ((void*)0) : (_tmp272_ = (bala_ccode_node_unref (_tmp272_), ((void*)0)))); |
| 11921 | _g_free0 (_tmp270_)(_tmp270_ = (g_free (_tmp270_), ((void*)0))); |
| 11922 | _tmp277_ = parent_block; |
| 11923 | if (_tmp277_ != NULL((void*)0)) { |
| 11924 | gint parent_block_id = 0; |
| 11925 | BalaBlock* _tmp278_; |
| 11926 | BalaCCodeFunctionCall* ref_call = NULL((void*)0); |
| 11927 | gchar* _tmp279_; |
| 11928 | gchar* _tmp280_; |
| 11929 | BalaCCodeIdentifier* _tmp281_; |
| 11930 | BalaCCodeIdentifier* _tmp282_; |
| 11931 | BalaCCodeFunctionCall* _tmp283_; |
| 11932 | BalaCCodeFunctionCall* _tmp284_; |
| 11933 | BalaCCodeFunctionCall* _tmp285_; |
| 11934 | gchar* _tmp286_; |
| 11935 | gchar* _tmp287_; |
| 11936 | BalaCCodeExpression* _tmp288_; |
| 11937 | BalaCCodeExpression* _tmp289_; |
| 11938 | BalaCCodeFunction* _tmp290_; |
| 11939 | BalaCCodeFunction* _tmp291_; |
| 11940 | gchar* _tmp292_; |
| 11941 | gchar* _tmp293_; |
| 11942 | BalaCCodeExpression* _tmp294_; |
| 11943 | BalaCCodeExpression* _tmp295_; |
| 11944 | gchar* _tmp296_; |
| 11945 | gchar* _tmp297_; |
| 11946 | BalaCCodeMemberAccess* _tmp298_; |
| 11947 | BalaCCodeMemberAccess* _tmp299_; |
| 11948 | BalaCCodeFunctionCall* _tmp300_; |
| 11949 | _tmp278_ = parent_block; |
| 11950 | parent_block_id = bala_ccode_base_module_get_block_id (self, _tmp278_); |
| 11951 | _tmp279_ = g_strdup_printf ("block%d_data_ref", parent_block_id); |
| 11952 | _tmp280_ = _tmp279_; |
| 11953 | _tmp281_ = bala_ccode_identifier_new (_tmp280_); |
| 11954 | _tmp282_ = _tmp281_; |
| 11955 | _tmp283_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp282_); |
| 11956 | _tmp284_ = _tmp283_; |
| 11957 | _bala_ccode_node_unref0 (_tmp282_)((_tmp282_ == ((void*)0)) ? ((void*)0) : (_tmp282_ = (bala_ccode_node_unref (_tmp282_), ((void*)0)))); |
| 11958 | _g_free0 (_tmp280_)(_tmp280_ = (g_free (_tmp280_), ((void*)0))); |
| 11959 | ref_call = _tmp284_; |
| 11960 | _tmp285_ = ref_call; |
| 11961 | _tmp286_ = g_strdup_printf ("_data%d_", parent_block_id); |
| 11962 | _tmp287_ = _tmp286_; |
| 11963 | _tmp288_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp287_); |
| 11964 | _tmp289_ = _tmp288_; |
| 11965 | bala_ccode_function_call_add_argument (_tmp285_, _tmp289_); |
| 11966 | _bala_ccode_node_unref0 (_tmp289_)((_tmp289_ == ((void*)0)) ? ((void*)0) : (_tmp289_ = (bala_ccode_node_unref (_tmp289_), ((void*)0)))); |
| 11967 | _g_free0 (_tmp287_)(_tmp287_ = (g_free (_tmp287_), ((void*)0))); |
| 11968 | _tmp290_ = bala_ccode_base_module_get_ccode (self); |
| 11969 | _tmp291_ = _tmp290_; |
| 11970 | _tmp292_ = g_strdup_printf ("_data%d_", block_id); |
| 11971 | _tmp293_ = _tmp292_; |
| 11972 | _tmp294_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp293_); |
| 11973 | _tmp295_ = _tmp294_; |
| 11974 | _tmp296_ = g_strdup_printf ("_data%d_", parent_block_id); |
| 11975 | _tmp297_ = _tmp296_; |
| 11976 | _tmp298_ = bala_ccode_member_access_new_pointer (_tmp295_, _tmp297_); |
| 11977 | _tmp299_ = _tmp298_; |
| 11978 | _tmp300_ = ref_call; |
| 11979 | bala_ccode_function_add_assignment (_tmp291_, (BalaCCodeExpression*) _tmp299_, (BalaCCodeExpression*) _tmp300_); |
| 11980 | _bala_ccode_node_unref0 (_tmp299_)((_tmp299_ == ((void*)0)) ? ((void*)0) : (_tmp299_ = (bala_ccode_node_unref (_tmp299_), ((void*)0)))); |
| 11981 | _g_free0 (_tmp297_)(_tmp297_ = (g_free (_tmp297_), ((void*)0))); |
| 11982 | _bala_ccode_node_unref0 (_tmp295_)((_tmp295_ == ((void*)0)) ? ((void*)0) : (_tmp295_ = (bala_ccode_node_unref (_tmp295_), ((void*)0)))); |
| 11983 | _g_free0 (_tmp293_)(_tmp293_ = (g_free (_tmp293_), ((void*)0))); |
| 11984 | _bala_ccode_node_unref0 (ref_call)((ref_call == ((void*)0)) ? ((void*)0) : (ref_call = (bala_ccode_node_unref (ref_call), ((void*)0)))); |
| 11985 | } else { |
| 11986 | gboolean _tmp301_ = FALSE(0); |
| 11987 | gboolean _tmp302_ = FALSE(0); |
| 11988 | BalaMethod* _tmp303_; |
| 11989 | BalaMethod* _tmp304_; |
| 11990 | gboolean in_creation_method_with_chainup = FALSE(0); |
| 11991 | BalaDataType* this_type = NULL((void*)0); |
| 11992 | BalaDataType* _tmp311_; |
| 11993 | gboolean _tmp312_ = FALSE(0); |
| 11994 | BalaDataType* _tmp313_; |
| 11995 | BalaMethod* _tmp343_; |
| 11996 | BalaMethod* _tmp344_; |
| 11997 | _tmp303_ = bala_ccode_base_module_get_current_method (self); |
| 11998 | _tmp304_ = _tmp303_; |
| 11999 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp304_, BALA_TYPE_CREATION_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp304_); GType __t = ((bala_creation_method_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 12000 | BalaClass* _tmp305_; |
| 12001 | BalaClass* _tmp306_; |
| 12002 | _tmp305_ = bala_ccode_base_module_get_current_class (self); |
| 12003 | _tmp306_ = _tmp305_; |
| 12004 | _tmp302_ = _tmp306_ != NULL((void*)0); |
| 12005 | } else { |
| 12006 | _tmp302_ = FALSE(0); |
| 12007 | } |
| 12008 | if (_tmp302_) { |
| 12009 | BalaClass* _tmp307_; |
| 12010 | BalaClass* _tmp308_; |
| 12011 | BalaClass* _tmp309_; |
| 12012 | BalaClass* _tmp310_; |
| 12013 | _tmp307_ = bala_ccode_base_module_get_current_class (self); |
| 12014 | _tmp308_ = _tmp307_; |
| 12015 | _tmp309_ = bala_class_get_base_class (_tmp308_); |
| 12016 | _tmp310_ = _tmp309_; |
| 12017 | _tmp301_ = _tmp310_ != NULL((void*)0); |
| 12018 | } else { |
| 12019 | _tmp301_ = FALSE(0); |
| 12020 | } |
| 12021 | in_creation_method_with_chainup = _tmp301_; |
| 12022 | _tmp311_ = bala_ccode_base_module_get_this_type (self); |
| 12023 | this_type = _tmp311_; |
| 12024 | _tmp313_ = this_type; |
| 12025 | if (_tmp313_ != NULL((void*)0)) { |
| 12026 | gboolean _tmp314_ = FALSE(0); |
| 12027 | if (!in_creation_method_with_chainup) { |
| 12028 | _tmp314_ = TRUE(!(0)); |
| 12029 | } else { |
| 12030 | BalaMethod* _tmp315_; |
| 12031 | BalaMethod* _tmp316_; |
| 12032 | BalaBlock* _tmp317_; |
| 12033 | BalaBlock* _tmp318_; |
| 12034 | _tmp315_ = bala_ccode_base_module_get_current_method (self); |
| 12035 | _tmp316_ = _tmp315_; |
| 12036 | _tmp317_ = bala_subroutine_get_body ((BalaSubroutine*) _tmp316_); |
| 12037 | _tmp318_ = _tmp317_; |
| 12038 | _tmp314_ = _tmp318_ != b; |
| 12039 | } |
| 12040 | _tmp312_ = _tmp314_; |
| 12041 | } else { |
| 12042 | _tmp312_ = FALSE(0); |
| 12043 | } |
| 12044 | if (_tmp312_) { |
| 12045 | BalaCCodeFunctionCall* ref_call = NULL((void*)0); |
| 12046 | BalaDataType* _tmp319_; |
| 12047 | BalaSourceReference* _tmp320_; |
| 12048 | BalaSourceReference* _tmp321_; |
| 12049 | BalaCCodeExpression* _tmp322_; |
| 12050 | BalaCCodeExpression* _tmp323_; |
| 12051 | BalaCCodeFunctionCall* _tmp324_; |
| 12052 | BalaCCodeFunctionCall* _tmp325_; |
| 12053 | BalaCCodeFunctionCall* _tmp326_; |
| 12054 | BalaCCodeExpression* _tmp327_; |
| 12055 | BalaCCodeExpression* _tmp328_; |
| 12056 | BalaCCodeExpression* _tmp329_ = NULL((void*)0); |
| 12057 | BalaCCodeExpression* instance = NULL((void*)0); |
| 12058 | BalaCCodeExpression* _tmp333_; |
| 12059 | BalaCCodeFunction* _tmp334_; |
| 12060 | BalaCCodeFunction* _tmp335_; |
| 12061 | gchar* _tmp336_; |
| 12062 | gchar* _tmp337_; |
| 12063 | BalaCCodeExpression* _tmp338_; |
| 12064 | BalaCCodeExpression* _tmp339_; |
| 12065 | BalaCCodeMemberAccess* _tmp340_; |
| 12066 | BalaCCodeMemberAccess* _tmp341_; |
| 12067 | BalaCCodeExpression* _tmp342_; |
| 12068 | _tmp319_ = this_type; |
| 12069 | _tmp320_ = bala_code_node_get_source_reference ((BalaCodeNode*) b); |
| 12070 | _tmp321_ = _tmp320_; |
| 12071 | _tmp322_ = bala_ccode_base_module_get_dup_func_expression (self, _tmp319_, _tmp321_, FALSE(0)); |
| 12072 | _tmp323_ = _tmp322_; |
| 12073 | _tmp324_ = bala_ccode_function_call_new (_tmp323_); |
| 12074 | _tmp325_ = _tmp324_; |
| 12075 | _bala_ccode_node_unref0 (_tmp323_)((_tmp323_ == ((void*)0)) ? ((void*)0) : (_tmp323_ = (bala_ccode_node_unref (_tmp323_), ((void*)0)))); |
| 12076 | ref_call = _tmp325_; |
| 12077 | _tmp326_ = ref_call; |
| 12078 | _tmp327_ = bala_ccode_base_module_get_this_cexpression (self); |
| 12079 | _tmp328_ = _tmp327_; |
| 12080 | bala_ccode_function_call_add_argument (_tmp326_, _tmp328_); |
| 12081 | _bala_ccode_node_unref0 (_tmp328_)((_tmp328_ == ((void*)0)) ? ((void*)0) : (_tmp328_ = (bala_ccode_node_unref (_tmp328_), ((void*)0)))); |
| 12082 | if (bala_ccode_base_module_is_in_destructor (self)) { |
| 12083 | BalaCCodeIdentifier* _tmp330_; |
| 12084 | _tmp330_ = bala_ccode_identifier_new ("self"); |
| 12085 | _bala_ccode_node_unref0 (_tmp329_)((_tmp329_ == ((void*)0)) ? ((void*)0) : (_tmp329_ = (bala_ccode_node_unref (_tmp329_), ((void*)0)))); |
| 12086 | _tmp329_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp330_, BALA_TYPE_CCODE_EXPRESSION, BalaCCodeExpression)(((BalaCCodeExpression*) g_type_check_instance_cast ((GTypeInstance *) (_tmp330_), ((bala_ccode_expression_get_type ()))))); |
| 12087 | } else { |
| 12088 | BalaCCodeFunctionCall* _tmp331_; |
| 12089 | BalaCCodeExpression* _tmp332_; |
| 12090 | _tmp331_ = ref_call; |
| 12091 | _tmp332_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp331_, BALA_TYPE_CCODE_EXPRESSION, BalaCCodeExpression)(((BalaCCodeExpression*) g_type_check_instance_cast ((GTypeInstance *) (_tmp331_), ((bala_ccode_expression_get_type ())))))); |
| 12092 | _bala_ccode_node_unref0 (_tmp329_)((_tmp329_ == ((void*)0)) ? ((void*)0) : (_tmp329_ = (bala_ccode_node_unref (_tmp329_), ((void*)0)))); |
| 12093 | _tmp329_ = _tmp332_; |
| 12094 | } |
| 12095 | _tmp333_ = _bala_ccode_node_ref0 (_tmp329_); |
| 12096 | instance = _tmp333_; |
| 12097 | _tmp334_ = bala_ccode_base_module_get_ccode (self); |
| 12098 | _tmp335_ = _tmp334_; |
| 12099 | _tmp336_ = g_strdup_printf ("_data%d_", block_id); |
| 12100 | _tmp337_ = _tmp336_; |
| 12101 | _tmp338_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp337_); |
| 12102 | _tmp339_ = _tmp338_; |
| 12103 | _tmp340_ = bala_ccode_member_access_new_pointer (_tmp339_, "self"); |
| 12104 | _tmp341_ = _tmp340_; |
| 12105 | _tmp342_ = instance; |
| 12106 | bala_ccode_function_add_assignment (_tmp335_, (BalaCCodeExpression*) _tmp341_, _tmp342_); |
| 12107 | _bala_ccode_node_unref0 (_tmp341_)((_tmp341_ == ((void*)0)) ? ((void*)0) : (_tmp341_ = (bala_ccode_node_unref (_tmp341_), ((void*)0)))); |
| 12108 | _bala_ccode_node_unref0 (_tmp339_)((_tmp339_ == ((void*)0)) ? ((void*)0) : (_tmp339_ = (bala_ccode_node_unref (_tmp339_), ((void*)0)))); |
| 12109 | _g_free0 (_tmp337_)(_tmp337_ = (g_free (_tmp337_), ((void*)0))); |
| 12110 | _bala_ccode_node_unref0 (instance)((instance == ((void*)0)) ? ((void*)0) : (instance = (bala_ccode_node_unref (instance), ((void*)0)))); |
| 12111 | _bala_ccode_node_unref0 (_tmp329_)((_tmp329_ == ((void*)0)) ? ((void*)0) : (_tmp329_ = (bala_ccode_node_unref (_tmp329_), ((void*)0)))); |
| 12112 | _bala_ccode_node_unref0 (ref_call)((ref_call == ((void*)0)) ? ((void*)0) : (ref_call = (bala_ccode_node_unref (ref_call), ((void*)0)))); |
| 12113 | } |
| 12114 | _tmp343_ = bala_ccode_base_module_get_current_method (self); |
| 12115 | _tmp344_ = _tmp343_; |
| 12116 | if (_tmp344_ != NULL((void*)0)) { |
| 12117 | gchar** suffices = NULL((void*)0); |
| 12118 | gchar* _tmp345_; |
| 12119 | gchar* _tmp346_; |
| 12120 | gchar* _tmp347_; |
| 12121 | gchar** _tmp348_; |
| 12122 | gint suffices_length1; |
| 12123 | gint _suffices_size_; |
| 12124 | _tmp345_ = g_strdup ("type"); |
| 12125 | _tmp346_ = g_strdup ("dup_func"); |
| 12126 | _tmp347_ = g_strdup ("destroy_func"); |
| 12127 | _tmp348_ = g_new0 (gchar*, 3 + 1)((gchar* *) g_malloc0_n ((3 + 1), sizeof (gchar*))); |
| 12128 | _tmp348_[0] = _tmp345_; |
| 12129 | _tmp348_[1] = _tmp346_; |
| 12130 | _tmp348_[2] = _tmp347_; |
| 12131 | suffices = _tmp348_; |
| 12132 | suffices_length1 = 3; |
| 12133 | _suffices_size_ = suffices_length1; |
| 12134 | { |
| 12135 | BalaList* _type_param_list = NULL((void*)0); |
| 12136 | BalaMethod* _tmp349_; |
| 12137 | BalaMethod* _tmp350_; |
| 12138 | BalaList* _tmp351_; |
| 12139 | BalaList* _tmp352_; |
| 12140 | gint _type_param_size = 0; |
| 12141 | BalaList* _tmp353_; |
| 12142 | gint _tmp354_; |
| 12143 | gint _tmp355_; |
| 12144 | gint _type_param_index = 0; |
| 12145 | _tmp349_ = bala_ccode_base_module_get_current_method (self); |
| 12146 | _tmp350_ = _tmp349_; |
| 12147 | _tmp351_ = bala_method_get_type_parameters (_tmp350_); |
| 12148 | _tmp352_ = _bala_iterable_ref0 (_tmp351_); |
| 12149 | _type_param_list = _tmp352_; |
| 12150 | _tmp353_ = _type_param_list; |
| 12151 | _tmp354_ = bala_collection_get_size ((BalaCollection*) _tmp353_); |
| 12152 | _tmp355_ = _tmp354_; |
| 12153 | _type_param_size = _tmp355_; |
| 12154 | _type_param_index = -1; |
| 12155 | while (TRUE(!(0))) { |
| 12156 | gint _tmp356_; |
| 12157 | gint _tmp357_; |
| 12158 | BalaTypeParameter* type_param = NULL((void*)0); |
| 12159 | BalaList* _tmp358_; |
| 12160 | gpointer _tmp359_; |
| 12161 | gchar** _tmp360_; |
| 12162 | gint _tmp360__length1; |
| 12163 | _type_param_index = _type_param_index + 1; |
| 12164 | _tmp356_ = _type_param_index; |
| 12165 | _tmp357_ = _type_param_size; |
| 12166 | if (!(_tmp356_ < _tmp357_)) { |
| 12167 | break; |
| 12168 | } |
| 12169 | _tmp358_ = _type_param_list; |
| 12170 | _tmp359_ = bala_list_get (_tmp358_, _type_param_index); |
| 12171 | type_param = (BalaTypeParameter*) _tmp359_; |
| 12172 | _tmp360_ = suffices; |
| 12173 | _tmp360__length1 = suffices_length1; |
| 12174 | { |
| 12175 | gchar** suffix_collection = NULL((void*)0); |
| 12176 | gint suffix_collection_length1 = 0; |
| 12177 | gint _suffix_collection_size_ = 0; |
| 12178 | gint suffix_it = 0; |
| 12179 | suffix_collection = _tmp360_; |
| 12180 | suffix_collection_length1 = _tmp360__length1; |
| 12181 | for (suffix_it = 0; suffix_it < suffix_collection_length1; suffix_it = suffix_it + 1) { |
| 12182 | gchar* _tmp361_; |
| 12183 | gchar* suffix = NULL((void*)0); |
| 12184 | _tmp361_ = g_strdup (suffix_collection[suffix_it]); |
| 12185 | suffix = _tmp361_; |
| 12186 | { |
| 12187 | gchar* func_name = NULL((void*)0); |
| 12188 | BalaTypeParameter* _tmp362_; |
| 12189 | const gchar* _tmp363_; |
| 12190 | const gchar* _tmp364_; |
| 12191 | gchar* _tmp365_; |
| 12192 | gchar* _tmp366_; |
| 12193 | const gchar* _tmp367_; |
| 12194 | gchar* _tmp368_; |
| 12195 | gchar* _tmp369_; |
| 12196 | BalaCCodeFunction* _tmp370_; |
| 12197 | BalaCCodeFunction* _tmp371_; |
| 12198 | gchar* _tmp372_; |
| 12199 | gchar* _tmp373_; |
| 12200 | BalaCCodeExpression* _tmp374_; |
| 12201 | BalaCCodeExpression* _tmp375_; |
| 12202 | const gchar* _tmp376_; |
| 12203 | BalaCCodeMemberAccess* _tmp377_; |
| 12204 | BalaCCodeMemberAccess* _tmp378_; |
| 12205 | const gchar* _tmp379_; |
| 12206 | BalaCCodeExpression* _tmp380_; |
| 12207 | BalaCCodeExpression* _tmp381_; |
| 12208 | _tmp362_ = type_param; |
| 12209 | _tmp363_ = bala_symbol_get_name ((BalaSymbol*) _tmp362_); |
| 12210 | _tmp364_ = _tmp363_; |
| 12211 | _tmp365_ = g_ascii_strdown (_tmp364_, (gssize) -1); |
| 12212 | _tmp366_ = _tmp365_; |
| 12213 | _tmp367_ = suffix; |
| 12214 | _tmp368_ = g_strdup_printf ("%s_%s", _tmp366_, _tmp367_); |
| 12215 | _tmp369_ = _tmp368_; |
| 12216 | _g_free0 (_tmp366_)(_tmp366_ = (g_free (_tmp366_), ((void*)0))); |
| 12217 | func_name = _tmp369_; |
| 12218 | _tmp370_ = bala_ccode_base_module_get_ccode (self); |
| 12219 | _tmp371_ = _tmp370_; |
| 12220 | _tmp372_ = g_strdup_printf ("_data%d_", block_id); |
| 12221 | _tmp373_ = _tmp372_; |
| 12222 | _tmp374_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp373_); |
| 12223 | _tmp375_ = _tmp374_; |
| 12224 | _tmp376_ = func_name; |
| 12225 | _tmp377_ = bala_ccode_member_access_new_pointer (_tmp375_, _tmp376_); |
| 12226 | _tmp378_ = _tmp377_; |
| 12227 | _tmp379_ = func_name; |
| 12228 | _tmp380_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp379_); |
| 12229 | _tmp381_ = _tmp380_; |
| 12230 | bala_ccode_function_add_assignment (_tmp371_, (BalaCCodeExpression*) _tmp378_, _tmp381_); |
| 12231 | _bala_ccode_node_unref0 (_tmp381_)((_tmp381_ == ((void*)0)) ? ((void*)0) : (_tmp381_ = (bala_ccode_node_unref (_tmp381_), ((void*)0)))); |
| 12232 | _bala_ccode_node_unref0 (_tmp378_)((_tmp378_ == ((void*)0)) ? ((void*)0) : (_tmp378_ = (bala_ccode_node_unref (_tmp378_), ((void*)0)))); |
| 12233 | _bala_ccode_node_unref0 (_tmp375_)((_tmp375_ == ((void*)0)) ? ((void*)0) : (_tmp375_ = (bala_ccode_node_unref (_tmp375_), ((void*)0)))); |
| 12234 | _g_free0 (_tmp373_)(_tmp373_ = (g_free (_tmp373_), ((void*)0))); |
| 12235 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 12236 | _g_free0 (suffix)(suffix = (g_free (suffix), ((void*)0))); |
| 12237 | } |
| 12238 | } |
| 12239 | } |
| 12240 | _bala_code_node_unref0 (type_param)((type_param == ((void*)0)) ? ((void*)0) : (type_param = (bala_code_node_unref (type_param), ((void*)0)))); |
| 12241 | } |
| 12242 | _bala_iterable_unref0 (_type_param_list)((_type_param_list == ((void*)0)) ? ((void*)0) : (_type_param_list = (bala_iterable_unref (_type_param_list), ((void*)0)))); |
| 12243 | } |
| 12244 | suffices = (_bala_array_free (suffices, suffices_length1, (GDestroyNotify) g_free), NULL((void*)0)); |
| 12245 | } |
| 12246 | } |
| 12247 | _tmp382_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 12248 | _tmp383_ = _tmp382_; |
| 12249 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp383_, BALA_TYPE_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp383_); GType __t = ((bala_method_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 12250 | BalaMethod* m = NULL((void*)0); |
| 12251 | BalaSymbol* _tmp384_; |
| 12252 | BalaSymbol* _tmp385_; |
| 12253 | BalaMethod* _tmp386_; |
| 12254 | BalaMethod* _tmp421_; |
| 12255 | gboolean _tmp422_; |
| 12256 | gboolean _tmp423_; |
| 12257 | _tmp384_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 12258 | _tmp385_ = _tmp384_; |
| 12259 | _tmp386_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp385_, BALA_TYPE_METHOD, BalaMethod)(((BalaMethod*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp385_), ((bala_method_get_type ())))))); |
| 12260 | m = _tmp386_; |
| 12261 | { |
| 12262 | BalaList* _param_list = NULL((void*)0); |
| 12263 | BalaMethod* _tmp387_; |
| 12264 | BalaList* _tmp388_; |
| 12265 | BalaList* _tmp389_; |
| 12266 | gint _param_size = 0; |
| 12267 | BalaList* _tmp390_; |
| 12268 | gint _tmp391_; |
| 12269 | gint _tmp392_; |
| 12270 | gint _param_index = 0; |
| 12271 | _tmp387_ = m; |
| 12272 | _tmp388_ = bala_callable_get_parameters ((BalaCallable*) _tmp387_); |
| 12273 | _tmp389_ = _bala_iterable_ref0 (_tmp388_); |
| 12274 | _param_list = _tmp389_; |
| 12275 | _tmp390_ = _param_list; |
| 12276 | _tmp391_ = bala_collection_get_size ((BalaCollection*) _tmp390_); |
| 12277 | _tmp392_ = _tmp391_; |
| 12278 | _param_size = _tmp392_; |
| 12279 | _param_index = -1; |
| 12280 | while (TRUE(!(0))) { |
| 12281 | gint _tmp393_; |
| 12282 | gint _tmp394_; |
| 12283 | BalaParameter* param = NULL((void*)0); |
| 12284 | BalaList* _tmp395_; |
| 12285 | gpointer _tmp396_; |
| 12286 | BalaParameter* _tmp397_; |
| 12287 | gboolean _tmp398_; |
| 12288 | gboolean _tmp399_; |
| 12289 | _param_index = _param_index + 1; |
| 12290 | _tmp393_ = _param_index; |
| 12291 | _tmp394_ = _param_size; |
| 12292 | if (!(_tmp393_ < _tmp394_)) { |
| 12293 | break; |
| 12294 | } |
| 12295 | _tmp395_ = _param_list; |
| 12296 | _tmp396_ = bala_list_get (_tmp395_, _param_index); |
| 12297 | param = (BalaParameter*) _tmp396_; |
| 12298 | _tmp397_ = param; |
| 12299 | _tmp398_ = bala_parameter_get_captured (_tmp397_); |
| 12300 | _tmp399_ = _tmp398_; |
| 12301 | if (_tmp399_) { |
| 12302 | BalaParameter* _tmp400_; |
| 12303 | BalaCCodeStruct* _tmp401_; |
| 12304 | BalaParameter* _tmp402_; |
| 12305 | BalaDataType* _tmp403_; |
| 12306 | BalaDataType* _tmp404_; |
| 12307 | BalaTypeSymbol* _tmp405_; |
| 12308 | BalaTypeSymbol* _tmp406_; |
| 12309 | BalaCodeContext* _tmp407_; |
| 12310 | BalaSemanticAnalyzer* _tmp408_; |
| 12311 | BalaSemanticAnalyzer* _tmp409_; |
| 12312 | BalaDataType* _tmp410_; |
| 12313 | BalaTypeSymbol* _tmp411_; |
| 12314 | BalaTypeSymbol* _tmp412_; |
| 12315 | _tmp400_ = param; |
| 12316 | _tmp401_ = data; |
| 12317 | bala_ccode_base_module_capture_parameter (self, _tmp400_, _tmp401_, block_id); |
| 12318 | _tmp402_ = param; |
| 12319 | _tmp403_ = bala_variable_get_variable_type ((BalaVariable*) _tmp402_); |
| 12320 | _tmp404_ = _tmp403_; |
| 12321 | _tmp405_ = bala_data_type_get_type_symbol (_tmp404_); |
| 12322 | _tmp406_ = _tmp405_; |
| 12323 | _tmp407_ = self->priv->_context; |
| 12324 | _tmp408_ = bala_code_context_get_analyzer (_tmp407_); |
| 12325 | _tmp409_ = _tmp408_; |
| 12326 | _tmp410_ = _tmp409_->va_list_type; |
| 12327 | _tmp411_ = bala_data_type_get_type_symbol (_tmp410_); |
| 12328 | _tmp412_ = _tmp411_; |
| 12329 | if (_tmp406_ == _tmp412_) { |
| 12330 | BalaParameter* _tmp413_; |
| 12331 | BalaSourceReference* _tmp414_; |
| 12332 | BalaSourceReference* _tmp415_; |
| 12333 | BalaParameter* _tmp416_; |
| 12334 | gchar* _tmp417_; |
| 12335 | gchar* _tmp418_; |
| 12336 | gchar* _tmp419_; |
| 12337 | gchar* _tmp420_; |
| 12338 | _tmp413_ = param; |
| 12339 | _tmp414_ = bala_code_node_get_source_reference ((BalaCodeNode*) _tmp413_); |
| 12340 | _tmp415_ = _tmp414_; |
| 12341 | _tmp416_ = param; |
| 12342 | _tmp417_ = bala_symbol_get_full_name ((BalaSymbol*) _tmp416_); |
| 12343 | _tmp418_ = _tmp417_; |
| 12344 | _tmp419_ = g_strdup_printf ("internal: Capturing `va_list' parameter `%s' is not allowed", _tmp418_); |
| 12345 | _tmp420_ = _tmp419_; |
| 12346 | bala_report_error (_tmp415_, _tmp420_); |
| 12347 | _g_free0 (_tmp420_)(_tmp420_ = (g_free (_tmp420_), ((void*)0))); |
| 12348 | _g_free0 (_tmp418_)(_tmp418_ = (g_free (_tmp418_), ((void*)0))); |
| 12349 | bala_code_node_set_error ((BalaCodeNode*) b, TRUE(!(0))); |
| 12350 | } |
| 12351 | } |
| 12352 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 12353 | } |
| 12354 | _bala_iterable_unref0 (_param_list)((_param_list == ((void*)0)) ? ((void*)0) : (_param_list = (bala_iterable_unref (_param_list), ((void*)0)))); |
| 12355 | } |
| 12356 | _tmp421_ = m; |
| 12357 | _tmp422_ = bala_method_get_coroutine (_tmp421_); |
| 12358 | _tmp423_ = _tmp422_; |
| 12359 | if (_tmp423_) { |
| 12360 | BalaCCodeStruct* _tmp424_; |
| 12361 | BalaDataType* _tmp425_; |
| 12362 | gchar* _tmp426_; |
| 12363 | gchar* _tmp427_; |
| 12364 | BalaCCodeFunction* _tmp428_; |
| 12365 | BalaCCodeFunction* _tmp429_; |
| 12366 | gchar* _tmp430_; |
| 12367 | gchar* _tmp431_; |
| 12368 | BalaCCodeExpression* _tmp432_; |
| 12369 | BalaCCodeExpression* _tmp433_; |
| 12370 | BalaCCodeMemberAccess* _tmp434_; |
| 12371 | BalaCCodeMemberAccess* _tmp435_; |
| 12372 | BalaCCodeIdentifier* _tmp436_; |
| 12373 | BalaCCodeIdentifier* _tmp437_; |
| 12374 | _tmp424_ = data; |
| 12375 | _tmp425_ = self->pointer_type; |
| 12376 | _tmp426_ = bala_get_ccode_name ((BalaCodeNode*) _tmp425_); |
| 12377 | _tmp427_ = _tmp426_; |
| 12378 | bala_ccode_struct_add_field (_tmp424_, _tmp427_, "_async_data_", 0, NULL((void*)0)); |
| 12379 | _g_free0 (_tmp427_)(_tmp427_ = (g_free (_tmp427_), ((void*)0))); |
| 12380 | _tmp428_ = bala_ccode_base_module_get_ccode (self); |
| 12381 | _tmp429_ = _tmp428_; |
| 12382 | _tmp430_ = g_strdup_printf ("_data%d_", block_id); |
| 12383 | _tmp431_ = _tmp430_; |
| 12384 | _tmp432_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp431_); |
| 12385 | _tmp433_ = _tmp432_; |
| 12386 | _tmp434_ = bala_ccode_member_access_new_pointer (_tmp433_, "_async_data_"); |
| 12387 | _tmp435_ = _tmp434_; |
| 12388 | _tmp436_ = bala_ccode_identifier_new ("_data_"); |
| 12389 | _tmp437_ = _tmp436_; |
| 12390 | bala_ccode_function_add_assignment (_tmp429_, (BalaCCodeExpression*) _tmp435_, (BalaCCodeExpression*) _tmp437_); |
| 12391 | _bala_ccode_node_unref0 (_tmp437_)((_tmp437_ == ((void*)0)) ? ((void*)0) : (_tmp437_ = (bala_ccode_node_unref (_tmp437_), ((void*)0)))); |
| 12392 | _bala_ccode_node_unref0 (_tmp435_)((_tmp435_ == ((void*)0)) ? ((void*)0) : (_tmp435_ = (bala_ccode_node_unref (_tmp435_), ((void*)0)))); |
| 12393 | _bala_ccode_node_unref0 (_tmp433_)((_tmp433_ == ((void*)0)) ? ((void*)0) : (_tmp433_ = (bala_ccode_node_unref (_tmp433_), ((void*)0)))); |
| 12394 | _g_free0 (_tmp431_)(_tmp431_ = (g_free (_tmp431_), ((void*)0))); |
| 12395 | } |
| 12396 | _bala_code_node_unref0 (m)((m == ((void*)0)) ? ((void*)0) : (m = (bala_code_node_unref ( m), ((void*)0)))); |
| 12397 | } else { |
| 12398 | BalaSymbol* _tmp438_; |
| 12399 | BalaSymbol* _tmp439_; |
| 12400 | _tmp438_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 12401 | _tmp439_ = _tmp438_; |
| 12402 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp439_, BALA_TYPE_PROPERTY_ACCESSOR)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp439_); GType __t = ((bala_property_accessor_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 12403 | BalaPropertyAccessor* acc = NULL((void*)0); |
| 12404 | BalaSymbol* _tmp440_; |
| 12405 | BalaSymbol* _tmp441_; |
| 12406 | BalaPropertyAccessor* _tmp442_; |
| 12407 | gboolean _tmp443_ = FALSE(0); |
| 12408 | BalaPropertyAccessor* _tmp444_; |
| 12409 | gboolean _tmp445_; |
| 12410 | gboolean _tmp446_; |
| 12411 | _tmp440_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 12412 | _tmp441_ = _tmp440_; |
| 12413 | _tmp442_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp441_, BALA_TYPE_PROPERTY_ACCESSOR, BalaPropertyAccessor)(((BalaPropertyAccessor*) g_type_check_instance_cast ((GTypeInstance *) (_tmp441_), ((bala_property_accessor_get_type ())))))); |
| 12414 | acc = _tmp442_; |
| 12415 | _tmp444_ = acc; |
| 12416 | _tmp445_ = bala_property_accessor_get_readable (_tmp444_); |
| 12417 | _tmp446_ = _tmp445_; |
| 12418 | if (!_tmp446_) { |
| 12419 | BalaPropertyAccessor* _tmp447_; |
| 12420 | BalaParameter* _tmp448_; |
| 12421 | BalaParameter* _tmp449_; |
| 12422 | gboolean _tmp450_; |
| 12423 | gboolean _tmp451_; |
| 12424 | _tmp447_ = acc; |
| 12425 | _tmp448_ = bala_property_accessor_get_value_parameter (_tmp447_); |
| 12426 | _tmp449_ = _tmp448_; |
| 12427 | _tmp450_ = bala_parameter_get_captured (_tmp449_); |
| 12428 | _tmp451_ = _tmp450_; |
| 12429 | _tmp443_ = _tmp451_; |
| 12430 | } else { |
| 12431 | _tmp443_ = FALSE(0); |
| 12432 | } |
| 12433 | if (_tmp443_) { |
| 12434 | BalaPropertyAccessor* _tmp452_; |
| 12435 | BalaParameter* _tmp453_; |
| 12436 | BalaParameter* _tmp454_; |
| 12437 | BalaCCodeStruct* _tmp455_; |
| 12438 | _tmp452_ = acc; |
| 12439 | _tmp453_ = bala_property_accessor_get_value_parameter (_tmp452_); |
| 12440 | _tmp454_ = _tmp453_; |
| 12441 | _tmp455_ = data; |
| 12442 | bala_ccode_base_module_capture_parameter (self, _tmp454_, _tmp455_, block_id); |
| 12443 | } |
| 12444 | _bala_code_node_unref0 (acc)((acc == ((void*)0)) ? ((void*)0) : (acc = (bala_code_node_unref (acc), ((void*)0)))); |
| 12445 | } else { |
| 12446 | BalaSymbol* _tmp456_; |
| 12447 | BalaSymbol* _tmp457_; |
| 12448 | _tmp456_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 12449 | _tmp457_ = _tmp456_; |
| 12450 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp457_, BALA_TYPE_FOREACH_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp457_); GType __t = ((bala_foreach_statement_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 12451 | BalaForeachStatement* stmt = NULL((void*)0); |
| 12452 | BalaSymbol* _tmp458_; |
| 12453 | BalaSymbol* _tmp459_; |
| 12454 | BalaForeachStatement* _tmp460_; |
| 12455 | gboolean _tmp461_ = FALSE(0); |
| 12456 | BalaForeachStatement* _tmp462_; |
| 12457 | gboolean _tmp463_; |
| 12458 | gboolean _tmp464_; |
| 12459 | _tmp458_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 12460 | _tmp459_ = _tmp458_; |
| 12461 | _tmp460_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp459_, BALA_TYPE_FOREACH_STATEMENT, BalaForeachStatement)(((BalaForeachStatement*) g_type_check_instance_cast ((GTypeInstance *) (_tmp459_), ((bala_foreach_statement_get_type ())))))); |
| 12462 | stmt = _tmp460_; |
| 12463 | _tmp462_ = stmt; |
| 12464 | _tmp463_ = bala_foreach_statement_get_use_iterator (_tmp462_); |
| 12465 | _tmp464_ = _tmp463_; |
| 12466 | if (!_tmp464_) { |
| 12467 | BalaForeachStatement* _tmp465_; |
| 12468 | BalaLocalVariable* _tmp466_; |
| 12469 | BalaLocalVariable* _tmp467_; |
| 12470 | gboolean _tmp468_; |
| 12471 | gboolean _tmp469_; |
| 12472 | _tmp465_ = stmt; |
| 12473 | _tmp466_ = bala_foreach_statement_get_element_variable (_tmp465_); |
| 12474 | _tmp467_ = _tmp466_; |
| 12475 | _tmp468_ = bala_local_variable_get_captured (_tmp467_); |
| 12476 | _tmp469_ = _tmp468_; |
| 12477 | _tmp461_ = _tmp469_; |
| 12478 | } else { |
| 12479 | _tmp461_ = FALSE(0); |
| 12480 | } |
| 12481 | if (_tmp461_) { |
| 12482 | BalaCCodeFunction* _tmp470_; |
| 12483 | BalaCCodeFunction* _tmp471_; |
| 12484 | gchar* _tmp472_; |
| 12485 | gchar* _tmp473_; |
| 12486 | BalaCCodeExpression* _tmp474_; |
| 12487 | BalaCCodeExpression* _tmp475_; |
| 12488 | BalaForeachStatement* _tmp476_; |
| 12489 | BalaLocalVariable* _tmp477_; |
| 12490 | BalaLocalVariable* _tmp478_; |
| 12491 | gchar* _tmp479_; |
| 12492 | gchar* _tmp480_; |
| 12493 | BalaCCodeMemberAccess* _tmp481_; |
| 12494 | BalaCCodeMemberAccess* _tmp482_; |
| 12495 | BalaForeachStatement* _tmp483_; |
| 12496 | BalaLocalVariable* _tmp484_; |
| 12497 | BalaLocalVariable* _tmp485_; |
| 12498 | gchar* _tmp486_; |
| 12499 | gchar* _tmp487_; |
| 12500 | BalaCCodeExpression* _tmp488_; |
| 12501 | BalaCCodeExpression* _tmp489_; |
| 12502 | _tmp470_ = bala_ccode_base_module_get_ccode (self); |
| 12503 | _tmp471_ = _tmp470_; |
| 12504 | _tmp472_ = g_strdup_printf ("_data%d_", block_id); |
| 12505 | _tmp473_ = _tmp472_; |
| 12506 | _tmp474_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp473_); |
| 12507 | _tmp475_ = _tmp474_; |
| 12508 | _tmp476_ = stmt; |
| 12509 | _tmp477_ = bala_foreach_statement_get_element_variable (_tmp476_); |
| 12510 | _tmp478_ = _tmp477_; |
| 12511 | _tmp479_ = bala_ccode_base_module_get_local_cname (self, _tmp478_); |
| 12512 | _tmp480_ = _tmp479_; |
| 12513 | _tmp481_ = bala_ccode_member_access_new_pointer (_tmp475_, _tmp480_); |
| 12514 | _tmp482_ = _tmp481_; |
| 12515 | _tmp483_ = stmt; |
| 12516 | _tmp484_ = bala_foreach_statement_get_element_variable (_tmp483_); |
| 12517 | _tmp485_ = _tmp484_; |
| 12518 | _tmp486_ = bala_ccode_base_module_get_local_cname (self, _tmp485_); |
| 12519 | _tmp487_ = _tmp486_; |
| 12520 | _tmp488_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp487_); |
| 12521 | _tmp489_ = _tmp488_; |
| 12522 | bala_ccode_function_add_assignment (_tmp471_, (BalaCCodeExpression*) _tmp482_, _tmp489_); |
| 12523 | _bala_ccode_node_unref0 (_tmp489_)((_tmp489_ == ((void*)0)) ? ((void*)0) : (_tmp489_ = (bala_ccode_node_unref (_tmp489_), ((void*)0)))); |
| 12524 | _g_free0 (_tmp487_)(_tmp487_ = (g_free (_tmp487_), ((void*)0))); |
| 12525 | _bala_ccode_node_unref0 (_tmp482_)((_tmp482_ == ((void*)0)) ? ((void*)0) : (_tmp482_ = (bala_ccode_node_unref (_tmp482_), ((void*)0)))); |
| 12526 | _g_free0 (_tmp480_)(_tmp480_ = (g_free (_tmp480_), ((void*)0))); |
| 12527 | _bala_ccode_node_unref0 (_tmp475_)((_tmp475_ == ((void*)0)) ? ((void*)0) : (_tmp475_ = (bala_ccode_node_unref (_tmp475_), ((void*)0)))); |
| 12528 | _g_free0 (_tmp473_)(_tmp473_ = (g_free (_tmp473_), ((void*)0))); |
| 12529 | } |
| 12530 | _bala_code_node_unref0 (stmt)((stmt == ((void*)0)) ? ((void*)0) : (stmt = (bala_code_node_unref (stmt), ((void*)0)))); |
| 12531 | } |
| 12532 | } |
| 12533 | } |
| 12534 | _tmp490_ = struct_name; |
| 12535 | _tmp491_ = g_strconcat ("struct _", _tmp490_, NULL((void*)0)); |
| 12536 | _tmp492_ = _tmp491_; |
| 12537 | _tmp493_ = struct_name; |
| 12538 | _tmp494_ = bala_ccode_variable_declarator_new (_tmp493_, NULL((void*)0), NULL((void*)0)); |
| 12539 | _tmp495_ = _tmp494_; |
| 12540 | _tmp496_ = bala_ccode_type_definition_new (_tmp492_, (BalaCCodeDeclarator*) _tmp495_); |
| 12541 | _tmp497_ = _tmp496_; |
| 12542 | _bala_ccode_node_unref0 (_tmp495_)((_tmp495_ == ((void*)0)) ? ((void*)0) : (_tmp495_ = (bala_ccode_node_unref (_tmp495_), ((void*)0)))); |
| 12543 | _g_free0 (_tmp492_)(_tmp492_ = (g_free (_tmp492_), ((void*)0))); |
| 12544 | _typedef_ = _tmp497_; |
| 12545 | _tmp498_ = self->cfile; |
| 12546 | _tmp499_ = _typedef_; |
| 12547 | bala_ccode_file_add_type_declaration (_tmp498_, (BalaCCodeNode*) _tmp499_); |
| 12548 | _tmp500_ = self->cfile; |
| 12549 | _tmp501_ = data; |
| 12550 | bala_ccode_file_add_type_definition (_tmp500_, (BalaCCodeNode*) _tmp501_); |
| 12551 | _tmp502_ = g_strdup_printf ("block%d_data_ref", block_id); |
| 12552 | _tmp503_ = _tmp502_; |
| 12553 | _tmp504_ = struct_name; |
| 12554 | _tmp505_ = g_strconcat (_tmp504_, "*", NULL((void*)0)); |
| 12555 | _tmp506_ = _tmp505_; |
| 12556 | _tmp507_ = bala_ccode_function_new (_tmp503_, _tmp506_); |
| 12557 | _tmp508_ = _tmp507_; |
| 12558 | _g_free0 (_tmp506_)(_tmp506_ = (g_free (_tmp506_), ((void*)0))); |
| 12559 | _g_free0 (_tmp503_)(_tmp503_ = (g_free (_tmp503_), ((void*)0))); |
| 12560 | ref_fun = _tmp508_; |
| 12561 | _tmp509_ = ref_fun; |
| 12562 | _tmp510_ = g_strdup_printf ("_data%d_", block_id); |
| 12563 | _tmp511_ = _tmp510_; |
| 12564 | _tmp512_ = struct_name; |
| 12565 | _tmp513_ = g_strconcat (_tmp512_, "*", NULL((void*)0)); |
| 12566 | _tmp514_ = _tmp513_; |
| 12567 | _tmp515_ = bala_ccode_parameter_new (_tmp511_, _tmp514_); |
| 12568 | _tmp516_ = _tmp515_; |
| 12569 | bala_ccode_function_add_parameter (_tmp509_, _tmp516_); |
| 12570 | _bala_ccode_node_unref0 (_tmp516_)((_tmp516_ == ((void*)0)) ? ((void*)0) : (_tmp516_ = (bala_ccode_node_unref (_tmp516_), ((void*)0)))); |
| 12571 | _g_free0 (_tmp514_)(_tmp514_ = (g_free (_tmp514_), ((void*)0))); |
| 12572 | _g_free0 (_tmp511_)(_tmp511_ = (g_free (_tmp511_), ((void*)0))); |
| 12573 | _tmp517_ = ref_fun; |
| 12574 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp517_, BALA_CCODE_MODIFIERS_STATIC); |
| 12575 | _tmp518_ = ref_fun; |
| 12576 | bala_ccode_base_module_push_function (self, _tmp518_); |
| 12577 | _tmp519_ = bala_ccode_identifier_new ("g_atomic_int_inc"); |
| 12578 | _tmp520_ = _tmp519_; |
| 12579 | _tmp521_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp520_); |
| 12580 | _tmp522_ = _tmp521_; |
| 12581 | _bala_ccode_node_unref0 (_tmp520_)((_tmp520_ == ((void*)0)) ? ((void*)0) : (_tmp520_ = (bala_ccode_node_unref (_tmp520_), ((void*)0)))); |
| 12582 | ccall = _tmp522_; |
| 12583 | _tmp523_ = ccall; |
| 12584 | _tmp524_ = g_strdup_printf ("_data%d_", block_id); |
| 12585 | _tmp525_ = _tmp524_; |
| 12586 | _tmp526_ = bala_ccode_identifier_new (_tmp525_); |
| 12587 | _tmp527_ = _tmp526_; |
| 12588 | _tmp528_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp527_, "_ref_count_"); |
| 12589 | _tmp529_ = _tmp528_; |
| 12590 | _tmp530_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, (BalaCCodeExpression*) _tmp529_); |
| 12591 | _tmp531_ = _tmp530_; |
| 12592 | bala_ccode_function_call_add_argument (_tmp523_, (BalaCCodeExpression*) _tmp531_); |
| 12593 | _bala_ccode_node_unref0 (_tmp531_)((_tmp531_ == ((void*)0)) ? ((void*)0) : (_tmp531_ = (bala_ccode_node_unref (_tmp531_), ((void*)0)))); |
| 12594 | _bala_ccode_node_unref0 (_tmp529_)((_tmp529_ == ((void*)0)) ? ((void*)0) : (_tmp529_ = (bala_ccode_node_unref (_tmp529_), ((void*)0)))); |
| 12595 | _bala_ccode_node_unref0 (_tmp527_)((_tmp527_ == ((void*)0)) ? ((void*)0) : (_tmp527_ = (bala_ccode_node_unref (_tmp527_), ((void*)0)))); |
| 12596 | _g_free0 (_tmp525_)(_tmp525_ = (g_free (_tmp525_), ((void*)0))); |
| 12597 | _tmp532_ = bala_ccode_base_module_get_ccode (self); |
| 12598 | _tmp533_ = _tmp532_; |
| 12599 | _tmp534_ = ccall; |
| 12600 | bala_ccode_function_add_expression (_tmp533_, (BalaCCodeExpression*) _tmp534_); |
| 12601 | _tmp535_ = bala_ccode_base_module_get_ccode (self); |
| 12602 | _tmp536_ = _tmp535_; |
| 12603 | _tmp537_ = g_strdup_printf ("_data%d_", block_id); |
| 12604 | _tmp538_ = _tmp537_; |
| 12605 | _tmp539_ = bala_ccode_identifier_new (_tmp538_); |
| 12606 | _tmp540_ = _tmp539_; |
| 12607 | bala_ccode_function_add_return (_tmp536_, (BalaCCodeExpression*) _tmp540_); |
| 12608 | _bala_ccode_node_unref0 (_tmp540_)((_tmp540_ == ((void*)0)) ? ((void*)0) : (_tmp540_ = (bala_ccode_node_unref (_tmp540_), ((void*)0)))); |
| 12609 | _g_free0 (_tmp538_)(_tmp538_ = (g_free (_tmp538_), ((void*)0))); |
| 12610 | bala_ccode_base_module_pop_function (self); |
| 12611 | _tmp541_ = self->cfile; |
| 12612 | _tmp542_ = ref_fun; |
| 12613 | bala_ccode_file_add_function_declaration (_tmp541_, _tmp542_); |
| 12614 | _tmp543_ = self->cfile; |
| 12615 | _tmp544_ = ref_fun; |
| 12616 | bala_ccode_file_add_function (_tmp543_, _tmp544_); |
| 12617 | _tmp545_ = g_strdup_printf ("block%d_data_unref", block_id); |
| 12618 | _tmp546_ = _tmp545_; |
| 12619 | _tmp547_ = bala_ccode_function_new (_tmp546_, "void"); |
| 12620 | _tmp548_ = _tmp547_; |
| 12621 | _g_free0 (_tmp546_)(_tmp546_ = (g_free (_tmp546_), ((void*)0))); |
| 12622 | unref_fun = _tmp548_; |
| 12623 | _tmp549_ = unref_fun; |
| 12624 | _tmp550_ = bala_ccode_parameter_new ("_userdata_", "void *"); |
| 12625 | _tmp551_ = _tmp550_; |
| 12626 | bala_ccode_function_add_parameter (_tmp549_, _tmp551_); |
| 12627 | _bala_ccode_node_unref0 (_tmp551_)((_tmp551_ == ((void*)0)) ? ((void*)0) : (_tmp551_ = (bala_ccode_node_unref (_tmp551_), ((void*)0)))); |
| 12628 | _tmp552_ = unref_fun; |
| 12629 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp552_, BALA_CCODE_MODIFIERS_STATIC); |
| 12630 | _tmp553_ = unref_fun; |
| 12631 | bala_ccode_base_module_push_function (self, _tmp553_); |
| 12632 | _tmp554_ = bala_ccode_base_module_get_ccode (self); |
| 12633 | _tmp555_ = _tmp554_; |
| 12634 | _tmp556_ = struct_name; |
| 12635 | _tmp557_ = g_strconcat (_tmp556_, "*", NULL((void*)0)); |
| 12636 | _tmp558_ = _tmp557_; |
| 12637 | _tmp559_ = g_strdup_printf ("_data%d_", block_id); |
| 12638 | _tmp560_ = _tmp559_; |
| 12639 | _tmp561_ = bala_ccode_identifier_new ("_userdata_"); |
| 12640 | _tmp562_ = _tmp561_; |
| 12641 | _tmp563_ = struct_name; |
| 12642 | _tmp564_ = g_strconcat (_tmp563_, "*", NULL((void*)0)); |
| 12643 | _tmp565_ = _tmp564_; |
| 12644 | _tmp566_ = bala_ccode_cast_expression_new ((BalaCCodeExpression*) _tmp562_, _tmp565_); |
| 12645 | _tmp567_ = _tmp566_; |
| 12646 | _tmp568_ = bala_ccode_variable_declarator_new (_tmp560_, (BalaCCodeExpression*) _tmp567_, NULL((void*)0)); |
| 12647 | _tmp569_ = _tmp568_; |
| 12648 | bala_ccode_function_add_declaration (_tmp555_, _tmp558_, (BalaCCodeDeclarator*) _tmp569_, 0); |
| 12649 | _bala_ccode_node_unref0 (_tmp569_)((_tmp569_ == ((void*)0)) ? ((void*)0) : (_tmp569_ = (bala_ccode_node_unref (_tmp569_), ((void*)0)))); |
| 12650 | _bala_ccode_node_unref0 (_tmp567_)((_tmp567_ == ((void*)0)) ? ((void*)0) : (_tmp567_ = (bala_ccode_node_unref (_tmp567_), ((void*)0)))); |
| 12651 | _g_free0 (_tmp565_)(_tmp565_ = (g_free (_tmp565_), ((void*)0))); |
| 12652 | _bala_ccode_node_unref0 (_tmp562_)((_tmp562_ == ((void*)0)) ? ((void*)0) : (_tmp562_ = (bala_ccode_node_unref (_tmp562_), ((void*)0)))); |
| 12653 | _g_free0 (_tmp560_)(_tmp560_ = (g_free (_tmp560_), ((void*)0))); |
| 12654 | _g_free0 (_tmp558_)(_tmp558_ = (g_free (_tmp558_), ((void*)0))); |
| 12655 | _tmp570_ = bala_ccode_identifier_new ("g_atomic_int_dec_and_test"); |
| 12656 | _tmp571_ = _tmp570_; |
| 12657 | _tmp572_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp571_); |
| 12658 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 12659 | ccall = _tmp572_; |
| 12660 | _bala_ccode_node_unref0 (_tmp571_)((_tmp571_ == ((void*)0)) ? ((void*)0) : (_tmp571_ = (bala_ccode_node_unref (_tmp571_), ((void*)0)))); |
| 12661 | _tmp573_ = ccall; |
| 12662 | _tmp574_ = g_strdup_printf ("_data%d_", block_id); |
| 12663 | _tmp575_ = _tmp574_; |
| 12664 | _tmp576_ = bala_ccode_identifier_new (_tmp575_); |
| 12665 | _tmp577_ = _tmp576_; |
| 12666 | _tmp578_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp577_, "_ref_count_"); |
| 12667 | _tmp579_ = _tmp578_; |
| 12668 | _tmp580_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, (BalaCCodeExpression*) _tmp579_); |
| 12669 | _tmp581_ = _tmp580_; |
| 12670 | bala_ccode_function_call_add_argument (_tmp573_, (BalaCCodeExpression*) _tmp581_); |
| 12671 | _bala_ccode_node_unref0 (_tmp581_)((_tmp581_ == ((void*)0)) ? ((void*)0) : (_tmp581_ = (bala_ccode_node_unref (_tmp581_), ((void*)0)))); |
| 12672 | _bala_ccode_node_unref0 (_tmp579_)((_tmp579_ == ((void*)0)) ? ((void*)0) : (_tmp579_ = (bala_ccode_node_unref (_tmp579_), ((void*)0)))); |
| 12673 | _bala_ccode_node_unref0 (_tmp577_)((_tmp577_ == ((void*)0)) ? ((void*)0) : (_tmp577_ = (bala_ccode_node_unref (_tmp577_), ((void*)0)))); |
| 12674 | _g_free0 (_tmp575_)(_tmp575_ = (g_free (_tmp575_), ((void*)0))); |
| 12675 | _tmp582_ = bala_ccode_base_module_get_ccode (self); |
| 12676 | _tmp583_ = _tmp582_; |
| 12677 | _tmp584_ = ccall; |
| 12678 | bala_ccode_function_open_if (_tmp583_, (BalaCCodeExpression*) _tmp584_); |
| 12679 | _tmp585_ = g_strdup_printf ("_data%d_", block_id); |
| 12680 | _tmp586_ = _tmp585_; |
| 12681 | _tmp587_ = bala_ccode_identifier_new (_tmp586_); |
| 12682 | _tmp588_ = (BalaCCodeExpression*) _tmp587_; |
| 12683 | _g_free0 (_tmp586_)(_tmp586_ = (g_free (_tmp586_), ((void*)0))); |
| 12684 | outer_block = _tmp588_; |
| 12685 | parent_closure_block = b; |
| 12686 | while (TRUE(!(0))) { |
| 12687 | BalaBlock* _tmp589_; |
| 12688 | BalaSymbol* _tmp590_; |
| 12689 | BalaSymbol* _tmp591_; |
| 12690 | BalaBlock* _tmp592_; |
| 12691 | BalaBlock* _tmp593_; |
| 12692 | gint parent_block_id = 0; |
| 12693 | BalaBlock* _tmp594_; |
| 12694 | BalaCCodeExpression* _tmp595_; |
| 12695 | gchar* _tmp596_; |
| 12696 | gchar* _tmp597_; |
| 12697 | BalaCCodeMemberAccess* _tmp598_; |
| 12698 | _tmp589_ = parent_closure_block; |
| 12699 | _tmp590_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp589_); |
| 12700 | _tmp591_ = _tmp590_; |
| 12701 | _tmp592_ = bala_ccode_base_module_next_closure_block (self, _tmp591_); |
| 12702 | parent_closure_block = _tmp592_; |
| 12703 | _tmp593_ = parent_closure_block; |
| 12704 | if (_tmp593_ == NULL((void*)0)) { |
| 12705 | break; |
| 12706 | } |
| 12707 | _tmp594_ = parent_closure_block; |
| 12708 | parent_block_id = bala_ccode_base_module_get_block_id (self, _tmp594_); |
| 12709 | _tmp595_ = outer_block; |
| 12710 | _tmp596_ = g_strdup_printf ("_data%d_", parent_block_id); |
| 12711 | _tmp597_ = _tmp596_; |
| 12712 | _tmp598_ = bala_ccode_member_access_new_pointer (_tmp595_, _tmp597_); |
| 12713 | _bala_ccode_node_unref0 (outer_block)((outer_block == ((void*)0)) ? ((void*)0) : (outer_block = (bala_ccode_node_unref (outer_block), ((void*)0)))); |
| 12714 | outer_block = (BalaCCodeExpression*) _tmp598_; |
| 12715 | _g_free0 (_tmp597_)(_tmp597_ = (g_free (_tmp597_), ((void*)0))); |
| 12716 | } |
| 12717 | _tmp599_ = bala_ccode_base_module_get_this_type (self); |
| 12718 | _tmp600_ = _bala_code_node_ref0 (_tmp599_); |
| 12719 | this_type = _tmp600_; |
| 12720 | _tmp601_ = this_type; |
| 12721 | if (_tmp601_ != NULL((void*)0)) { |
| 12722 | BalaCCodeFunction* _tmp602_; |
| 12723 | BalaCCodeFunction* _tmp603_; |
| 12724 | BalaDataType* _tmp604_; |
| 12725 | gchar* _tmp605_; |
| 12726 | gchar* _tmp606_; |
| 12727 | BalaCCodeVariableDeclarator* _tmp607_; |
| 12728 | BalaCCodeVariableDeclarator* _tmp608_; |
| 12729 | BalaCCodeFunction* _tmp609_; |
| 12730 | BalaCCodeFunction* _tmp610_; |
| 12731 | BalaCCodeIdentifier* _tmp611_; |
| 12732 | BalaCCodeIdentifier* _tmp612_; |
| 12733 | BalaCCodeExpression* _tmp613_; |
| 12734 | BalaCCodeMemberAccess* _tmp614_; |
| 12735 | BalaCCodeMemberAccess* _tmp615_; |
| 12736 | _tmp602_ = bala_ccode_base_module_get_ccode (self); |
| 12737 | _tmp603_ = _tmp602_; |
| 12738 | _tmp604_ = this_type; |
| 12739 | _tmp605_ = bala_get_ccode_name ((BalaCodeNode*) _tmp604_); |
| 12740 | _tmp606_ = _tmp605_; |
| 12741 | _tmp607_ = bala_ccode_variable_declarator_new ("self", NULL((void*)0), NULL((void*)0)); |
| 12742 | _tmp608_ = _tmp607_; |
| 12743 | bala_ccode_function_add_declaration (_tmp603_, _tmp606_, (BalaCCodeDeclarator*) _tmp608_, 0); |
| 12744 | _bala_ccode_node_unref0 (_tmp608_)((_tmp608_ == ((void*)0)) ? ((void*)0) : (_tmp608_ = (bala_ccode_node_unref (_tmp608_), ((void*)0)))); |
| 12745 | _g_free0 (_tmp606_)(_tmp606_ = (g_free (_tmp606_), ((void*)0))); |
| 12746 | _tmp609_ = bala_ccode_base_module_get_ccode (self); |
| 12747 | _tmp610_ = _tmp609_; |
| 12748 | _tmp611_ = bala_ccode_identifier_new ("self"); |
| 12749 | _tmp612_ = _tmp611_; |
| 12750 | _tmp613_ = outer_block; |
| 12751 | _tmp614_ = bala_ccode_member_access_new_pointer (_tmp613_, "self"); |
| 12752 | _tmp615_ = _tmp614_; |
| 12753 | bala_ccode_function_add_assignment (_tmp610_, (BalaCCodeExpression*) _tmp612_, (BalaCCodeExpression*) _tmp615_); |
| 12754 | _bala_ccode_node_unref0 (_tmp615_)((_tmp615_ == ((void*)0)) ? ((void*)0) : (_tmp615_ = (bala_ccode_node_unref (_tmp615_), ((void*)0)))); |
| 12755 | _bala_ccode_node_unref0 (_tmp612_)((_tmp612_ == ((void*)0)) ? ((void*)0) : (_tmp612_ = (bala_ccode_node_unref (_tmp612_), ((void*)0)))); |
| 12756 | } |
| 12757 | _tmp616_ = bala_ccode_base_module_get_current_method (self); |
| 12758 | _tmp617_ = _tmp616_; |
| 12759 | if (_tmp617_ != NULL((void*)0)) { |
| 12760 | { |
| 12761 | BalaList* _type_param_list = NULL((void*)0); |
| 12762 | BalaMethod* _tmp618_; |
| 12763 | BalaMethod* _tmp619_; |
| 12764 | BalaList* _tmp620_; |
| 12765 | BalaList* _tmp621_; |
| 12766 | gint _type_param_size = 0; |
| 12767 | BalaList* _tmp622_; |
| 12768 | gint _tmp623_; |
| 12769 | gint _tmp624_; |
| 12770 | gint _type_param_index = 0; |
| 12771 | _tmp618_ = bala_ccode_base_module_get_current_method (self); |
| 12772 | _tmp619_ = _tmp618_; |
| 12773 | _tmp620_ = bala_method_get_type_parameters (_tmp619_); |
| 12774 | _tmp621_ = _bala_iterable_ref0 (_tmp620_); |
| 12775 | _type_param_list = _tmp621_; |
| 12776 | _tmp622_ = _type_param_list; |
| 12777 | _tmp623_ = bala_collection_get_size ((BalaCollection*) _tmp622_); |
| 12778 | _tmp624_ = _tmp623_; |
| 12779 | _type_param_size = _tmp624_; |
| 12780 | _type_param_index = -1; |
| 12781 | while (TRUE(!(0))) { |
| 12782 | gint _tmp625_; |
| 12783 | gint _tmp626_; |
| 12784 | BalaTypeParameter* type_param = NULL((void*)0); |
| 12785 | BalaList* _tmp627_; |
| 12786 | gpointer _tmp628_; |
| 12787 | gchar* func_name = NULL((void*)0); |
| 12788 | BalaTypeParameter* _tmp629_; |
| 12789 | const gchar* _tmp630_; |
| 12790 | const gchar* _tmp631_; |
| 12791 | gchar* _tmp632_; |
| 12792 | gchar* _tmp633_; |
| 12793 | gchar* _tmp634_; |
| 12794 | BalaCCodeFunction* _tmp635_; |
| 12795 | BalaCCodeFunction* _tmp636_; |
| 12796 | const gchar* _tmp637_; |
| 12797 | BalaCCodeVariableDeclarator* _tmp638_; |
| 12798 | BalaCCodeVariableDeclarator* _tmp639_; |
| 12799 | BalaCCodeFunction* _tmp640_; |
| 12800 | BalaCCodeFunction* _tmp641_; |
| 12801 | const gchar* _tmp642_; |
| 12802 | BalaCCodeIdentifier* _tmp643_; |
| 12803 | BalaCCodeIdentifier* _tmp644_; |
| 12804 | BalaCCodeExpression* _tmp645_; |
| 12805 | const gchar* _tmp646_; |
| 12806 | BalaCCodeMemberAccess* _tmp647_; |
| 12807 | BalaCCodeMemberAccess* _tmp648_; |
| 12808 | BalaTypeParameter* _tmp649_; |
| 12809 | const gchar* _tmp650_; |
| 12810 | const gchar* _tmp651_; |
| 12811 | gchar* _tmp652_; |
| 12812 | gchar* _tmp653_; |
| 12813 | gchar* _tmp654_; |
| 12814 | BalaCCodeFunction* _tmp655_; |
| 12815 | BalaCCodeFunction* _tmp656_; |
| 12816 | const gchar* _tmp657_; |
| 12817 | BalaCCodeVariableDeclarator* _tmp658_; |
| 12818 | BalaCCodeVariableDeclarator* _tmp659_; |
| 12819 | BalaCCodeFunction* _tmp660_; |
| 12820 | BalaCCodeFunction* _tmp661_; |
| 12821 | const gchar* _tmp662_; |
| 12822 | BalaCCodeIdentifier* _tmp663_; |
| 12823 | BalaCCodeIdentifier* _tmp664_; |
| 12824 | BalaCCodeExpression* _tmp665_; |
| 12825 | const gchar* _tmp666_; |
| 12826 | BalaCCodeMemberAccess* _tmp667_; |
| 12827 | BalaCCodeMemberAccess* _tmp668_; |
| 12828 | BalaTypeParameter* _tmp669_; |
| 12829 | const gchar* _tmp670_; |
| 12830 | const gchar* _tmp671_; |
| 12831 | gchar* _tmp672_; |
| 12832 | gchar* _tmp673_; |
| 12833 | gchar* _tmp674_; |
| 12834 | BalaCCodeFunction* _tmp675_; |
| 12835 | BalaCCodeFunction* _tmp676_; |
| 12836 | const gchar* _tmp677_; |
| 12837 | BalaCCodeVariableDeclarator* _tmp678_; |
| 12838 | BalaCCodeVariableDeclarator* _tmp679_; |
| 12839 | BalaCCodeFunction* _tmp680_; |
| 12840 | BalaCCodeFunction* _tmp681_; |
| 12841 | const gchar* _tmp682_; |
| 12842 | BalaCCodeIdentifier* _tmp683_; |
| 12843 | BalaCCodeIdentifier* _tmp684_; |
| 12844 | BalaCCodeExpression* _tmp685_; |
| 12845 | const gchar* _tmp686_; |
| 12846 | BalaCCodeMemberAccess* _tmp687_; |
| 12847 | BalaCCodeMemberAccess* _tmp688_; |
| 12848 | _type_param_index = _type_param_index + 1; |
| 12849 | _tmp625_ = _type_param_index; |
| 12850 | _tmp626_ = _type_param_size; |
| 12851 | if (!(_tmp625_ < _tmp626_)) { |
| 12852 | break; |
| 12853 | } |
| 12854 | _tmp627_ = _type_param_list; |
| 12855 | _tmp628_ = bala_list_get (_tmp627_, _type_param_index); |
| 12856 | type_param = (BalaTypeParameter*) _tmp628_; |
| 12857 | _tmp629_ = type_param; |
| 12858 | _tmp630_ = bala_symbol_get_name ((BalaSymbol*) _tmp629_); |
| 12859 | _tmp631_ = _tmp630_; |
| 12860 | _tmp632_ = g_ascii_strdown (_tmp631_, (gssize) -1); |
| 12861 | _tmp633_ = _tmp632_; |
| 12862 | _tmp634_ = g_strdup_printf ("%s_type", _tmp633_); |
| 12863 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 12864 | func_name = _tmp634_; |
| 12865 | _g_free0 (_tmp633_)(_tmp633_ = (g_free (_tmp633_), ((void*)0))); |
| 12866 | _tmp635_ = bala_ccode_base_module_get_ccode (self); |
| 12867 | _tmp636_ = _tmp635_; |
| 12868 | _tmp637_ = func_name; |
| 12869 | _tmp638_ = bala_ccode_variable_declarator_new (_tmp637_, NULL((void*)0), NULL((void*)0)); |
| 12870 | _tmp639_ = _tmp638_; |
| 12871 | bala_ccode_function_add_declaration (_tmp636_, "GType", (BalaCCodeDeclarator*) _tmp639_, 0); |
| 12872 | _bala_ccode_node_unref0 (_tmp639_)((_tmp639_ == ((void*)0)) ? ((void*)0) : (_tmp639_ = (bala_ccode_node_unref (_tmp639_), ((void*)0)))); |
| 12873 | _tmp640_ = bala_ccode_base_module_get_ccode (self); |
| 12874 | _tmp641_ = _tmp640_; |
| 12875 | _tmp642_ = func_name; |
| 12876 | _tmp643_ = bala_ccode_identifier_new (_tmp642_); |
| 12877 | _tmp644_ = _tmp643_; |
| 12878 | _tmp645_ = outer_block; |
| 12879 | _tmp646_ = func_name; |
| 12880 | _tmp647_ = bala_ccode_member_access_new_pointer (_tmp645_, _tmp646_); |
| 12881 | _tmp648_ = _tmp647_; |
| 12882 | bala_ccode_function_add_assignment (_tmp641_, (BalaCCodeExpression*) _tmp644_, (BalaCCodeExpression*) _tmp648_); |
| 12883 | _bala_ccode_node_unref0 (_tmp648_)((_tmp648_ == ((void*)0)) ? ((void*)0) : (_tmp648_ = (bala_ccode_node_unref (_tmp648_), ((void*)0)))); |
| 12884 | _bala_ccode_node_unref0 (_tmp644_)((_tmp644_ == ((void*)0)) ? ((void*)0) : (_tmp644_ = (bala_ccode_node_unref (_tmp644_), ((void*)0)))); |
| 12885 | _tmp649_ = type_param; |
| 12886 | _tmp650_ = bala_symbol_get_name ((BalaSymbol*) _tmp649_); |
| 12887 | _tmp651_ = _tmp650_; |
| 12888 | _tmp652_ = g_ascii_strdown (_tmp651_, (gssize) -1); |
| 12889 | _tmp653_ = _tmp652_; |
| 12890 | _tmp654_ = g_strdup_printf ("%s_dup_func", _tmp653_); |
| 12891 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 12892 | func_name = _tmp654_; |
| 12893 | _g_free0 (_tmp653_)(_tmp653_ = (g_free (_tmp653_), ((void*)0))); |
| 12894 | _tmp655_ = bala_ccode_base_module_get_ccode (self); |
| 12895 | _tmp656_ = _tmp655_; |
| 12896 | _tmp657_ = func_name; |
| 12897 | _tmp658_ = bala_ccode_variable_declarator_new (_tmp657_, NULL((void*)0), NULL((void*)0)); |
| 12898 | _tmp659_ = _tmp658_; |
| 12899 | bala_ccode_function_add_declaration (_tmp656_, "GBoxedCopyFunc", (BalaCCodeDeclarator*) _tmp659_, 0); |
| 12900 | _bala_ccode_node_unref0 (_tmp659_)((_tmp659_ == ((void*)0)) ? ((void*)0) : (_tmp659_ = (bala_ccode_node_unref (_tmp659_), ((void*)0)))); |
| 12901 | _tmp660_ = bala_ccode_base_module_get_ccode (self); |
| 12902 | _tmp661_ = _tmp660_; |
| 12903 | _tmp662_ = func_name; |
| 12904 | _tmp663_ = bala_ccode_identifier_new (_tmp662_); |
| 12905 | _tmp664_ = _tmp663_; |
| 12906 | _tmp665_ = outer_block; |
| 12907 | _tmp666_ = func_name; |
| 12908 | _tmp667_ = bala_ccode_member_access_new_pointer (_tmp665_, _tmp666_); |
| 12909 | _tmp668_ = _tmp667_; |
| 12910 | bala_ccode_function_add_assignment (_tmp661_, (BalaCCodeExpression*) _tmp664_, (BalaCCodeExpression*) _tmp668_); |
| 12911 | _bala_ccode_node_unref0 (_tmp668_)((_tmp668_ == ((void*)0)) ? ((void*)0) : (_tmp668_ = (bala_ccode_node_unref (_tmp668_), ((void*)0)))); |
| 12912 | _bala_ccode_node_unref0 (_tmp664_)((_tmp664_ == ((void*)0)) ? ((void*)0) : (_tmp664_ = (bala_ccode_node_unref (_tmp664_), ((void*)0)))); |
| 12913 | _tmp669_ = type_param; |
| 12914 | _tmp670_ = bala_symbol_get_name ((BalaSymbol*) _tmp669_); |
| 12915 | _tmp671_ = _tmp670_; |
| 12916 | _tmp672_ = g_ascii_strdown (_tmp671_, (gssize) -1); |
| 12917 | _tmp673_ = _tmp672_; |
| 12918 | _tmp674_ = g_strdup_printf ("%s_destroy_func", _tmp673_); |
| 12919 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 12920 | func_name = _tmp674_; |
| 12921 | _g_free0 (_tmp673_)(_tmp673_ = (g_free (_tmp673_), ((void*)0))); |
| 12922 | _tmp675_ = bala_ccode_base_module_get_ccode (self); |
| 12923 | _tmp676_ = _tmp675_; |
| 12924 | _tmp677_ = func_name; |
| 12925 | _tmp678_ = bala_ccode_variable_declarator_new (_tmp677_, NULL((void*)0), NULL((void*)0)); |
| 12926 | _tmp679_ = _tmp678_; |
| 12927 | bala_ccode_function_add_declaration (_tmp676_, "GDestroyNotify", (BalaCCodeDeclarator*) _tmp679_, 0); |
| 12928 | _bala_ccode_node_unref0 (_tmp679_)((_tmp679_ == ((void*)0)) ? ((void*)0) : (_tmp679_ = (bala_ccode_node_unref (_tmp679_), ((void*)0)))); |
| 12929 | _tmp680_ = bala_ccode_base_module_get_ccode (self); |
| 12930 | _tmp681_ = _tmp680_; |
| 12931 | _tmp682_ = func_name; |
| 12932 | _tmp683_ = bala_ccode_identifier_new (_tmp682_); |
| 12933 | _tmp684_ = _tmp683_; |
| 12934 | _tmp685_ = outer_block; |
| 12935 | _tmp686_ = func_name; |
| 12936 | _tmp687_ = bala_ccode_member_access_new_pointer (_tmp685_, _tmp686_); |
| 12937 | _tmp688_ = _tmp687_; |
| 12938 | bala_ccode_function_add_assignment (_tmp681_, (BalaCCodeExpression*) _tmp684_, (BalaCCodeExpression*) _tmp688_); |
| 12939 | _bala_ccode_node_unref0 (_tmp688_)((_tmp688_ == ((void*)0)) ? ((void*)0) : (_tmp688_ = (bala_ccode_node_unref (_tmp688_), ((void*)0)))); |
| 12940 | _bala_ccode_node_unref0 (_tmp684_)((_tmp684_ == ((void*)0)) ? ((void*)0) : (_tmp684_ = (bala_ccode_node_unref (_tmp684_), ((void*)0)))); |
| 12941 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 12942 | _bala_code_node_unref0 (type_param)((type_param == ((void*)0)) ? ((void*)0) : (type_param = (bala_code_node_unref (type_param), ((void*)0)))); |
| 12943 | } |
| 12944 | _bala_iterable_unref0 (_type_param_list)((_type_param_list == ((void*)0)) ? ((void*)0) : (_type_param_list = (bala_iterable_unref (_type_param_list), ((void*)0)))); |
| 12945 | } |
| 12946 | } |
| 12947 | { |
| 12948 | gint i = 0; |
| 12949 | BalaList* _tmp689_; |
| 12950 | gint _tmp690_; |
| 12951 | gint _tmp691_; |
| 12952 | _tmp689_ = local_vars; |
| 12953 | _tmp690_ = bala_collection_get_size ((BalaCollection*) _tmp689_); |
| 12954 | _tmp691_ = _tmp690_; |
| 12955 | i = _tmp691_ - 1; |
| 12956 | { |
| 12957 | gboolean _tmp692_ = FALSE(0); |
| 12958 | _tmp692_ = TRUE(!(0)); |
| 12959 | while (TRUE(!(0))) { |
| 12960 | BalaLocalVariable* local = NULL((void*)0); |
| 12961 | BalaList* _tmp694_; |
| 12962 | gpointer _tmp695_; |
| 12963 | BalaLocalVariable* _tmp696_; |
| 12964 | gboolean _tmp697_; |
| 12965 | gboolean _tmp698_; |
| 12966 | if (!_tmp692_) { |
| 12967 | gint _tmp693_; |
| 12968 | _tmp693_ = i; |
| 12969 | i = _tmp693_ - 1; |
| 12970 | } |
| 12971 | _tmp692_ = FALSE(0); |
| 12972 | if (!(i >= 0)) { |
| 12973 | break; |
| 12974 | } |
| 12975 | _tmp694_ = local_vars; |
| 12976 | _tmp695_ = bala_list_get (_tmp694_, i); |
| 12977 | local = (BalaLocalVariable*) _tmp695_; |
| 12978 | _tmp696_ = local; |
| 12979 | _tmp697_ = bala_local_variable_get_captured (_tmp696_); |
| 12980 | _tmp698_ = _tmp697_; |
| 12981 | if (_tmp698_) { |
| 12982 | BalaLocalVariable* _tmp699_; |
| 12983 | BalaDataType* _tmp700_; |
| 12984 | BalaDataType* _tmp701_; |
| 12985 | _tmp699_ = local; |
| 12986 | _tmp700_ = bala_variable_get_variable_type ((BalaVariable*) _tmp699_); |
| 12987 | _tmp701_ = _tmp700_; |
| 12988 | if (bala_ccode_base_module_requires_destroy (_tmp701_)) { |
| 12989 | gboolean old_coroutine = FALSE(0); |
| 12990 | BalaMethod* _tmp702_; |
| 12991 | BalaMethod* _tmp703_; |
| 12992 | BalaCCodeFunction* _tmp710_; |
| 12993 | BalaCCodeFunction* _tmp711_; |
| 12994 | BalaLocalVariable* _tmp712_; |
| 12995 | BalaCCodeExpression* _tmp713_; |
| 12996 | BalaCCodeExpression* _tmp714_; |
| 12997 | old_coroutine = FALSE(0); |
| 12998 | _tmp702_ = bala_ccode_base_module_get_current_method (self); |
| 12999 | _tmp703_ = _tmp702_; |
| 13000 | if (_tmp703_ != NULL((void*)0)) { |
| 13001 | BalaMethod* _tmp704_; |
| 13002 | BalaMethod* _tmp705_; |
| 13003 | gboolean _tmp706_; |
| 13004 | gboolean _tmp707_; |
| 13005 | BalaMethod* _tmp708_; |
| 13006 | BalaMethod* _tmp709_; |
| 13007 | _tmp704_ = bala_ccode_base_module_get_current_method (self); |
| 13008 | _tmp705_ = _tmp704_; |
| 13009 | _tmp706_ = bala_method_get_coroutine (_tmp705_); |
| 13010 | _tmp707_ = _tmp706_; |
| 13011 | old_coroutine = _tmp707_; |
| 13012 | _tmp708_ = bala_ccode_base_module_get_current_method (self); |
| 13013 | _tmp709_ = _tmp708_; |
| 13014 | bala_method_set_coroutine (_tmp709_, FALSE(0)); |
| 13015 | } |
| 13016 | _tmp710_ = bala_ccode_base_module_get_ccode (self); |
| 13017 | _tmp711_ = _tmp710_; |
| 13018 | _tmp712_ = local; |
| 13019 | _tmp713_ = bala_ccode_base_module_destroy_local (self, _tmp712_); |
| 13020 | _tmp714_ = _tmp713_; |
| 13021 | bala_ccode_function_add_expression (_tmp711_, _tmp714_); |
| 13022 | _bala_ccode_node_unref0 (_tmp714_)((_tmp714_ == ((void*)0)) ? ((void*)0) : (_tmp714_ = (bala_ccode_node_unref (_tmp714_), ((void*)0)))); |
| 13023 | if (old_coroutine) { |
| 13024 | BalaMethod* _tmp715_; |
| 13025 | BalaMethod* _tmp716_; |
| 13026 | _tmp715_ = bala_ccode_base_module_get_current_method (self); |
| 13027 | _tmp716_ = _tmp715_; |
| 13028 | bala_method_set_coroutine (_tmp716_, TRUE(!(0))); |
| 13029 | } |
| 13030 | } |
| 13031 | } |
| 13032 | _bala_code_node_unref0 (local)((local == ((void*)0)) ? ((void*)0) : (local = (bala_code_node_unref (local), ((void*)0)))); |
| 13033 | } |
| 13034 | } |
| 13035 | } |
| 13036 | _tmp717_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 13037 | _tmp718_ = _tmp717_; |
| 13038 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp718_, BALA_TYPE_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp718_); GType __t = ((bala_method_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 13039 | BalaMethod* m = NULL((void*)0); |
| 13040 | BalaSymbol* _tmp719_; |
| 13041 | BalaSymbol* _tmp720_; |
| 13042 | BalaMethod* _tmp721_; |
| 13043 | _tmp719_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 13044 | _tmp720_ = _tmp719_; |
| 13045 | _tmp721_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp720_, BALA_TYPE_METHOD, BalaMethod)(((BalaMethod*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp720_), ((bala_method_get_type ())))))); |
| 13046 | m = _tmp721_; |
| 13047 | { |
| 13048 | BalaList* _param_list = NULL((void*)0); |
| 13049 | BalaMethod* _tmp722_; |
| 13050 | BalaList* _tmp723_; |
| 13051 | BalaList* _tmp724_; |
| 13052 | gint _param_size = 0; |
| 13053 | BalaList* _tmp725_; |
| 13054 | gint _tmp726_; |
| 13055 | gint _tmp727_; |
| 13056 | gint _param_index = 0; |
| 13057 | _tmp722_ = m; |
| 13058 | _tmp723_ = bala_callable_get_parameters ((BalaCallable*) _tmp722_); |
| 13059 | _tmp724_ = _bala_iterable_ref0 (_tmp723_); |
| 13060 | _param_list = _tmp724_; |
| 13061 | _tmp725_ = _param_list; |
| 13062 | _tmp726_ = bala_collection_get_size ((BalaCollection*) _tmp725_); |
| 13063 | _tmp727_ = _tmp726_; |
| 13064 | _param_size = _tmp727_; |
| 13065 | _param_index = -1; |
| 13066 | while (TRUE(!(0))) { |
| 13067 | gint _tmp728_; |
| 13068 | gint _tmp729_; |
| 13069 | BalaParameter* param = NULL((void*)0); |
| 13070 | BalaList* _tmp730_; |
| 13071 | gpointer _tmp731_; |
| 13072 | BalaParameter* _tmp732_; |
| 13073 | gboolean _tmp733_; |
| 13074 | gboolean _tmp734_; |
| 13075 | _param_index = _param_index + 1; |
| 13076 | _tmp728_ = _param_index; |
| 13077 | _tmp729_ = _param_size; |
| 13078 | if (!(_tmp728_ < _tmp729_)) { |
| 13079 | break; |
| 13080 | } |
| 13081 | _tmp730_ = _param_list; |
| 13082 | _tmp731_ = bala_list_get (_tmp730_, _param_index); |
| 13083 | param = (BalaParameter*) _tmp731_; |
| 13084 | _tmp732_ = param; |
| 13085 | _tmp733_ = bala_parameter_get_captured (_tmp732_); |
| 13086 | _tmp734_ = _tmp733_; |
| 13087 | if (_tmp734_) { |
| 13088 | BalaDataType* param_type = NULL((void*)0); |
| 13089 | BalaParameter* _tmp735_; |
| 13090 | BalaDataType* _tmp736_; |
| 13091 | BalaDataType* _tmp737_; |
| 13092 | BalaDataType* _tmp738_; |
| 13093 | BalaDataType* _tmp739_; |
| 13094 | gboolean _tmp740_; |
| 13095 | gboolean _tmp741_; |
| 13096 | BalaDataType* _tmp744_; |
| 13097 | _tmp735_ = param; |
| 13098 | _tmp736_ = bala_variable_get_variable_type ((BalaVariable*) _tmp735_); |
| 13099 | _tmp737_ = _tmp736_; |
| 13100 | _tmp738_ = bala_data_type_copy (_tmp737_); |
| 13101 | param_type = _tmp738_; |
| 13102 | _tmp739_ = param_type; |
| 13103 | _tmp740_ = bala_data_type_get_value_owned (_tmp739_); |
| 13104 | _tmp741_ = _tmp740_; |
| 13105 | if (!_tmp741_) { |
| 13106 | BalaDataType* _tmp742_; |
| 13107 | BalaDataType* _tmp743_; |
| 13108 | _tmp742_ = param_type; |
| 13109 | _tmp743_ = param_type; |
| 13110 | bala_data_type_set_value_owned (_tmp742_, !bala_ccode_base_module_no_implicit_copy (self, _tmp743_)); |
| 13111 | } |
| 13112 | _tmp744_ = param_type; |
| 13113 | if (bala_ccode_base_module_requires_destroy (_tmp744_)) { |
| 13114 | gboolean old_coroutine = FALSE(0); |
| 13115 | BalaMethod* _tmp745_; |
| 13116 | BalaCCodeFunction* _tmp750_; |
| 13117 | BalaCCodeFunction* _tmp751_; |
| 13118 | BalaParameter* _tmp752_; |
| 13119 | BalaCCodeExpression* _tmp753_; |
| 13120 | BalaCCodeExpression* _tmp754_; |
| 13121 | old_coroutine = FALSE(0); |
| 13122 | _tmp745_ = m; |
| 13123 | if (_tmp745_ != NULL((void*)0)) { |
| 13124 | BalaMethod* _tmp746_; |
| 13125 | gboolean _tmp747_; |
| 13126 | gboolean _tmp748_; |
| 13127 | BalaMethod* _tmp749_; |
| 13128 | _tmp746_ = m; |
| 13129 | _tmp747_ = bala_method_get_coroutine (_tmp746_); |
| 13130 | _tmp748_ = _tmp747_; |
| 13131 | old_coroutine = _tmp748_; |
| 13132 | _tmp749_ = m; |
| 13133 | bala_method_set_coroutine (_tmp749_, FALSE(0)); |
| 13134 | } |
| 13135 | _tmp750_ = bala_ccode_base_module_get_ccode (self); |
| 13136 | _tmp751_ = _tmp750_; |
| 13137 | _tmp752_ = param; |
| 13138 | _tmp753_ = bala_ccode_base_module_destroy_parameter (self, _tmp752_); |
| 13139 | _tmp754_ = _tmp753_; |
| 13140 | bala_ccode_function_add_expression (_tmp751_, _tmp754_); |
| 13141 | _bala_ccode_node_unref0 (_tmp754_)((_tmp754_ == ((void*)0)) ? ((void*)0) : (_tmp754_ = (bala_ccode_node_unref (_tmp754_), ((void*)0)))); |
| 13142 | if (old_coroutine) { |
| 13143 | BalaMethod* _tmp755_; |
| 13144 | _tmp755_ = m; |
| 13145 | bala_method_set_coroutine (_tmp755_, TRUE(!(0))); |
| 13146 | } |
| 13147 | } |
| 13148 | _bala_code_node_unref0 (param_type)((param_type == ((void*)0)) ? ((void*)0) : (param_type = (bala_code_node_unref (param_type), ((void*)0)))); |
| 13149 | } |
| 13150 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 13151 | } |
| 13152 | _bala_iterable_unref0 (_param_list)((_param_list == ((void*)0)) ? ((void*)0) : (_param_list = (bala_iterable_unref (_param_list), ((void*)0)))); |
| 13153 | } |
| 13154 | _bala_code_node_unref0 (m)((m == ((void*)0)) ? ((void*)0) : (m = (bala_code_node_unref ( m), ((void*)0)))); |
| 13155 | } else { |
| 13156 | BalaSymbol* _tmp756_; |
| 13157 | BalaSymbol* _tmp757_; |
| 13158 | _tmp756_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 13159 | _tmp757_ = _tmp756_; |
| 13160 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp757_, BALA_TYPE_PROPERTY_ACCESSOR)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp757_); GType __t = ((bala_property_accessor_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 13161 | BalaPropertyAccessor* acc = NULL((void*)0); |
| 13162 | BalaSymbol* _tmp758_; |
| 13163 | BalaSymbol* _tmp759_; |
| 13164 | BalaPropertyAccessor* _tmp760_; |
| 13165 | gboolean _tmp761_ = FALSE(0); |
| 13166 | BalaPropertyAccessor* _tmp762_; |
| 13167 | gboolean _tmp763_; |
| 13168 | gboolean _tmp764_; |
| 13169 | _tmp758_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 13170 | _tmp759_ = _tmp758_; |
| 13171 | _tmp760_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp759_, BALA_TYPE_PROPERTY_ACCESSOR, BalaPropertyAccessor)(((BalaPropertyAccessor*) g_type_check_instance_cast ((GTypeInstance *) (_tmp759_), ((bala_property_accessor_get_type ())))))); |
| 13172 | acc = _tmp760_; |
| 13173 | _tmp762_ = acc; |
| 13174 | _tmp763_ = bala_property_accessor_get_readable (_tmp762_); |
| 13175 | _tmp764_ = _tmp763_; |
| 13176 | if (!_tmp764_) { |
| 13177 | BalaPropertyAccessor* _tmp765_; |
| 13178 | BalaParameter* _tmp766_; |
| 13179 | BalaParameter* _tmp767_; |
| 13180 | gboolean _tmp768_; |
| 13181 | gboolean _tmp769_; |
| 13182 | _tmp765_ = acc; |
| 13183 | _tmp766_ = bala_property_accessor_get_value_parameter (_tmp765_); |
| 13184 | _tmp767_ = _tmp766_; |
| 13185 | _tmp768_ = bala_parameter_get_captured (_tmp767_); |
| 13186 | _tmp769_ = _tmp768_; |
| 13187 | _tmp761_ = _tmp769_; |
| 13188 | } else { |
| 13189 | _tmp761_ = FALSE(0); |
| 13190 | } |
| 13191 | if (_tmp761_) { |
| 13192 | BalaDataType* param_type = NULL((void*)0); |
| 13193 | BalaPropertyAccessor* _tmp770_; |
| 13194 | BalaParameter* _tmp771_; |
| 13195 | BalaParameter* _tmp772_; |
| 13196 | BalaDataType* _tmp773_; |
| 13197 | BalaDataType* _tmp774_; |
| 13198 | BalaDataType* _tmp775_; |
| 13199 | BalaDataType* _tmp776_; |
| 13200 | gboolean _tmp777_; |
| 13201 | gboolean _tmp778_; |
| 13202 | BalaDataType* _tmp781_; |
| 13203 | _tmp770_ = acc; |
| 13204 | _tmp771_ = bala_property_accessor_get_value_parameter (_tmp770_); |
| 13205 | _tmp772_ = _tmp771_; |
| 13206 | _tmp773_ = bala_variable_get_variable_type ((BalaVariable*) _tmp772_); |
| 13207 | _tmp774_ = _tmp773_; |
| 13208 | _tmp775_ = bala_data_type_copy (_tmp774_); |
| 13209 | param_type = _tmp775_; |
| 13210 | _tmp776_ = param_type; |
| 13211 | _tmp777_ = bala_data_type_get_value_owned (_tmp776_); |
| 13212 | _tmp778_ = _tmp777_; |
| 13213 | if (!_tmp778_) { |
| 13214 | BalaDataType* _tmp779_; |
| 13215 | BalaDataType* _tmp780_; |
| 13216 | _tmp779_ = param_type; |
| 13217 | _tmp780_ = param_type; |
| 13218 | bala_data_type_set_value_owned (_tmp779_, !bala_ccode_base_module_no_implicit_copy (self, _tmp780_)); |
| 13219 | } |
| 13220 | _tmp781_ = param_type; |
| 13221 | if (bala_ccode_base_module_requires_destroy (_tmp781_)) { |
| 13222 | BalaCCodeFunction* _tmp782_; |
| 13223 | BalaCCodeFunction* _tmp783_; |
| 13224 | BalaPropertyAccessor* _tmp784_; |
| 13225 | BalaParameter* _tmp785_; |
| 13226 | BalaParameter* _tmp786_; |
| 13227 | BalaCCodeExpression* _tmp787_; |
| 13228 | BalaCCodeExpression* _tmp788_; |
| 13229 | _tmp782_ = bala_ccode_base_module_get_ccode (self); |
| 13230 | _tmp783_ = _tmp782_; |
| 13231 | _tmp784_ = acc; |
| 13232 | _tmp785_ = bala_property_accessor_get_value_parameter (_tmp784_); |
| 13233 | _tmp786_ = _tmp785_; |
| 13234 | _tmp787_ = bala_ccode_base_module_destroy_parameter (self, _tmp786_); |
| 13235 | _tmp788_ = _tmp787_; |
| 13236 | bala_ccode_function_add_expression (_tmp783_, _tmp788_); |
| 13237 | _bala_ccode_node_unref0 (_tmp788_)((_tmp788_ == ((void*)0)) ? ((void*)0) : (_tmp788_ = (bala_ccode_node_unref (_tmp788_), ((void*)0)))); |
| 13238 | } |
| 13239 | _bala_code_node_unref0 (param_type)((param_type == ((void*)0)) ? ((void*)0) : (param_type = (bala_code_node_unref (param_type), ((void*)0)))); |
| 13240 | } |
| 13241 | _bala_code_node_unref0 (acc)((acc == ((void*)0)) ? ((void*)0) : (acc = (bala_code_node_unref (acc), ((void*)0)))); |
| 13242 | } |
| 13243 | } |
| 13244 | _tmp789_ = parent_block; |
| 13245 | if (_tmp789_ != NULL((void*)0)) { |
| 13246 | gint parent_block_id = 0; |
| 13247 | BalaBlock* _tmp790_; |
| 13248 | BalaCCodeFunctionCall* unref_call = NULL((void*)0); |
| 13249 | gchar* _tmp791_; |
| 13250 | gchar* _tmp792_; |
| 13251 | BalaCCodeIdentifier* _tmp793_; |
| 13252 | BalaCCodeIdentifier* _tmp794_; |
| 13253 | BalaCCodeFunctionCall* _tmp795_; |
| 13254 | BalaCCodeFunctionCall* _tmp796_; |
| 13255 | BalaCCodeFunctionCall* _tmp797_; |
| 13256 | gchar* _tmp798_; |
| 13257 | gchar* _tmp799_; |
| 13258 | BalaCCodeIdentifier* _tmp800_; |
| 13259 | BalaCCodeIdentifier* _tmp801_; |
| 13260 | gchar* _tmp802_; |
| 13261 | gchar* _tmp803_; |
| 13262 | BalaCCodeMemberAccess* _tmp804_; |
| 13263 | BalaCCodeMemberAccess* _tmp805_; |
| 13264 | BalaCCodeFunction* _tmp806_; |
| 13265 | BalaCCodeFunction* _tmp807_; |
| 13266 | BalaCCodeFunctionCall* _tmp808_; |
| 13267 | BalaCCodeFunction* _tmp809_; |
| 13268 | BalaCCodeFunction* _tmp810_; |
| 13269 | gchar* _tmp811_; |
| 13270 | gchar* _tmp812_; |
| 13271 | BalaCCodeIdentifier* _tmp813_; |
| 13272 | BalaCCodeIdentifier* _tmp814_; |
| 13273 | gchar* _tmp815_; |
| 13274 | gchar* _tmp816_; |
| 13275 | BalaCCodeMemberAccess* _tmp817_; |
| 13276 | BalaCCodeMemberAccess* _tmp818_; |
| 13277 | BalaCCodeConstant* _tmp819_; |
| 13278 | BalaCCodeConstant* _tmp820_; |
| 13279 | _tmp790_ = parent_block; |
| 13280 | parent_block_id = bala_ccode_base_module_get_block_id (self, _tmp790_); |
| 13281 | _tmp791_ = g_strdup_printf ("block%d_data_unref", parent_block_id); |
| 13282 | _tmp792_ = _tmp791_; |
| 13283 | _tmp793_ = bala_ccode_identifier_new (_tmp792_); |
| 13284 | _tmp794_ = _tmp793_; |
| 13285 | _tmp795_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp794_); |
| 13286 | _tmp796_ = _tmp795_; |
| 13287 | _bala_ccode_node_unref0 (_tmp794_)((_tmp794_ == ((void*)0)) ? ((void*)0) : (_tmp794_ = (bala_ccode_node_unref (_tmp794_), ((void*)0)))); |
| 13288 | _g_free0 (_tmp792_)(_tmp792_ = (g_free (_tmp792_), ((void*)0))); |
| 13289 | unref_call = _tmp796_; |
| 13290 | _tmp797_ = unref_call; |
| 13291 | _tmp798_ = g_strdup_printf ("_data%d_", block_id); |
| 13292 | _tmp799_ = _tmp798_; |
| 13293 | _tmp800_ = bala_ccode_identifier_new (_tmp799_); |
| 13294 | _tmp801_ = _tmp800_; |
| 13295 | _tmp802_ = g_strdup_printf ("_data%d_", parent_block_id); |
| 13296 | _tmp803_ = _tmp802_; |
| 13297 | _tmp804_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp801_, _tmp803_); |
| 13298 | _tmp805_ = _tmp804_; |
| 13299 | bala_ccode_function_call_add_argument (_tmp797_, (BalaCCodeExpression*) _tmp805_); |
| 13300 | _bala_ccode_node_unref0 (_tmp805_)((_tmp805_ == ((void*)0)) ? ((void*)0) : (_tmp805_ = (bala_ccode_node_unref (_tmp805_), ((void*)0)))); |
| 13301 | _g_free0 (_tmp803_)(_tmp803_ = (g_free (_tmp803_), ((void*)0))); |
| 13302 | _bala_ccode_node_unref0 (_tmp801_)((_tmp801_ == ((void*)0)) ? ((void*)0) : (_tmp801_ = (bala_ccode_node_unref (_tmp801_), ((void*)0)))); |
| 13303 | _g_free0 (_tmp799_)(_tmp799_ = (g_free (_tmp799_), ((void*)0))); |
| 13304 | _tmp806_ = bala_ccode_base_module_get_ccode (self); |
| 13305 | _tmp807_ = _tmp806_; |
| 13306 | _tmp808_ = unref_call; |
| 13307 | bala_ccode_function_add_expression (_tmp807_, (BalaCCodeExpression*) _tmp808_); |
| 13308 | _tmp809_ = bala_ccode_base_module_get_ccode (self); |
| 13309 | _tmp810_ = _tmp809_; |
| 13310 | _tmp811_ = g_strdup_printf ("_data%d_", block_id); |
| 13311 | _tmp812_ = _tmp811_; |
| 13312 | _tmp813_ = bala_ccode_identifier_new (_tmp812_); |
| 13313 | _tmp814_ = _tmp813_; |
| 13314 | _tmp815_ = g_strdup_printf ("_data%d_", parent_block_id); |
| 13315 | _tmp816_ = _tmp815_; |
| 13316 | _tmp817_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp814_, _tmp816_); |
| 13317 | _tmp818_ = _tmp817_; |
| 13318 | _tmp819_ = bala_ccode_constant_new ("NULL"); |
| 13319 | _tmp820_ = _tmp819_; |
| 13320 | bala_ccode_function_add_assignment (_tmp810_, (BalaCCodeExpression*) _tmp818_, (BalaCCodeExpression*) _tmp820_); |
| 13321 | _bala_ccode_node_unref0 (_tmp820_)((_tmp820_ == ((void*)0)) ? ((void*)0) : (_tmp820_ = (bala_ccode_node_unref (_tmp820_), ((void*)0)))); |
| 13322 | _bala_ccode_node_unref0 (_tmp818_)((_tmp818_ == ((void*)0)) ? ((void*)0) : (_tmp818_ = (bala_ccode_node_unref (_tmp818_), ((void*)0)))); |
| 13323 | _g_free0 (_tmp816_)(_tmp816_ = (g_free (_tmp816_), ((void*)0))); |
| 13324 | _bala_ccode_node_unref0 (_tmp814_)((_tmp814_ == ((void*)0)) ? ((void*)0) : (_tmp814_ = (bala_ccode_node_unref (_tmp814_), ((void*)0)))); |
| 13325 | _g_free0 (_tmp812_)(_tmp812_ = (g_free (_tmp812_), ((void*)0))); |
| 13326 | _bala_ccode_node_unref0 (unref_call)((unref_call == ((void*)0)) ? ((void*)0) : (unref_call = (bala_ccode_node_unref (unref_call), ((void*)0)))); |
| 13327 | } else { |
| 13328 | BalaDataType* _tmp821_; |
| 13329 | BalaDataType* _tmp822_; |
| 13330 | BalaDataType* _tmp823_; |
| 13331 | _tmp821_ = bala_ccode_base_module_get_this_type (self); |
| 13332 | _tmp822_ = _bala_code_node_ref0 (_tmp821_); |
| 13333 | _bala_code_node_unref0 (this_type)((this_type == ((void*)0)) ? ((void*)0) : (this_type = (bala_code_node_unref (this_type), ((void*)0)))); |
| 13334 | this_type = _tmp822_; |
| 13335 | _tmp823_ = this_type; |
| 13336 | if (_tmp823_ != NULL((void*)0)) { |
| 13337 | BalaDataType* _tmp824_; |
| 13338 | BalaDataType* _tmp825_; |
| 13339 | BalaDataType* _tmp826_; |
| 13340 | gboolean _tmp827_ = FALSE(0); |
| 13341 | BalaDataType* _tmp828_; |
| 13342 | _tmp824_ = this_type; |
| 13343 | _tmp825_ = bala_data_type_copy (_tmp824_); |
| 13344 | _bala_code_node_unref0 (this_type)((this_type == ((void*)0)) ? ((void*)0) : (this_type = (bala_code_node_unref (this_type), ((void*)0)))); |
| 13345 | this_type = _tmp825_; |
| 13346 | _tmp826_ = this_type; |
| 13347 | bala_data_type_set_value_owned (_tmp826_, TRUE(!(0))); |
| 13348 | _tmp828_ = this_type; |
| 13349 | if (bala_data_type_is_disposable (_tmp828_)) { |
| 13350 | _tmp827_ = !bala_ccode_base_module_is_in_destructor (self); |
| 13351 | } else { |
| 13352 | _tmp827_ = FALSE(0); |
| 13353 | } |
| 13354 | if (_tmp827_) { |
| 13355 | BalaGLibValue* this_value = NULL((void*)0); |
| 13356 | BalaDataType* _tmp829_; |
| 13357 | BalaCCodeIdentifier* _tmp830_; |
| 13358 | BalaCCodeIdentifier* _tmp831_; |
| 13359 | BalaGLibValue* _tmp832_; |
| 13360 | BalaGLibValue* _tmp833_; |
| 13361 | BalaCCodeFunction* _tmp834_; |
| 13362 | BalaCCodeFunction* _tmp835_; |
| 13363 | BalaGLibValue* _tmp836_; |
| 13364 | BalaCCodeExpression* _tmp837_; |
| 13365 | BalaCCodeExpression* _tmp838_; |
| 13366 | _tmp829_ = this_type; |
| 13367 | _tmp830_ = bala_ccode_identifier_new ("self"); |
| 13368 | _tmp831_ = _tmp830_; |
| 13369 | _tmp832_ = bala_glib_value_new (_tmp829_, (BalaCCodeExpression*) _tmp831_, TRUE(!(0))); |
| 13370 | _tmp833_ = _tmp832_; |
| 13371 | _bala_ccode_node_unref0 (_tmp831_)((_tmp831_ == ((void*)0)) ? ((void*)0) : (_tmp831_ = (bala_ccode_node_unref (_tmp831_), ((void*)0)))); |
| 13372 | this_value = _tmp833_; |
| 13373 | _tmp834_ = bala_ccode_base_module_get_ccode (self); |
| 13374 | _tmp835_ = _tmp834_; |
| 13375 | _tmp836_ = this_value; |
| 13376 | _tmp837_ = bala_ccode_base_module_destroy_value (self, (BalaTargetValue*) _tmp836_, FALSE(0)); |
| 13377 | _tmp838_ = _tmp837_; |
| 13378 | bala_ccode_function_add_expression (_tmp835_, _tmp838_); |
| 13379 | _bala_ccode_node_unref0 (_tmp838_)((_tmp838_ == ((void*)0)) ? ((void*)0) : (_tmp838_ = (bala_ccode_node_unref (_tmp838_), ((void*)0)))); |
| 13380 | _bala_target_value_unref0 (this_value)((this_value == ((void*)0)) ? ((void*)0) : (this_value = (bala_target_value_unref (this_value), ((void*)0)))); |
| 13381 | } |
| 13382 | } |
| 13383 | } |
| 13384 | _tmp839_ = bala_ccode_identifier_new ("g_slice_free"); |
| 13385 | _tmp840_ = _tmp839_; |
| 13386 | _tmp841_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp840_); |
| 13387 | _tmp842_ = _tmp841_; |
| 13388 | _bala_ccode_node_unref0 (_tmp840_)((_tmp840_ == ((void*)0)) ? ((void*)0) : (_tmp840_ = (bala_ccode_node_unref (_tmp840_), ((void*)0)))); |
| 13389 | data_free = _tmp842_; |
| 13390 | _tmp843_ = data_free; |
| 13391 | _tmp844_ = struct_name; |
| 13392 | _tmp845_ = bala_ccode_identifier_new (_tmp844_); |
| 13393 | _tmp846_ = _tmp845_; |
| 13394 | bala_ccode_function_call_add_argument (_tmp843_, (BalaCCodeExpression*) _tmp846_); |
| 13395 | _bala_ccode_node_unref0 (_tmp846_)((_tmp846_ == ((void*)0)) ? ((void*)0) : (_tmp846_ = (bala_ccode_node_unref (_tmp846_), ((void*)0)))); |
| 13396 | _tmp847_ = data_free; |
| 13397 | _tmp848_ = g_strdup_printf ("_data%d_", block_id); |
| 13398 | _tmp849_ = _tmp848_; |
| 13399 | _tmp850_ = bala_ccode_identifier_new (_tmp849_); |
| 13400 | _tmp851_ = _tmp850_; |
| 13401 | bala_ccode_function_call_add_argument (_tmp847_, (BalaCCodeExpression*) _tmp851_); |
| 13402 | _bala_ccode_node_unref0 (_tmp851_)((_tmp851_ == ((void*)0)) ? ((void*)0) : (_tmp851_ = (bala_ccode_node_unref (_tmp851_), ((void*)0)))); |
| 13403 | _g_free0 (_tmp849_)(_tmp849_ = (g_free (_tmp849_), ((void*)0))); |
| 13404 | _tmp852_ = bala_ccode_base_module_get_ccode (self); |
| 13405 | _tmp853_ = _tmp852_; |
| 13406 | _tmp854_ = data_free; |
| 13407 | bala_ccode_function_add_expression (_tmp853_, (BalaCCodeExpression*) _tmp854_); |
| 13408 | _tmp855_ = bala_ccode_base_module_get_ccode (self); |
| 13409 | _tmp856_ = _tmp855_; |
| 13410 | bala_ccode_function_close (_tmp856_); |
| 13411 | bala_ccode_base_module_pop_function (self); |
| 13412 | _tmp857_ = self->cfile; |
| 13413 | _tmp858_ = unref_fun; |
| 13414 | bala_ccode_file_add_function_declaration (_tmp857_, _tmp858_); |
| 13415 | _tmp859_ = self->cfile; |
| 13416 | _tmp860_ = unref_fun; |
| 13417 | bala_ccode_file_add_function (_tmp859_, _tmp860_); |
| 13418 | _bala_ccode_node_unref0 (data_free)((data_free == ((void*)0)) ? ((void*)0) : (data_free = (bala_ccode_node_unref (data_free), ((void*)0)))); |
| 13419 | _bala_code_node_unref0 (this_type)((this_type == ((void*)0)) ? ((void*)0) : (this_type = (bala_code_node_unref (this_type), ((void*)0)))); |
| 13420 | _bala_ccode_node_unref0 (outer_block)((outer_block == ((void*)0)) ? ((void*)0) : (outer_block = (bala_ccode_node_unref (outer_block), ((void*)0)))); |
| 13421 | _bala_ccode_node_unref0 (unref_fun)((unref_fun == ((void*)0)) ? ((void*)0) : (unref_fun = (bala_ccode_node_unref (unref_fun), ((void*)0)))); |
| 13422 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 13423 | _bala_ccode_node_unref0 (ref_fun)((ref_fun == ((void*)0)) ? ((void*)0) : (ref_fun = (bala_ccode_node_unref (ref_fun), ((void*)0)))); |
| 13424 | _bala_ccode_node_unref0 (_typedef_)((_typedef_ == ((void*)0)) ? ((void*)0) : (_typedef_ = (bala_ccode_node_unref (_typedef_), ((void*)0)))); |
| 13425 | _bala_ccode_node_unref0 (data_alloc)((data_alloc == ((void*)0)) ? ((void*)0) : (data_alloc = (bala_ccode_node_unref (data_alloc), ((void*)0)))); |
| 13426 | _bala_ccode_node_unref0 (data)((data == ((void*)0)) ? ((void*)0) : (data = (bala_ccode_node_unref (data), ((void*)0)))); |
| 13427 | _g_free0 (struct_name)(struct_name = (g_free (struct_name), ((void*)0))); |
| 13428 | _bala_code_node_unref0 (parent_block)((parent_block == ((void*)0)) ? ((void*)0) : (parent_block = ( bala_code_node_unref (parent_block), ((void*)0)))); |
| 13429 | } |
| 13430 | reachable_exit_block = TRUE(!(0)); |
| 13431 | { |
| 13432 | BalaList* _stmt_list = NULL((void*)0); |
| 13433 | BalaList* _tmp861_; |
| 13434 | gint _stmt_size = 0; |
| 13435 | BalaList* _tmp862_; |
| 13436 | gint _tmp863_; |
| 13437 | gint _tmp864_; |
| 13438 | gint _stmt_index = 0; |
| 13439 | _tmp861_ = bala_block_get_statements (b); |
| 13440 | _stmt_list = _tmp861_; |
| 13441 | _tmp862_ = _stmt_list; |
| 13442 | _tmp863_ = bala_collection_get_size ((BalaCollection*) _tmp862_); |
| 13443 | _tmp864_ = _tmp863_; |
| 13444 | _stmt_size = _tmp864_; |
| 13445 | _stmt_index = -1; |
| 13446 | while (TRUE(!(0))) { |
| 13447 | gint _tmp865_; |
| 13448 | gint _tmp866_; |
| 13449 | BalaStatement* stmt = NULL((void*)0); |
| 13450 | BalaList* _tmp867_; |
| 13451 | gpointer _tmp868_; |
| 13452 | BalaStatement* _tmp869_; |
| 13453 | BalaStatement* _tmp870_; |
| 13454 | BalaSourceReference* _tmp871_; |
| 13455 | BalaSourceReference* _tmp872_; |
| 13456 | BalaStatement* _tmp873_; |
| 13457 | _stmt_index = _stmt_index + 1; |
| 13458 | _tmp865_ = _stmt_index; |
| 13459 | _tmp866_ = _stmt_size; |
| 13460 | if (!(_tmp865_ < _tmp866_)) { |
| 13461 | break; |
| 13462 | } |
| 13463 | _tmp867_ = _stmt_list; |
| 13464 | _tmp868_ = bala_list_get (_tmp867_, _stmt_index); |
| 13465 | stmt = (BalaStatement*) _tmp868_; |
| 13466 | _tmp869_ = stmt; |
| 13467 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp869_, BALA_TYPE_RETURN_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp869_); GType __t = ((bala_return_statement_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 13468 | reachable_exit_block = FALSE(0); |
| 13469 | } |
| 13470 | _tmp870_ = stmt; |
| 13471 | _tmp871_ = bala_code_node_get_source_reference ((BalaCodeNode*) _tmp870_); |
| 13472 | _tmp872_ = _tmp871_; |
| 13473 | bala_ccode_base_module_push_line (self, _tmp872_); |
| 13474 | _tmp873_ = stmt; |
| 13475 | bala_code_node_emit ((BalaCodeNode*) _tmp873_, (BalaCodeGenerator*) self); |
| 13476 | bala_ccode_base_module_pop_line (self); |
| 13477 | _bala_code_node_unref0 (stmt)((stmt == ((void*)0)) ? ((void*)0) : (stmt = (bala_code_node_unref (stmt), ((void*)0)))); |
| 13478 | } |
| 13479 | _bala_iterable_unref0 (_stmt_list)((_stmt_list == ((void*)0)) ? ((void*)0) : (_stmt_list = (bala_iterable_unref (_stmt_list), ((void*)0)))); |
| 13480 | } |
| 13481 | if (reachable_exit_block) { |
| 13482 | BalaSymbol* _tmp874_; |
| 13483 | BalaSymbol* _tmp875_; |
| 13484 | BalaSymbol* _tmp913_; |
| 13485 | BalaSymbol* _tmp914_; |
| 13486 | gboolean _tmp987_; |
| 13487 | gboolean _tmp988_; |
| 13488 | _tmp874_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 13489 | _tmp875_ = _tmp874_; |
| 13490 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp875_, BALA_TYPE_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp875_); GType __t = ((bala_method_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 13491 | BalaMethod* m = NULL((void*)0); |
| 13492 | BalaSymbol* _tmp876_; |
| 13493 | BalaSymbol* _tmp877_; |
| 13494 | _tmp876_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 13495 | _tmp877_ = _tmp876_; |
| 13496 | m = G_TYPE_CHECK_INSTANCE_CAST (_tmp877_, BALA_TYPE_METHOD, BalaMethod)(((BalaMethod*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp877_), ((bala_method_get_type ()))))); |
| 13497 | { |
| 13498 | BalaList* _postcondition_list = NULL((void*)0); |
| 13499 | BalaMethod* _tmp878_; |
| 13500 | BalaList* _tmp879_; |
| 13501 | BalaList* _tmp880_; |
| 13502 | gint _postcondition_size = 0; |
| 13503 | BalaList* _tmp881_; |
| 13504 | gint _tmp882_; |
| 13505 | gint _tmp883_; |
| 13506 | gint _postcondition_index = 0; |
| 13507 | _tmp878_ = m; |
| 13508 | _tmp879_ = bala_method_get_postconditions (_tmp878_); |
| 13509 | _tmp880_ = _bala_iterable_ref0 (_tmp879_); |
| 13510 | _postcondition_list = _tmp880_; |
| 13511 | _tmp881_ = _postcondition_list; |
| 13512 | _tmp882_ = bala_collection_get_size ((BalaCollection*) _tmp881_); |
| 13513 | _tmp883_ = _tmp882_; |
| 13514 | _postcondition_size = _tmp883_; |
| 13515 | _postcondition_index = -1; |
| 13516 | while (TRUE(!(0))) { |
| 13517 | gint _tmp884_; |
| 13518 | gint _tmp885_; |
| 13519 | BalaExpression* postcondition = NULL((void*)0); |
| 13520 | BalaList* _tmp886_; |
| 13521 | gpointer _tmp887_; |
| 13522 | BalaExpression* _tmp888_; |
| 13523 | _postcondition_index = _postcondition_index + 1; |
| 13524 | _tmp884_ = _postcondition_index; |
| 13525 | _tmp885_ = _postcondition_size; |
| 13526 | if (!(_tmp884_ < _tmp885_)) { |
| 13527 | break; |
| 13528 | } |
| 13529 | _tmp886_ = _postcondition_list; |
| 13530 | _tmp887_ = bala_list_get (_tmp886_, _postcondition_index); |
| 13531 | postcondition = (BalaExpression*) _tmp887_; |
| 13532 | _tmp888_ = postcondition; |
| 13533 | bala_ccode_base_module_create_postcondition_statement (self, _tmp888_); |
| 13534 | _bala_code_node_unref0 (postcondition)((postcondition == ((void*)0)) ? ((void*)0) : (postcondition = (bala_code_node_unref (postcondition), ((void*)0)))); |
| 13535 | } |
| 13536 | _bala_iterable_unref0 (_postcondition_list)((_postcondition_list == ((void*)0)) ? ((void*)0) : (_postcondition_list = (bala_iterable_unref (_postcondition_list), ((void*)0)))); |
| 13537 | } |
| 13538 | } |
| 13539 | { |
| 13540 | gint i = 0; |
| 13541 | BalaList* _tmp889_; |
| 13542 | gint _tmp890_; |
| 13543 | gint _tmp891_; |
| 13544 | _tmp889_ = local_vars; |
| 13545 | _tmp890_ = bala_collection_get_size ((BalaCollection*) _tmp889_); |
| 13546 | _tmp891_ = _tmp890_; |
| 13547 | i = _tmp891_ - 1; |
| 13548 | { |
| 13549 | gboolean _tmp892_ = FALSE(0); |
| 13550 | _tmp892_ = TRUE(!(0)); |
| 13551 | while (TRUE(!(0))) { |
| 13552 | BalaLocalVariable* local = NULL((void*)0); |
| 13553 | BalaList* _tmp894_; |
| 13554 | gpointer _tmp895_; |
| 13555 | BalaLocalVariable* _tmp896_; |
| 13556 | gboolean _tmp897_ = FALSE(0); |
| 13557 | gboolean _tmp898_ = FALSE(0); |
| 13558 | BalaLocalVariable* _tmp899_; |
| 13559 | gboolean _tmp900_; |
| 13560 | gboolean _tmp901_; |
| 13561 | if (!_tmp892_) { |
| 13562 | gint _tmp893_; |
| 13563 | _tmp893_ = i; |
| 13564 | i = _tmp893_ - 1; |
| 13565 | } |
| 13566 | _tmp892_ = FALSE(0); |
| 13567 | if (!(i >= 0)) { |
| 13568 | break; |
| 13569 | } |
| 13570 | _tmp894_ = local_vars; |
| 13571 | _tmp895_ = bala_list_get (_tmp894_, i); |
| 13572 | local = (BalaLocalVariable*) _tmp895_; |
| 13573 | _tmp896_ = local; |
| 13574 | bala_symbol_set_active ((BalaSymbol*) _tmp896_, FALSE(0)); |
| 13575 | _tmp899_ = local; |
| 13576 | _tmp900_ = bala_code_node_get_unreachable ((BalaCodeNode*) _tmp899_); |
| 13577 | _tmp901_ = _tmp900_; |
| 13578 | if (!_tmp901_) { |
| 13579 | BalaLocalVariable* _tmp902_; |
| 13580 | gboolean _tmp903_; |
| 13581 | gboolean _tmp904_; |
| 13582 | _tmp902_ = local; |
| 13583 | _tmp903_ = bala_local_variable_get_captured (_tmp902_); |
| 13584 | _tmp904_ = _tmp903_; |
| 13585 | _tmp898_ = !_tmp904_; |
| 13586 | } else { |
| 13587 | _tmp898_ = FALSE(0); |
| 13588 | } |
| 13589 | if (_tmp898_) { |
| 13590 | BalaLocalVariable* _tmp905_; |
| 13591 | BalaDataType* _tmp906_; |
| 13592 | BalaDataType* _tmp907_; |
| 13593 | _tmp905_ = local; |
| 13594 | _tmp906_ = bala_variable_get_variable_type ((BalaVariable*) _tmp905_); |
| 13595 | _tmp907_ = _tmp906_; |
| 13596 | _tmp897_ = bala_ccode_base_module_requires_destroy (_tmp907_); |
| 13597 | } else { |
| 13598 | _tmp897_ = FALSE(0); |
| 13599 | } |
| 13600 | if (_tmp897_) { |
| 13601 | BalaCCodeFunction* _tmp908_; |
| 13602 | BalaCCodeFunction* _tmp909_; |
| 13603 | BalaLocalVariable* _tmp910_; |
| 13604 | BalaCCodeExpression* _tmp911_; |
| 13605 | BalaCCodeExpression* _tmp912_; |
| 13606 | _tmp908_ = bala_ccode_base_module_get_ccode (self); |
| 13607 | _tmp909_ = _tmp908_; |
| 13608 | _tmp910_ = local; |
| 13609 | _tmp911_ = bala_ccode_base_module_destroy_local (self, _tmp910_); |
| 13610 | _tmp912_ = _tmp911_; |
| 13611 | bala_ccode_function_add_expression (_tmp909_, _tmp912_); |
| 13612 | _bala_ccode_node_unref0 (_tmp912_)((_tmp912_ == ((void*)0)) ? ((void*)0) : (_tmp912_ = (bala_ccode_node_unref (_tmp912_), ((void*)0)))); |
| 13613 | } |
| 13614 | _bala_code_node_unref0 (local)((local == ((void*)0)) ? ((void*)0) : (local = (bala_code_node_unref (local), ((void*)0)))); |
| 13615 | } |
| 13616 | } |
| 13617 | } |
| 13618 | _tmp913_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 13619 | _tmp914_ = _tmp913_; |
| 13620 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp914_, BALA_TYPE_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp914_); GType __t = ((bala_method_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 13621 | BalaMethod* m = NULL((void*)0); |
| 13622 | BalaSymbol* _tmp915_; |
| 13623 | BalaSymbol* _tmp916_; |
| 13624 | BalaMethod* _tmp917_; |
| 13625 | _tmp915_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 13626 | _tmp916_ = _tmp915_; |
| 13627 | _tmp917_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp916_, BALA_TYPE_METHOD, BalaMethod)(((BalaMethod*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp916_), ((bala_method_get_type ())))))); |
| 13628 | m = _tmp917_; |
| 13629 | { |
| 13630 | BalaList* _param_list = NULL((void*)0); |
| 13631 | BalaMethod* _tmp918_; |
| 13632 | BalaList* _tmp919_; |
| 13633 | BalaList* _tmp920_; |
| 13634 | gint _param_size = 0; |
| 13635 | BalaList* _tmp921_; |
| 13636 | gint _tmp922_; |
| 13637 | gint _tmp923_; |
| 13638 | gint _param_index = 0; |
| 13639 | _tmp918_ = m; |
| 13640 | _tmp919_ = bala_callable_get_parameters ((BalaCallable*) _tmp918_); |
| 13641 | _tmp920_ = _bala_iterable_ref0 (_tmp919_); |
| 13642 | _param_list = _tmp920_; |
| 13643 | _tmp921_ = _param_list; |
| 13644 | _tmp922_ = bala_collection_get_size ((BalaCollection*) _tmp921_); |
| 13645 | _tmp923_ = _tmp922_; |
| 13646 | _param_size = _tmp923_; |
| 13647 | _param_index = -1; |
| 13648 | while (TRUE(!(0))) { |
| 13649 | gint _tmp924_; |
| 13650 | gint _tmp925_; |
| 13651 | BalaParameter* param = NULL((void*)0); |
| 13652 | BalaList* _tmp926_; |
| 13653 | gpointer _tmp927_; |
| 13654 | gboolean _tmp928_ = FALSE(0); |
| 13655 | gboolean _tmp929_ = FALSE(0); |
| 13656 | gboolean _tmp930_ = FALSE(0); |
| 13657 | gboolean _tmp931_ = FALSE(0); |
| 13658 | BalaParameter* _tmp932_; |
| 13659 | gboolean _tmp933_; |
| 13660 | gboolean _tmp934_; |
| 13661 | _param_index = _param_index + 1; |
| 13662 | _tmp924_ = _param_index; |
| 13663 | _tmp925_ = _param_size; |
| 13664 | if (!(_tmp924_ < _tmp925_)) { |
| 13665 | break; |
| 13666 | } |
| 13667 | _tmp926_ = _param_list; |
| 13668 | _tmp927_ = bala_list_get (_tmp926_, _param_index); |
| 13669 | param = (BalaParameter*) _tmp927_; |
| 13670 | _tmp932_ = param; |
| 13671 | _tmp933_ = bala_parameter_get_captured (_tmp932_); |
| 13672 | _tmp934_ = _tmp933_; |
| 13673 | if (!_tmp934_) { |
| 13674 | BalaParameter* _tmp935_; |
| 13675 | gboolean _tmp936_; |
| 13676 | gboolean _tmp937_; |
| 13677 | _tmp935_ = param; |
| 13678 | _tmp936_ = bala_parameter_get_ellipsis (_tmp935_); |
| 13679 | _tmp937_ = _tmp936_; |
| 13680 | _tmp931_ = !_tmp937_; |
| 13681 | } else { |
| 13682 | _tmp931_ = FALSE(0); |
| 13683 | } |
| 13684 | if (_tmp931_) { |
| 13685 | BalaParameter* _tmp938_; |
| 13686 | gboolean _tmp939_; |
| 13687 | gboolean _tmp940_; |
| 13688 | _tmp938_ = param; |
| 13689 | _tmp939_ = bala_parameter_get_params_array (_tmp938_); |
| 13690 | _tmp940_ = _tmp939_; |
| 13691 | _tmp930_ = !_tmp940_; |
| 13692 | } else { |
| 13693 | _tmp930_ = FALSE(0); |
| 13694 | } |
| 13695 | if (_tmp930_) { |
| 13696 | BalaParameter* _tmp941_; |
| 13697 | BalaDataType* _tmp942_; |
| 13698 | BalaDataType* _tmp943_; |
| 13699 | _tmp941_ = param; |
| 13700 | _tmp942_ = bala_variable_get_variable_type ((BalaVariable*) _tmp941_); |
| 13701 | _tmp943_ = _tmp942_; |
| 13702 | _tmp929_ = bala_ccode_base_module_requires_destroy (_tmp943_); |
| 13703 | } else { |
| 13704 | _tmp929_ = FALSE(0); |
| 13705 | } |
| 13706 | if (_tmp929_) { |
| 13707 | BalaParameter* _tmp944_; |
| 13708 | BalaParameterDirection _tmp945_; |
| 13709 | BalaParameterDirection _tmp946_; |
| 13710 | _tmp944_ = param; |
| 13711 | _tmp945_ = bala_parameter_get_direction (_tmp944_); |
| 13712 | _tmp946_ = _tmp945_; |
| 13713 | _tmp928_ = _tmp946_ == BALA_PARAMETER_DIRECTION_IN; |
| 13714 | } else { |
| 13715 | _tmp928_ = FALSE(0); |
| 13716 | } |
| 13717 | if (_tmp928_) { |
| 13718 | BalaCCodeFunction* _tmp947_; |
| 13719 | BalaCCodeFunction* _tmp948_; |
| 13720 | BalaParameter* _tmp949_; |
| 13721 | BalaCCodeExpression* _tmp950_; |
| 13722 | BalaCCodeExpression* _tmp951_; |
| 13723 | _tmp947_ = bala_ccode_base_module_get_ccode (self); |
| 13724 | _tmp948_ = _tmp947_; |
| 13725 | _tmp949_ = param; |
| 13726 | _tmp950_ = bala_ccode_base_module_destroy_parameter (self, _tmp949_); |
| 13727 | _tmp951_ = _tmp950_; |
| 13728 | bala_ccode_function_add_expression (_tmp948_, _tmp951_); |
| 13729 | _bala_ccode_node_unref0 (_tmp951_)((_tmp951_ == ((void*)0)) ? ((void*)0) : (_tmp951_ = (bala_ccode_node_unref (_tmp951_), ((void*)0)))); |
| 13730 | } else { |
| 13731 | gboolean _tmp952_ = FALSE(0); |
| 13732 | BalaParameter* _tmp953_; |
| 13733 | BalaParameterDirection _tmp954_; |
| 13734 | BalaParameterDirection _tmp955_; |
| 13735 | _tmp953_ = param; |
| 13736 | _tmp954_ = bala_parameter_get_direction (_tmp953_); |
| 13737 | _tmp955_ = _tmp954_; |
| 13738 | if (_tmp955_ == BALA_PARAMETER_DIRECTION_OUT) { |
| 13739 | BalaMethod* _tmp956_; |
| 13740 | gboolean _tmp957_; |
| 13741 | gboolean _tmp958_; |
| 13742 | _tmp956_ = m; |
| 13743 | _tmp957_ = bala_method_get_coroutine (_tmp956_); |
| 13744 | _tmp958_ = _tmp957_; |
| 13745 | _tmp952_ = !_tmp958_; |
| 13746 | } else { |
| 13747 | _tmp952_ = FALSE(0); |
| 13748 | } |
| 13749 | if (_tmp952_) { |
| 13750 | BalaParameter* _tmp959_; |
| 13751 | _tmp959_ = param; |
| 13752 | bala_ccode_base_module_return_out_parameter (self, _tmp959_); |
| 13753 | } |
| 13754 | } |
| 13755 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 13756 | } |
| 13757 | _bala_iterable_unref0 (_param_list)((_param_list == ((void*)0)) ? ((void*)0) : (_param_list = (bala_iterable_unref (_param_list), ((void*)0)))); |
| 13758 | } |
| 13759 | _bala_code_node_unref0 (m)((m == ((void*)0)) ? ((void*)0) : (m = (bala_code_node_unref ( m), ((void*)0)))); |
| 13760 | } else { |
| 13761 | BalaSymbol* _tmp960_; |
| 13762 | BalaSymbol* _tmp961_; |
| 13763 | _tmp960_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 13764 | _tmp961_ = _tmp960_; |
| 13765 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp961_, BALA_TYPE_PROPERTY_ACCESSOR)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp961_); GType __t = ((bala_property_accessor_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 13766 | BalaPropertyAccessor* acc = NULL((void*)0); |
| 13767 | BalaSymbol* _tmp962_; |
| 13768 | BalaSymbol* _tmp963_; |
| 13769 | BalaPropertyAccessor* _tmp964_; |
| 13770 | gboolean _tmp965_ = FALSE(0); |
| 13771 | gboolean _tmp966_ = FALSE(0); |
| 13772 | BalaPropertyAccessor* _tmp967_; |
| 13773 | BalaParameter* _tmp968_; |
| 13774 | BalaParameter* _tmp969_; |
| 13775 | _tmp962_ = bala_symbol_get_parent_symbol ((BalaSymbol*) b); |
| 13776 | _tmp963_ = _tmp962_; |
| 13777 | _tmp964_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp963_, BALA_TYPE_PROPERTY_ACCESSOR, BalaPropertyAccessor)(((BalaPropertyAccessor*) g_type_check_instance_cast ((GTypeInstance *) (_tmp963_), ((bala_property_accessor_get_type ())))))); |
| 13778 | acc = _tmp964_; |
| 13779 | _tmp967_ = acc; |
| 13780 | _tmp968_ = bala_property_accessor_get_value_parameter (_tmp967_); |
| 13781 | _tmp969_ = _tmp968_; |
| 13782 | if (_tmp969_ != NULL((void*)0)) { |
| 13783 | BalaPropertyAccessor* _tmp970_; |
| 13784 | BalaParameter* _tmp971_; |
| 13785 | BalaParameter* _tmp972_; |
| 13786 | gboolean _tmp973_; |
| 13787 | gboolean _tmp974_; |
| 13788 | _tmp970_ = acc; |
| 13789 | _tmp971_ = bala_property_accessor_get_value_parameter (_tmp970_); |
| 13790 | _tmp972_ = _tmp971_; |
| 13791 | _tmp973_ = bala_parameter_get_captured (_tmp972_); |
| 13792 | _tmp974_ = _tmp973_; |
| 13793 | _tmp966_ = !_tmp974_; |
| 13794 | } else { |
| 13795 | _tmp966_ = FALSE(0); |
| 13796 | } |
| 13797 | if (_tmp966_) { |
| 13798 | BalaPropertyAccessor* _tmp975_; |
| 13799 | BalaParameter* _tmp976_; |
| 13800 | BalaParameter* _tmp977_; |
| 13801 | BalaDataType* _tmp978_; |
| 13802 | BalaDataType* _tmp979_; |
| 13803 | _tmp975_ = acc; |
| 13804 | _tmp976_ = bala_property_accessor_get_value_parameter (_tmp975_); |
| 13805 | _tmp977_ = _tmp976_; |
| 13806 | _tmp978_ = bala_variable_get_variable_type ((BalaVariable*) _tmp977_); |
| 13807 | _tmp979_ = _tmp978_; |
| 13808 | _tmp965_ = bala_ccode_base_module_requires_destroy (_tmp979_); |
| 13809 | } else { |
| 13810 | _tmp965_ = FALSE(0); |
| 13811 | } |
| 13812 | if (_tmp965_) { |
| 13813 | BalaCCodeFunction* _tmp980_; |
| 13814 | BalaCCodeFunction* _tmp981_; |
| 13815 | BalaPropertyAccessor* _tmp982_; |
| 13816 | BalaParameter* _tmp983_; |
| 13817 | BalaParameter* _tmp984_; |
| 13818 | BalaCCodeExpression* _tmp985_; |
| 13819 | BalaCCodeExpression* _tmp986_; |
| 13820 | _tmp980_ = bala_ccode_base_module_get_ccode (self); |
| 13821 | _tmp981_ = _tmp980_; |
| 13822 | _tmp982_ = acc; |
| 13823 | _tmp983_ = bala_property_accessor_get_value_parameter (_tmp982_); |
| 13824 | _tmp984_ = _tmp983_; |
| 13825 | _tmp985_ = bala_ccode_base_module_destroy_parameter (self, _tmp984_); |
| 13826 | _tmp986_ = _tmp985_; |
| 13827 | bala_ccode_function_add_expression (_tmp981_, _tmp986_); |
| 13828 | _bala_ccode_node_unref0 (_tmp986_)((_tmp986_ == ((void*)0)) ? ((void*)0) : (_tmp986_ = (bala_ccode_node_unref (_tmp986_), ((void*)0)))); |
| 13829 | } |
| 13830 | _bala_code_node_unref0 (acc)((acc == ((void*)0)) ? ((void*)0) : (acc = (bala_code_node_unref (acc), ((void*)0)))); |
| 13831 | } |
| 13832 | } |
| 13833 | _tmp987_ = bala_block_get_captured (b); |
| 13834 | _tmp988_ = _tmp987_; |
| 13835 | if (_tmp988_) { |
| 13836 | gint block_id = 0; |
| 13837 | BalaCCodeFunctionCall* data_unref = NULL((void*)0); |
| 13838 | gchar* _tmp989_; |
| 13839 | gchar* _tmp990_; |
| 13840 | BalaCCodeIdentifier* _tmp991_; |
| 13841 | BalaCCodeIdentifier* _tmp992_; |
| 13842 | BalaCCodeFunctionCall* _tmp993_; |
| 13843 | BalaCCodeFunctionCall* _tmp994_; |
| 13844 | BalaCCodeFunctionCall* _tmp995_; |
| 13845 | gchar* _tmp996_; |
| 13846 | gchar* _tmp997_; |
| 13847 | BalaCCodeExpression* _tmp998_; |
| 13848 | BalaCCodeExpression* _tmp999_; |
| 13849 | BalaCCodeFunction* _tmp1000_; |
| 13850 | BalaCCodeFunction* _tmp1001_; |
| 13851 | BalaCCodeFunctionCall* _tmp1002_; |
| 13852 | BalaCCodeFunction* _tmp1003_; |
| 13853 | BalaCCodeFunction* _tmp1004_; |
| 13854 | gchar* _tmp1005_; |
| 13855 | gchar* _tmp1006_; |
| 13856 | BalaCCodeExpression* _tmp1007_; |
| 13857 | BalaCCodeExpression* _tmp1008_; |
| 13858 | BalaCCodeConstant* _tmp1009_; |
| 13859 | BalaCCodeConstant* _tmp1010_; |
| 13860 | block_id = bala_ccode_base_module_get_block_id (self, b); |
| 13861 | _tmp989_ = g_strdup_printf ("block%d_data_unref", block_id); |
| 13862 | _tmp990_ = _tmp989_; |
| 13863 | _tmp991_ = bala_ccode_identifier_new (_tmp990_); |
| 13864 | _tmp992_ = _tmp991_; |
| 13865 | _tmp993_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp992_); |
| 13866 | _tmp994_ = _tmp993_; |
| 13867 | _bala_ccode_node_unref0 (_tmp992_)((_tmp992_ == ((void*)0)) ? ((void*)0) : (_tmp992_ = (bala_ccode_node_unref (_tmp992_), ((void*)0)))); |
| 13868 | _g_free0 (_tmp990_)(_tmp990_ = (g_free (_tmp990_), ((void*)0))); |
| 13869 | data_unref = _tmp994_; |
| 13870 | _tmp995_ = data_unref; |
| 13871 | _tmp996_ = g_strdup_printf ("_data%d_", block_id); |
| 13872 | _tmp997_ = _tmp996_; |
| 13873 | _tmp998_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp997_); |
| 13874 | _tmp999_ = _tmp998_; |
| 13875 | bala_ccode_function_call_add_argument (_tmp995_, _tmp999_); |
| 13876 | _bala_ccode_node_unref0 (_tmp999_)((_tmp999_ == ((void*)0)) ? ((void*)0) : (_tmp999_ = (bala_ccode_node_unref (_tmp999_), ((void*)0)))); |
| 13877 | _g_free0 (_tmp997_)(_tmp997_ = (g_free (_tmp997_), ((void*)0))); |
| 13878 | _tmp1000_ = bala_ccode_base_module_get_ccode (self); |
| 13879 | _tmp1001_ = _tmp1000_; |
| 13880 | _tmp1002_ = data_unref; |
| 13881 | bala_ccode_function_add_expression (_tmp1001_, (BalaCCodeExpression*) _tmp1002_); |
| 13882 | _tmp1003_ = bala_ccode_base_module_get_ccode (self); |
| 13883 | _tmp1004_ = _tmp1003_; |
| 13884 | _tmp1005_ = g_strdup_printf ("_data%d_", block_id); |
| 13885 | _tmp1006_ = _tmp1005_; |
| 13886 | _tmp1007_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp1006_); |
| 13887 | _tmp1008_ = _tmp1007_; |
| 13888 | _tmp1009_ = bala_ccode_constant_new ("NULL"); |
| 13889 | _tmp1010_ = _tmp1009_; |
| 13890 | bala_ccode_function_add_assignment (_tmp1004_, _tmp1008_, (BalaCCodeExpression*) _tmp1010_); |
| 13891 | _bala_ccode_node_unref0 (_tmp1010_)((_tmp1010_ == ((void*)0)) ? ((void*)0) : (_tmp1010_ = (bala_ccode_node_unref (_tmp1010_), ((void*)0)))); |
| 13892 | _bala_ccode_node_unref0 (_tmp1008_)((_tmp1008_ == ((void*)0)) ? ((void*)0) : (_tmp1008_ = (bala_ccode_node_unref (_tmp1008_), ((void*)0)))); |
| 13893 | _g_free0 (_tmp1006_)(_tmp1006_ = (g_free (_tmp1006_), ((void*)0))); |
| 13894 | _bala_ccode_node_unref0 (data_unref)((data_unref == ((void*)0)) ? ((void*)0) : (data_unref = (bala_ccode_node_unref (data_unref), ((void*)0)))); |
| 13895 | } |
| 13896 | } |
| 13897 | _tmp1013_ = bala_code_node_get_parent_node ((BalaCodeNode*) b); |
| 13898 | _tmp1014_ = _tmp1013_; |
| 13899 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1014_, BALA_TYPE_BLOCK)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1014_); GType __t = ((bala_block_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 13900 | _tmp1012_ = TRUE(!(0)); |
| 13901 | } else { |
| 13902 | BalaCodeNode* _tmp1015_; |
| 13903 | BalaCodeNode* _tmp1016_; |
| 13904 | _tmp1015_ = bala_code_node_get_parent_node ((BalaCodeNode*) b); |
| 13905 | _tmp1016_ = _tmp1015_; |
| 13906 | _tmp1012_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1016_, BALA_TYPE_SWITCH_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1016_); GType __t = ((bala_switch_statement_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } ))); |
| 13907 | } |
| 13908 | if (_tmp1012_) { |
| 13909 | _tmp1011_ = TRUE(!(0)); |
| 13910 | } else { |
| 13911 | BalaCodeNode* _tmp1017_; |
| 13912 | BalaCodeNode* _tmp1018_; |
| 13913 | _tmp1017_ = bala_code_node_get_parent_node ((BalaCodeNode*) b); |
| 13914 | _tmp1018_ = _tmp1017_; |
| 13915 | _tmp1011_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1018_, BALA_TYPE_TRY_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1018_); GType __t = ((bala_try_statement_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 13916 | } |
| 13917 | if (_tmp1011_) { |
| 13918 | BalaCCodeFunction* _tmp1019_; |
| 13919 | BalaCCodeFunction* _tmp1020_; |
| 13920 | _tmp1019_ = bala_ccode_base_module_get_ccode (self); |
| 13921 | _tmp1020_ = _tmp1019_; |
| 13922 | bala_ccode_function_close (_tmp1020_); |
| 13923 | } |
| 13924 | _tmp1021_ = self->emit_context; |
| 13925 | bala_ccode_base_module_emit_context_pop_symbol (_tmp1021_); |
| 13926 | _bala_iterable_unref0 (local_vars)((local_vars == ((void*)0)) ? ((void*)0) : (local_vars = (bala_iterable_unref (local_vars), ((void*)0)))); |
| 13927 | } |
| 13928 | |
| 13929 | static void |
| 13930 | bala_ccode_base_module_real_visit_declaration_statement (BalaCodeVisitor* base, |
| 13931 | BalaDeclarationStatement* stmt) |
| 13932 | { |
| 13933 | BalaCCodeBaseModule * self; |
| 13934 | BalaSymbol* _tmp0_; |
| 13935 | BalaSymbol* _tmp1_; |
| 13936 | self = (BalaCCodeBaseModule*) base; |
| 13937 | g_return_if_fail (stmt != NULL)do { if ((stmt != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "stmt != NULL" ); return; } } while (0); |
| 13938 | _tmp0_ = bala_declaration_statement_get_declaration (stmt); |
| 13939 | _tmp1_ = _tmp0_; |
| 13940 | bala_code_node_accept ((BalaCodeNode*) _tmp1_, (BalaCodeVisitor*) self); |
| 13941 | } |
| 13942 | |
| 13943 | BalaCCodeExpression* |
| 13944 | bala_ccode_base_module_get_cexpression (BalaCCodeBaseModule* self, |
| 13945 | const gchar* name) |
| 13946 | { |
| 13947 | BalaCCodeExpression* result = NULL((void*)0); |
| 13948 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 13949 | g_return_val_if_fail (name != NULL, NULL)do { if ((name != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "name != NULL" ); return (((void*)0)); } } while (0); |
| 13950 | if (bala_ccode_base_module_is_in_coroutine (self)) { |
| 13951 | BalaCCodeIdentifier* _tmp0_; |
| 13952 | BalaCCodeIdentifier* _tmp1_; |
| 13953 | BalaCCodeMemberAccess* _tmp2_; |
| 13954 | BalaCCodeExpression* _tmp3_; |
| 13955 | _tmp0_ = bala_ccode_identifier_new ("_data_"); |
| 13956 | _tmp1_ = _tmp0_; |
| 13957 | _tmp2_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp1_, name); |
| 13958 | _tmp3_ = (BalaCCodeExpression*) _tmp2_; |
| 13959 | _bala_ccode_node_unref0 (_tmp1_)((_tmp1_ == ((void*)0)) ? ((void*)0) : (_tmp1_ = (bala_ccode_node_unref (_tmp1_), ((void*)0)))); |
| 13960 | result = _tmp3_; |
| 13961 | return result; |
| 13962 | } else { |
| 13963 | BalaCCodeIdentifier* _tmp4_; |
| 13964 | _tmp4_ = bala_ccode_identifier_new (name); |
| 13965 | result = (BalaCCodeExpression*) _tmp4_; |
| 13966 | return result; |
| 13967 | } |
| 13968 | } |
| 13969 | |
| 13970 | BalaCCodeExpression* |
| 13971 | bala_ccode_base_module_get_local_cexpression (BalaCCodeBaseModule* self, |
| 13972 | BalaLocalVariable* local) |
| 13973 | { |
| 13974 | gchar* _tmp0_; |
| 13975 | gchar* _tmp1_; |
| 13976 | BalaCCodeExpression* _tmp2_; |
| 13977 | BalaCCodeExpression* _tmp3_; |
| 13978 | BalaCCodeExpression* result = NULL((void*)0); |
| 13979 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 13980 | g_return_val_if_fail (local != NULL, NULL)do { if ((local != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "local != NULL" ); return (((void*)0)); } } while (0); |
| 13981 | _tmp0_ = bala_ccode_base_module_get_local_cname (self, local); |
| 13982 | _tmp1_ = _tmp0_; |
| 13983 | _tmp2_ = bala_ccode_base_module_get_cexpression (self, _tmp1_); |
| 13984 | _tmp3_ = _tmp2_; |
| 13985 | _g_free0 (_tmp1_)(_tmp1_ = (g_free (_tmp1_), ((void*)0))); |
| 13986 | result = _tmp3_; |
| 13987 | return result; |
| 13988 | } |
| 13989 | |
| 13990 | BalaCCodeExpression* |
| 13991 | bala_ccode_base_module_get_parameter_cexpression (BalaCCodeBaseModule* self, |
| 13992 | BalaParameter* param) |
| 13993 | { |
| 13994 | gchar* _tmp0_; |
| 13995 | gchar* _tmp1_; |
| 13996 | BalaCCodeExpression* _tmp2_; |
| 13997 | BalaCCodeExpression* _tmp3_; |
| 13998 | BalaCCodeExpression* result = NULL((void*)0); |
| 13999 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 14000 | g_return_val_if_fail (param != NULL, NULL)do { if ((param != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "param != NULL" ); return (((void*)0)); } } while (0); |
| 14001 | _tmp0_ = bala_get_ccode_name ((BalaCodeNode*) param); |
| 14002 | _tmp1_ = _tmp0_; |
| 14003 | _tmp2_ = bala_ccode_base_module_get_cexpression (self, _tmp1_); |
| 14004 | _tmp3_ = _tmp2_; |
| 14005 | _g_free0 (_tmp1_)(_tmp1_ = (g_free (_tmp1_), ((void*)0))); |
| 14006 | result = _tmp3_; |
| 14007 | return result; |
| 14008 | } |
| 14009 | |
| 14010 | BalaCCodeExpression* |
| 14011 | bala_ccode_base_module_get_variable_cexpression (BalaCCodeBaseModule* self, |
| 14012 | const gchar* name) |
| 14013 | { |
| 14014 | gchar* _tmp0_; |
| 14015 | gchar* _tmp1_; |
| 14016 | BalaCCodeExpression* _tmp2_; |
| 14017 | BalaCCodeExpression* _tmp3_; |
| 14018 | BalaCCodeExpression* result = NULL((void*)0); |
| 14019 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 14020 | g_return_val_if_fail (name != NULL, NULL)do { if ((name != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "name != NULL" ); return (((void*)0)); } } while (0); |
| 14021 | _tmp0_ = bala_ccode_base_module_get_variable_cname (self, name); |
| 14022 | _tmp1_ = _tmp0_; |
| 14023 | _tmp2_ = bala_ccode_base_module_get_cexpression (self, _tmp1_); |
| 14024 | _tmp3_ = _tmp2_; |
| 14025 | _g_free0 (_tmp1_)(_tmp1_ = (g_free (_tmp1_), ((void*)0))); |
| 14026 | result = _tmp3_; |
| 14027 | return result; |
| 14028 | } |
| 14029 | |
| 14030 | BalaCCodeExpression* |
| 14031 | bala_ccode_base_module_get_this_cexpression (BalaCCodeBaseModule* self) |
| 14032 | { |
| 14033 | BalaCCodeExpression* _tmp0_; |
| 14034 | BalaCCodeExpression* result = NULL((void*)0); |
| 14035 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 14036 | _tmp0_ = bala_ccode_base_module_get_cexpression (self, "self"); |
| 14037 | result = _tmp0_; |
| 14038 | return result; |
| 14039 | } |
| 14040 | |
| 14041 | BalaCCodeExpression* |
| 14042 | bala_ccode_base_module_get_this_interface_cexpression (BalaCCodeBaseModule* self, |
| 14043 | BalaInterface* iface) |
| 14044 | { |
| 14045 | BalaClass* _tmp0_; |
| 14046 | BalaClass* _tmp1_; |
| 14047 | BalaClass* _tmp12_; |
| 14048 | BalaClass* _tmp13_; |
| 14049 | BalaCCodeFunctionCall* vcast = NULL((void*)0); |
| 14050 | BalaCCodeIdentifier* _tmp26_; |
| 14051 | BalaCCodeIdentifier* _tmp27_; |
| 14052 | BalaCCodeFunctionCall* _tmp28_; |
| 14053 | BalaCCodeFunctionCall* _tmp29_; |
| 14054 | BalaCCodeFunctionCall* _tmp30_; |
| 14055 | BalaCCodeExpression* _tmp31_; |
| 14056 | BalaCCodeExpression* _tmp32_; |
| 14057 | BalaCCodeFunctionCall* _tmp33_; |
| 14058 | gchar* _tmp34_; |
| 14059 | gchar* _tmp35_; |
| 14060 | BalaCCodeIdentifier* _tmp36_; |
| 14061 | BalaCCodeIdentifier* _tmp37_; |
| 14062 | BalaCCodeFunctionCall* _tmp38_; |
| 14063 | gchar* _tmp39_; |
| 14064 | gchar* _tmp40_; |
| 14065 | BalaCCodeIdentifier* _tmp41_; |
| 14066 | BalaCCodeIdentifier* _tmp42_; |
| 14067 | BalaCCodeExpression* result = NULL((void*)0); |
| 14068 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 14069 | g_return_val_if_fail (iface != NULL, NULL)do { if ((iface != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "iface != NULL" ); return (((void*)0)); } } while (0); |
| 14070 | _tmp0_ = bala_ccode_base_module_get_current_class (self); |
| 14071 | _tmp1_ = _tmp0_; |
| 14072 | if (bala_class_implements (_tmp1_, iface)) { |
| 14073 | BalaClass* _tmp2_; |
| 14074 | BalaClass* _tmp3_; |
| 14075 | gchar* _tmp4_; |
| 14076 | gchar* _tmp5_; |
| 14077 | gchar* _tmp6_; |
| 14078 | gchar* _tmp7_; |
| 14079 | gchar* _tmp8_; |
| 14080 | gchar* _tmp9_; |
| 14081 | BalaCCodeIdentifier* _tmp10_; |
| 14082 | BalaCCodeExpression* _tmp11_; |
| 14083 | _tmp2_ = bala_ccode_base_module_get_current_class (self); |
| 14084 | _tmp3_ = _tmp2_; |
| 14085 | _tmp4_ = bala_get_ccode_lower_case_name ((BalaCodeNode*) _tmp3_, NULL((void*)0)); |
| 14086 | _tmp5_ = _tmp4_; |
| 14087 | _tmp6_ = bala_get_ccode_lower_case_name ((BalaCodeNode*) iface, NULL((void*)0)); |
| 14088 | _tmp7_ = _tmp6_; |
| 14089 | _tmp8_ = g_strdup_printf ("%s_%s_parent_iface", _tmp5_, _tmp7_); |
| 14090 | _tmp9_ = _tmp8_; |
| 14091 | _tmp10_ = bala_ccode_identifier_new (_tmp9_); |
| 14092 | _tmp11_ = (BalaCCodeExpression*) _tmp10_; |
| 14093 | _g_free0 (_tmp9_)(_tmp9_ = (g_free (_tmp9_), ((void*)0))); |
| 14094 | _g_free0 (_tmp7_)(_tmp7_ = (g_free (_tmp7_), ((void*)0))); |
| 14095 | _g_free0 (_tmp5_)(_tmp5_ = (g_free (_tmp5_), ((void*)0))); |
| 14096 | result = _tmp11_; |
| 14097 | return result; |
| 14098 | } |
| 14099 | _tmp12_ = bala_ccode_base_module_get_current_class (self); |
| 14100 | _tmp13_ = _tmp12_; |
| 14101 | if (!bala_class_is_a (_tmp13_, (BalaObjectTypeSymbol*) iface)) { |
| 14102 | BalaClass* _tmp14_; |
| 14103 | BalaClass* _tmp15_; |
| 14104 | BalaSourceReference* _tmp16_; |
| 14105 | BalaSourceReference* _tmp17_; |
| 14106 | BalaClass* _tmp18_; |
| 14107 | BalaClass* _tmp19_; |
| 14108 | gchar* _tmp20_; |
| 14109 | gchar* _tmp21_; |
| 14110 | gchar* _tmp22_; |
| 14111 | gchar* _tmp23_; |
| 14112 | gchar* _tmp24_; |
| 14113 | gchar* _tmp25_; |
| 14114 | _tmp14_ = bala_ccode_base_module_get_current_class (self); |
| 14115 | _tmp15_ = _tmp14_; |
| 14116 | _tmp16_ = bala_code_node_get_source_reference ((BalaCodeNode*) _tmp15_); |
| 14117 | _tmp17_ = _tmp16_; |
| 14118 | _tmp18_ = bala_ccode_base_module_get_current_class (self); |
| 14119 | _tmp19_ = _tmp18_; |
| 14120 | _tmp20_ = bala_symbol_get_full_name ((BalaSymbol*) _tmp19_); |
| 14121 | _tmp21_ = _tmp20_; |
| 14122 | _tmp22_ = bala_symbol_get_full_name ((BalaSymbol*) iface); |
| 14123 | _tmp23_ = _tmp22_; |
| 14124 | _tmp24_ = g_strdup_printf ("internal: `%s' is not a `%s'", _tmp21_, _tmp23_); |
| 14125 | _tmp25_ = _tmp24_; |
| 14126 | bala_report_warning (_tmp17_, _tmp25_); |
| 14127 | _g_free0 (_tmp25_)(_tmp25_ = (g_free (_tmp25_), ((void*)0))); |
| 14128 | _g_free0 (_tmp23_)(_tmp23_ = (g_free (_tmp23_), ((void*)0))); |
| 14129 | _g_free0 (_tmp21_)(_tmp21_ = (g_free (_tmp21_), ((void*)0))); |
| 14130 | } |
| 14131 | _tmp26_ = bala_ccode_identifier_new ("G_TYPE_INSTANCE_GET_INTERFACE"); |
| 14132 | _tmp27_ = _tmp26_; |
| 14133 | _tmp28_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp27_); |
| 14134 | _tmp29_ = _tmp28_; |
| 14135 | _bala_ccode_node_unref0 (_tmp27_)((_tmp27_ == ((void*)0)) ? ((void*)0) : (_tmp27_ = (bala_ccode_node_unref (_tmp27_), ((void*)0)))); |
| 14136 | vcast = _tmp29_; |
| 14137 | _tmp30_ = vcast; |
| 14138 | _tmp31_ = bala_ccode_base_module_get_this_cexpression (self); |
| 14139 | _tmp32_ = _tmp31_; |
| 14140 | bala_ccode_function_call_add_argument (_tmp30_, _tmp32_); |
| 14141 | _bala_ccode_node_unref0 (_tmp32_)((_tmp32_ == ((void*)0)) ? ((void*)0) : (_tmp32_ = (bala_ccode_node_unref (_tmp32_), ((void*)0)))); |
| 14142 | _tmp33_ = vcast; |
| 14143 | _tmp34_ = bala_get_ccode_type_id ((BalaCodeNode*) iface); |
| 14144 | _tmp35_ = _tmp34_; |
| 14145 | _tmp36_ = bala_ccode_identifier_new (_tmp35_); |
| 14146 | _tmp37_ = _tmp36_; |
| 14147 | bala_ccode_function_call_add_argument (_tmp33_, (BalaCCodeExpression*) _tmp37_); |
| 14148 | _bala_ccode_node_unref0 (_tmp37_)((_tmp37_ == ((void*)0)) ? ((void*)0) : (_tmp37_ = (bala_ccode_node_unref (_tmp37_), ((void*)0)))); |
| 14149 | _g_free0 (_tmp35_)(_tmp35_ = (g_free (_tmp35_), ((void*)0))); |
| 14150 | _tmp38_ = vcast; |
| 14151 | _tmp39_ = bala_get_ccode_type_name ((BalaObjectTypeSymbol*) iface); |
| 14152 | _tmp40_ = _tmp39_; |
| 14153 | _tmp41_ = bala_ccode_identifier_new (_tmp40_); |
| 14154 | _tmp42_ = _tmp41_; |
| 14155 | bala_ccode_function_call_add_argument (_tmp38_, (BalaCCodeExpression*) _tmp42_); |
| 14156 | _bala_ccode_node_unref0 (_tmp42_)((_tmp42_ == ((void*)0)) ? ((void*)0) : (_tmp42_ = (bala_ccode_node_unref (_tmp42_), ((void*)0)))); |
| 14157 | _g_free0 (_tmp40_)(_tmp40_ = (g_free (_tmp40_), ((void*)0))); |
| 14158 | result = (BalaCCodeExpression*) vcast; |
| 14159 | return result; |
| 14160 | } |
| 14161 | |
| 14162 | BalaCCodeExpression* |
| 14163 | bala_ccode_base_module_get_inner_error_cexpression (BalaCCodeBaseModule* self) |
| 14164 | { |
| 14165 | gint _tmp0_; |
| 14166 | gint _tmp1_; |
| 14167 | gchar* _tmp2_; |
| 14168 | gchar* _tmp3_; |
| 14169 | BalaCCodeExpression* _tmp4_; |
| 14170 | BalaCCodeExpression* _tmp5_; |
| 14171 | BalaCCodeExpression* result = NULL((void*)0); |
| 14172 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 14173 | _tmp0_ = bala_ccode_base_module_get_current_inner_error_id (self); |
| 14174 | _tmp1_ = _tmp0_; |
| 14175 | _tmp2_ = g_strdup_printf ("_inner_error%d_", _tmp1_); |
| 14176 | _tmp3_ = _tmp2_; |
| 14177 | _tmp4_ = bala_ccode_base_module_get_cexpression (self, _tmp3_); |
| 14178 | _tmp5_ = _tmp4_; |
| 14179 | _g_free0 (_tmp3_)(_tmp3_ = (g_free (_tmp3_), ((void*)0))); |
| 14180 | result = _tmp5_; |
| 14181 | return result; |
| 14182 | } |
| 14183 | |
| 14184 | static gchar |
| 14185 | string_get (const gchar* self, |
| 14186 | glong index) |
| 14187 | { |
| 14188 | gchar _tmp0_; |
| 14189 | gchar result = '\0'; |
| 14190 | g_return_val_if_fail (self != NULL, '\0')do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ('\0'); } } while (0); |
| 14191 | _tmp0_ = ((gchar*) self)[index]; |
| 14192 | result = _tmp0_; |
| 14193 | return result; |
| 14194 | } |
| 14195 | |
| 14196 | gchar* |
| 14197 | bala_ccode_base_module_get_local_cname (BalaCCodeBaseModule* self, |
| 14198 | BalaLocalVariable* local) |
| 14199 | { |
| 14200 | gchar* cname = NULL((void*)0); |
| 14201 | const gchar* _tmp0_; |
| 14202 | const gchar* _tmp1_; |
| 14203 | gchar* _tmp2_; |
| 14204 | const gchar* _tmp3_; |
| 14205 | gchar* result = NULL((void*)0); |
| 14206 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 14207 | g_return_val_if_fail (local != NULL, NULL)do { if ((local != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "local != NULL" ); return (((void*)0)); } } while (0); |
| 14208 | _tmp0_ = bala_symbol_get_name ((BalaSymbol*) local); |
| 14209 | _tmp1_ = _tmp0_; |
| 14210 | _tmp2_ = bala_ccode_base_module_get_variable_cname (self, _tmp1_); |
| 14211 | cname = _tmp2_; |
| 14212 | _tmp3_ = cname; |
| 14213 | if (g_ascii_isdigit (string_get (_tmp3_, (glong) 0))((g_ascii_table[(guchar) (string_get (_tmp3_, (glong) 0))] & G_ASCII_DIGIT) != 0)) { |
| 14214 | const gchar* _tmp4_; |
| 14215 | gchar* _tmp5_; |
| 14216 | _tmp4_ = cname; |
| 14217 | _tmp5_ = g_strdup_printf ("_%s_", _tmp4_); |
| 14218 | _g_free0 (cname)(cname = (g_free (cname), ((void*)0))); |
| 14219 | cname = _tmp5_; |
| 14220 | } |
| 14221 | if (bala_ccode_base_module_is_in_coroutine (self)) { |
| 14222 | gint clash_index = 0; |
| 14223 | BalaCCodeBaseModuleEmitContext* _tmp6_; |
| 14224 | BalaMap* _tmp7_; |
| 14225 | gpointer _tmp8_; |
| 14226 | _tmp6_ = self->emit_context; |
| 14227 | _tmp7_ = _tmp6_->closure_variable_clash_map; |
| 14228 | _tmp8_ = bala_map_get (_tmp7_, local); |
| 14229 | clash_index = (gint) ((gintptr) _tmp8_); |
| 14230 | if (clash_index > 0) { |
| 14231 | const gchar* _tmp9_; |
| 14232 | gchar* _tmp10_; |
| 14233 | _tmp9_ = cname; |
| 14234 | _tmp10_ = g_strdup_printf ("_bala%d_%s", clash_index, _tmp9_); |
| 14235 | _g_free0 (cname)(cname = (g_free (cname), ((void*)0))); |
| 14236 | cname = _tmp10_; |
| 14237 | } |
| 14238 | } |
| 14239 | result = cname; |
| 14240 | return result; |
| 14241 | } |
| 14242 | |
| 14243 | gchar* |
| 14244 | bala_ccode_base_module_get_variable_cname (BalaCCodeBaseModule* self, |
| 14245 | const gchar* name) |
| 14246 | { |
| 14247 | gchar* result = NULL((void*)0); |
| 14248 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 14249 | g_return_val_if_fail (name != NULL, NULL)do { if ((name != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "name != NULL" ); return (((void*)0)); } } while (0); |
| 14250 | if (string_get (name, (glong) 0) == '.') { |
| 14251 | BalaMap* _tmp1_; |
| 14252 | BalaMap* _tmp2_; |
| 14253 | BalaMap* _tmp11_; |
| 14254 | BalaMap* _tmp12_; |
| 14255 | gpointer _tmp13_; |
| 14256 | if (g_strcmp0 (name, ".result") == 0) { |
| 14257 | gchar* _tmp0_; |
| 14258 | _tmp0_ = g_strdup ("result"); |
| 14259 | result = _tmp0_; |
| 14260 | return result; |
| 14261 | } |
| 14262 | _tmp1_ = bala_ccode_base_module_get_variable_name_map (self); |
| 14263 | _tmp2_ = _tmp1_; |
| 14264 | if (!bala_map_contains (_tmp2_, name)) { |
| 14265 | BalaMap* _tmp3_; |
| 14266 | BalaMap* _tmp4_; |
| 14267 | gint _tmp5_; |
| 14268 | gint _tmp6_; |
| 14269 | gchar* _tmp7_; |
| 14270 | gchar* _tmp8_; |
| 14271 | gint _tmp9_; |
| 14272 | gint _tmp10_; |
| 14273 | _tmp3_ = bala_ccode_base_module_get_variable_name_map (self); |
| 14274 | _tmp4_ = _tmp3_; |
| 14275 | _tmp5_ = bala_ccode_base_module_get_next_temp_var_id (self); |
| 14276 | _tmp6_ = _tmp5_; |
| 14277 | _tmp7_ = g_strdup_printf ("_tmp%d_", _tmp6_); |
| 14278 | _tmp8_ = _tmp7_; |
| 14279 | bala_map_set (_tmp4_, name, _tmp8_); |
| 14280 | _g_free0 (_tmp8_)(_tmp8_ = (g_free (_tmp8_), ((void*)0))); |
| 14281 | _tmp9_ = bala_ccode_base_module_get_next_temp_var_id (self); |
| 14282 | _tmp10_ = _tmp9_; |
| 14283 | bala_ccode_base_module_set_next_temp_var_id (self, _tmp10_ + 1); |
| 14284 | } |
| 14285 | _tmp11_ = bala_ccode_base_module_get_variable_name_map (self); |
| 14286 | _tmp12_ = _tmp11_; |
| 14287 | _tmp13_ = bala_map_get (_tmp12_, name); |
| 14288 | result = (gchar*) _tmp13_; |
| 14289 | return result; |
| 14290 | } else { |
| 14291 | BalaSet* _tmp14_; |
| 14292 | _tmp14_ = bala_ccode_base_module_reserved_identifiers; |
| 14293 | if (bala_collection_contains ((BalaCollection*) _tmp14_, name)) { |
| 14294 | gchar* _tmp15_; |
| 14295 | _tmp15_ = g_strdup_printf ("_%s_", name); |
| 14296 | result = _tmp15_; |
| 14297 | return result; |
| 14298 | } else { |
| 14299 | gchar* _tmp16_; |
| 14300 | _tmp16_ = g_strdup (name); |
| 14301 | result = _tmp16_; |
| 14302 | return result; |
| 14303 | } |
| 14304 | } |
| 14305 | } |
| 14306 | |
| 14307 | gboolean |
| 14308 | bala_ccode_base_module_is_simple_struct_creation (BalaCCodeBaseModule* self, |
| 14309 | BalaVariable* variable, |
| 14310 | BalaExpression* expr) |
| 14311 | { |
| 14312 | BalaStruct* st = NULL((void*)0); |
| 14313 | BalaDataType* _tmp0_; |
| 14314 | BalaDataType* _tmp1_; |
| 14315 | BalaTypeSymbol* _tmp2_; |
| 14316 | BalaTypeSymbol* _tmp3_; |
| 14317 | BalaObjectCreationExpression* creation = NULL((void*)0); |
| 14318 | BalaObjectCreationExpression* _tmp4_; |
| 14319 | gboolean _tmp5_ = FALSE(0); |
| 14320 | gboolean _tmp6_ = FALSE(0); |
| 14321 | gboolean _tmp7_ = FALSE(0); |
| 14322 | gboolean _tmp8_ = FALSE(0); |
| 14323 | gboolean _tmp9_ = FALSE(0); |
| 14324 | BalaObjectCreationExpression* _tmp10_; |
| 14325 | gboolean result = FALSE(0); |
| 14326 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 14327 | g_return_val_if_fail (variable != NULL, FALSE)do { if ((variable != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "variable != NULL" ); return ((0)); } } while (0); |
| 14328 | g_return_val_if_fail (expr != NULL, FALSE)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return ((0)); } } while (0); |
| 14329 | _tmp0_ = bala_variable_get_variable_type (variable); |
| 14330 | _tmp1_ = _tmp0_; |
| 14331 | _tmp2_ = bala_data_type_get_type_symbol (_tmp1_); |
| 14332 | _tmp3_ = _tmp2_; |
| 14333 | st = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp3_) : NULL((void*)0); |
| 14334 | _tmp4_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (expr, BALA_TYPE_OBJECT_CREATION_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( expr); GType __t = ((bala_object_creation_expression_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaObjectCreationExpression*) expr) : NULL((void*)0)); |
| 14335 | creation = _tmp4_; |
| 14336 | _tmp10_ = creation; |
| 14337 | if (_tmp10_ != NULL((void*)0)) { |
| 14338 | BalaStruct* _tmp11_; |
| 14339 | _tmp11_ = st; |
| 14340 | _tmp9_ = _tmp11_ != NULL((void*)0); |
| 14341 | } else { |
| 14342 | _tmp9_ = FALSE(0); |
| 14343 | } |
| 14344 | if (_tmp9_) { |
| 14345 | gboolean _tmp12_ = FALSE(0); |
| 14346 | BalaStruct* _tmp13_; |
| 14347 | _tmp13_ = st; |
| 14348 | if (!bala_struct_is_simple_type (_tmp13_)) { |
| 14349 | _tmp12_ = TRUE(!(0)); |
| 14350 | } else { |
| 14351 | BalaStruct* _tmp14_; |
| 14352 | gchar* _tmp15_; |
| 14353 | gchar* _tmp16_; |
| 14354 | _tmp14_ = st; |
| 14355 | _tmp15_ = bala_get_ccode_name ((BalaCodeNode*) _tmp14_); |
| 14356 | _tmp16_ = _tmp15_; |
| 14357 | _tmp12_ = g_strcmp0 (_tmp16_, "va_list") == 0; |
| 14358 | _g_free0 (_tmp16_)(_tmp16_ = (g_free (_tmp16_), ((void*)0))); |
| 14359 | } |
| 14360 | _tmp8_ = _tmp12_; |
| 14361 | } else { |
| 14362 | _tmp8_ = FALSE(0); |
| 14363 | } |
| 14364 | if (_tmp8_) { |
| 14365 | BalaDataType* _tmp17_; |
| 14366 | BalaDataType* _tmp18_; |
| 14367 | gboolean _tmp19_; |
| 14368 | gboolean _tmp20_; |
| 14369 | _tmp17_ = bala_variable_get_variable_type (variable); |
| 14370 | _tmp18_ = _tmp17_; |
| 14371 | _tmp19_ = bala_data_type_get_nullable (_tmp18_); |
| 14372 | _tmp20_ = _tmp19_; |
| 14373 | _tmp7_ = !_tmp20_; |
| 14374 | } else { |
| 14375 | _tmp7_ = FALSE(0); |
| 14376 | } |
| 14377 | if (_tmp7_) { |
| 14378 | BalaDataType* _tmp21_; |
| 14379 | BalaDataType* _tmp22_; |
| 14380 | BalaTypeSymbol* _tmp23_; |
| 14381 | BalaTypeSymbol* _tmp24_; |
| 14382 | BalaStruct* _tmp25_; |
| 14383 | _tmp21_ = bala_variable_get_variable_type (variable); |
| 14384 | _tmp22_ = _tmp21_; |
| 14385 | _tmp23_ = bala_data_type_get_type_symbol (_tmp22_); |
| 14386 | _tmp24_ = _tmp23_; |
| 14387 | _tmp25_ = self->gvalue_type; |
| 14388 | _tmp6_ = _tmp24_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp25_), ((bala_typesymbol_get_type ()))))); |
| 14389 | } else { |
| 14390 | _tmp6_ = FALSE(0); |
| 14391 | } |
| 14392 | if (_tmp6_) { |
| 14393 | BalaObjectCreationExpression* _tmp26_; |
| 14394 | BalaList* _tmp27_; |
| 14395 | gint _tmp28_; |
| 14396 | gint _tmp29_; |
| 14397 | _tmp26_ = creation; |
| 14398 | _tmp27_ = bala_object_creation_expression_get_object_initializer (_tmp26_); |
| 14399 | _tmp28_ = bala_collection_get_size ((BalaCollection*) _tmp27_); |
| 14400 | _tmp29_ = _tmp28_; |
| 14401 | _tmp5_ = _tmp29_ == 0; |
| 14402 | } else { |
| 14403 | _tmp5_ = FALSE(0); |
| 14404 | } |
| 14405 | if (_tmp5_) { |
| 14406 | result = TRUE(!(0)); |
| 14407 | _bala_code_node_unref0 (creation)((creation == ((void*)0)) ? ((void*)0) : (creation = (bala_code_node_unref (creation), ((void*)0)))); |
| 14408 | return result; |
| 14409 | } else { |
| 14410 | result = FALSE(0); |
| 14411 | _bala_code_node_unref0 (creation)((creation == ((void*)0)) ? ((void*)0) : (creation = (bala_code_node_unref (creation), ((void*)0)))); |
| 14412 | return result; |
| 14413 | } |
| 14414 | _bala_code_node_unref0 (creation)((creation == ((void*)0)) ? ((void*)0) : (creation = (bala_code_node_unref (creation), ((void*)0)))); |
| 14415 | } |
| 14416 | |
| 14417 | static gboolean |
| 14418 | bala_ccode_base_module_is_foreach_element_variable (BalaLocalVariable* local) |
| 14419 | { |
| 14420 | BalaSymbol* block = NULL((void*)0); |
| 14421 | BalaSymbol* _tmp0_; |
| 14422 | BalaSymbol* _tmp1_; |
| 14423 | BalaSymbol* _tmp2_; |
| 14424 | BalaSymbol* _tmp3_; |
| 14425 | gboolean result = FALSE(0); |
| 14426 | g_return_val_if_fail (local != NULL, FALSE)do { if ((local != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "local != NULL" ); return ((0)); } } while (0); |
| 14427 | _tmp0_ = bala_symbol_get_parent_symbol ((BalaSymbol*) local); |
| 14428 | _tmp1_ = _tmp0_; |
| 14429 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 14430 | block = _tmp2_; |
| 14431 | _tmp3_ = block; |
| 14432 | if (_tmp3_ != NULL((void*)0)) { |
| 14433 | BalaForeachStatement* stmt = NULL((void*)0); |
| 14434 | BalaSymbol* _tmp4_; |
| 14435 | BalaSymbol* _tmp5_; |
| 14436 | BalaSymbol* _tmp6_; |
| 14437 | BalaForeachStatement* _tmp7_; |
| 14438 | gboolean _tmp8_ = FALSE(0); |
| 14439 | gboolean _tmp9_ = FALSE(0); |
| 14440 | BalaForeachStatement* _tmp10_; |
| 14441 | _tmp4_ = block; |
| 14442 | _tmp5_ = bala_symbol_get_parent_symbol (_tmp4_); |
| 14443 | _tmp6_ = _tmp5_; |
| 14444 | _tmp7_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, BALA_TYPE_FOREACH_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp6_); GType __t = ((bala_foreach_statement_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaForeachStatement*) _tmp6_) : NULL((void*)0)); |
| 14445 | stmt = _tmp7_; |
| 14446 | _tmp10_ = stmt; |
| 14447 | if (_tmp10_ != NULL((void*)0)) { |
| 14448 | BalaForeachStatement* _tmp11_; |
| 14449 | gboolean _tmp12_; |
| 14450 | gboolean _tmp13_; |
| 14451 | _tmp11_ = stmt; |
| 14452 | _tmp12_ = bala_foreach_statement_get_use_iterator (_tmp11_); |
| 14453 | _tmp13_ = _tmp12_; |
| 14454 | _tmp9_ = !_tmp13_; |
| 14455 | } else { |
| 14456 | _tmp9_ = FALSE(0); |
| 14457 | } |
| 14458 | if (_tmp9_) { |
| 14459 | BalaForeachStatement* _tmp14_; |
| 14460 | BalaLocalVariable* _tmp15_; |
| 14461 | BalaLocalVariable* _tmp16_; |
| 14462 | _tmp14_ = stmt; |
| 14463 | _tmp15_ = bala_foreach_statement_get_element_variable (_tmp14_); |
| 14464 | _tmp16_ = _tmp15_; |
| 14465 | _tmp8_ = _tmp16_ == local; |
| 14466 | } else { |
| 14467 | _tmp8_ = FALSE(0); |
| 14468 | } |
| 14469 | if (_tmp8_) { |
| 14470 | result = TRUE(!(0)); |
| 14471 | _bala_code_node_unref0 (stmt)((stmt == ((void*)0)) ? ((void*)0) : (stmt = (bala_code_node_unref (stmt), ((void*)0)))); |
| 14472 | _bala_code_node_unref0 (block)((block == ((void*)0)) ? ((void*)0) : (block = (bala_code_node_unref (block), ((void*)0)))); |
| 14473 | return result; |
| 14474 | } |
| 14475 | _bala_code_node_unref0 (stmt)((stmt == ((void*)0)) ? ((void*)0) : (stmt = (bala_code_node_unref (stmt), ((void*)0)))); |
| 14476 | } |
| 14477 | result = FALSE(0); |
| 14478 | _bala_code_node_unref0 (block)((block == ((void*)0)) ? ((void*)0) : (block = (bala_code_node_unref (block), ((void*)0)))); |
| 14479 | return result; |
| 14480 | } |
| 14481 | |
| 14482 | static void |
| 14483 | bala_ccode_base_module_real_visit_local_variable (BalaCodeVisitor* base, |
| 14484 | BalaLocalVariable* local) |
| 14485 | { |
| 14486 | BalaCCodeBaseModule * self; |
| 14487 | BalaDataType* _tmp0_; |
| 14488 | BalaDataType* _tmp1_; |
| 14489 | BalaCCodeFile* _tmp2_; |
| 14490 | gboolean _tmp3_ = FALSE(0); |
| 14491 | gboolean _tmp4_; |
| 14492 | gboolean _tmp5_; |
| 14493 | gboolean declared = FALSE(0); |
| 14494 | BalaExpression* _tmp73_; |
| 14495 | BalaExpression* _tmp74_; |
| 14496 | BalaCCodeExpression* rhs = NULL((void*)0); |
| 14497 | gboolean _tmp79_ = FALSE(0); |
| 14498 | BalaExpression* _tmp80_; |
| 14499 | BalaExpression* _tmp81_; |
| 14500 | BalaCCodeExpression* _tmp172_; |
| 14501 | gboolean _tmp181_ = FALSE(0); |
| 14502 | BalaExpression* _tmp182_; |
| 14503 | BalaExpression* _tmp183_; |
| 14504 | self = (BalaCCodeBaseModule*) base; |
| 14505 | g_return_if_fail (local != NULL)do { if ((local != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "local != NULL" ); return; } } while (0); |
| 14506 | _tmp0_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 14507 | _tmp1_ = _tmp0_; |
| 14508 | _tmp2_ = self->cfile; |
| 14509 | bala_ccode_base_module_generate_type_declaration (self, _tmp1_, _tmp2_); |
| 14510 | _tmp4_ = bala_local_variable_get_captured (local); |
| 14511 | _tmp5_ = _tmp4_; |
| 14512 | if (!_tmp5_) { |
| 14513 | _tmp3_ = TRUE(!(0)); |
| 14514 | } else { |
| 14515 | _tmp3_ = bala_ccode_base_module_is_foreach_element_variable (local); |
| 14516 | } |
| 14517 | declared = _tmp3_; |
| 14518 | if (declared) { |
| 14519 | if (bala_ccode_base_module_is_in_coroutine (self)) { |
| 14520 | gint count = 0; |
| 14521 | BalaCCodeBaseModuleEmitContext* _tmp6_; |
| 14522 | BalaMap* _tmp7_; |
| 14523 | const gchar* _tmp8_; |
| 14524 | const gchar* _tmp9_; |
| 14525 | gpointer _tmp10_; |
| 14526 | BalaCCodeBaseModuleEmitContext* _tmp13_; |
| 14527 | BalaMap* _tmp14_; |
| 14528 | const gchar* _tmp15_; |
| 14529 | const gchar* _tmp16_; |
| 14530 | BalaCCodeStruct* _tmp17_; |
| 14531 | BalaDataType* _tmp18_; |
| 14532 | BalaDataType* _tmp19_; |
| 14533 | gchar* _tmp20_; |
| 14534 | gchar* _tmp21_; |
| 14535 | gchar* _tmp22_; |
| 14536 | gchar* _tmp23_; |
| 14537 | BalaDataType* _tmp24_; |
| 14538 | BalaDataType* _tmp25_; |
| 14539 | BalaCCodeDeclaratorSuffix* _tmp26_; |
| 14540 | BalaCCodeDeclaratorSuffix* _tmp27_; |
| 14541 | _tmp6_ = self->emit_context; |
| 14542 | _tmp7_ = _tmp6_->closure_variable_count_map; |
| 14543 | _tmp8_ = bala_symbol_get_name ((BalaSymbol*) local); |
| 14544 | _tmp9_ = _tmp8_; |
| 14545 | _tmp10_ = bala_map_get (_tmp7_, _tmp9_); |
| 14546 | count = (gint) ((gintptr) _tmp10_); |
| 14547 | if (count > 0) { |
| 14548 | BalaCCodeBaseModuleEmitContext* _tmp11_; |
| 14549 | BalaMap* _tmp12_; |
| 14550 | _tmp11_ = self->emit_context; |
| 14551 | _tmp12_ = _tmp11_->closure_variable_clash_map; |
| 14552 | bala_map_set (_tmp12_, local, (gpointer) ((gintptr) count)); |
| 14553 | } |
| 14554 | _tmp13_ = self->emit_context; |
| 14555 | _tmp14_ = _tmp13_->closure_variable_count_map; |
| 14556 | _tmp15_ = bala_symbol_get_name ((BalaSymbol*) local); |
| 14557 | _tmp16_ = _tmp15_; |
| 14558 | bala_map_set (_tmp14_, _tmp16_, (gpointer) ((gintptr) (count + 1))); |
| 14559 | _tmp17_ = self->closure_struct; |
| 14560 | _tmp18_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 14561 | _tmp19_ = _tmp18_; |
| 14562 | _tmp20_ = bala_get_ccode_name ((BalaCodeNode*) _tmp19_); |
| 14563 | _tmp21_ = _tmp20_; |
| 14564 | _tmp22_ = bala_ccode_base_module_get_local_cname (self, local); |
| 14565 | _tmp23_ = _tmp22_; |
| 14566 | _tmp24_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 14567 | _tmp25_ = _tmp24_; |
| 14568 | _tmp26_ = bala_ccode_base_module_get_ccode_declarator_suffix (self, _tmp25_); |
| 14569 | _tmp27_ = _tmp26_; |
| 14570 | bala_ccode_struct_add_field (_tmp17_, _tmp21_, _tmp23_, 0, _tmp27_); |
| 14571 | _bala_ccode_declarator_suffix_unref0 (_tmp27_)((_tmp27_ == ((void*)0)) ? ((void*)0) : (_tmp27_ = (bala_ccode_declarator_suffix_unref (_tmp27_), ((void*)0)))); |
| 14572 | _g_free0 (_tmp23_)(_tmp23_ = (g_free (_tmp23_), ((void*)0))); |
| 14573 | _g_free0 (_tmp21_)(_tmp21_ = (g_free (_tmp21_), ((void*)0))); |
| 14574 | } else { |
| 14575 | BalaCCodeVariableDeclarator* cvar = NULL((void*)0); |
| 14576 | gchar* _tmp28_; |
| 14577 | gchar* _tmp29_; |
| 14578 | BalaDataType* _tmp30_; |
| 14579 | BalaDataType* _tmp31_; |
| 14580 | BalaCCodeDeclaratorSuffix* _tmp32_; |
| 14581 | BalaCCodeDeclaratorSuffix* _tmp33_; |
| 14582 | BalaCCodeVariableDeclarator* _tmp34_; |
| 14583 | BalaCCodeVariableDeclarator* _tmp35_; |
| 14584 | BalaCCodeExpression* size = NULL((void*)0); |
| 14585 | BalaCCodeExpression* _tmp36_ = NULL((void*)0); |
| 14586 | gboolean _tmp37_; |
| 14587 | BalaCCodeFunction* _tmp66_; |
| 14588 | BalaCCodeFunction* _tmp67_; |
| 14589 | BalaDataType* _tmp68_; |
| 14590 | BalaDataType* _tmp69_; |
| 14591 | gchar* _tmp70_; |
| 14592 | gchar* _tmp71_; |
| 14593 | BalaCCodeVariableDeclarator* _tmp72_; |
| 14594 | _tmp28_ = bala_ccode_base_module_get_local_cname (self, local); |
| 14595 | _tmp29_ = _tmp28_; |
| 14596 | _tmp30_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 14597 | _tmp31_ = _tmp30_; |
| 14598 | _tmp32_ = bala_ccode_base_module_get_ccode_declarator_suffix (self, _tmp31_); |
| 14599 | _tmp33_ = _tmp32_; |
| 14600 | _tmp34_ = bala_ccode_variable_declarator_new (_tmp29_, NULL((void*)0), _tmp33_); |
| 14601 | _tmp35_ = _tmp34_; |
| 14602 | _bala_ccode_declarator_suffix_unref0 (_tmp33_)((_tmp33_ == ((void*)0)) ? ((void*)0) : (_tmp33_ = (bala_ccode_declarator_suffix_unref (_tmp33_), ((void*)0)))); |
| 14603 | _g_free0 (_tmp29_)(_tmp29_ = (g_free (_tmp29_), ((void*)0))); |
| 14604 | cvar = _tmp35_; |
| 14605 | size = NULL((void*)0); |
| 14606 | _tmp37_ = bala_ccode_base_module_requires_memset_init (self, (BalaVariable*) local, &_tmp36_); |
| 14607 | _bala_ccode_node_unref0 (size)((size == ((void*)0)) ? ((void*)0) : (size = (bala_ccode_node_unref (size), ((void*)0)))); |
| 14608 | size = _tmp36_; |
| 14609 | if (!_tmp37_) { |
| 14610 | BalaCCodeVariableDeclarator* _tmp38_; |
| 14611 | BalaDataType* _tmp39_; |
| 14612 | BalaDataType* _tmp40_; |
| 14613 | BalaCCodeExpression* _tmp41_; |
| 14614 | BalaCCodeExpression* _tmp42_; |
| 14615 | BalaCCodeVariableDeclarator* _tmp43_; |
| 14616 | _tmp38_ = cvar; |
| 14617 | _tmp39_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 14618 | _tmp40_ = _tmp39_; |
| 14619 | _tmp41_ = bala_ccode_base_module_default_value_for_type (self, _tmp40_, TRUE(!(0)), FALSE(0)); |
| 14620 | _tmp42_ = _tmp41_; |
| 14621 | bala_ccode_variable_declarator_set_initializer (_tmp38_, _tmp42_); |
| 14622 | _bala_ccode_node_unref0 (_tmp42_)((_tmp42_ == ((void*)0)) ? ((void*)0) : (_tmp42_ = (bala_ccode_node_unref (_tmp42_), ((void*)0)))); |
| 14623 | _tmp43_ = cvar; |
| 14624 | bala_ccode_variable_declarator_set_init0 (_tmp43_, TRUE(!(0))); |
| 14625 | } else { |
| 14626 | gboolean _tmp44_ = FALSE(0); |
| 14627 | BalaCCodeExpression* _tmp45_; |
| 14628 | _tmp45_ = size; |
| 14629 | if (_tmp45_ != NULL((void*)0)) { |
| 14630 | BalaExpression* _tmp46_; |
| 14631 | BalaExpression* _tmp47_; |
| 14632 | _tmp46_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14633 | _tmp47_ = _tmp46_; |
| 14634 | _tmp44_ = _tmp47_ == NULL((void*)0); |
| 14635 | } else { |
| 14636 | _tmp44_ = FALSE(0); |
| 14637 | } |
| 14638 | if (_tmp44_) { |
| 14639 | BalaCCodeFile* _tmp48_; |
| 14640 | BalaCCodeFunctionCall* memset_call = NULL((void*)0); |
| 14641 | BalaCCodeIdentifier* _tmp49_; |
| 14642 | BalaCCodeIdentifier* _tmp50_; |
| 14643 | BalaCCodeFunctionCall* _tmp51_; |
| 14644 | BalaCCodeFunctionCall* _tmp52_; |
| 14645 | BalaCCodeFunctionCall* _tmp53_; |
| 14646 | const gchar* _tmp54_; |
| 14647 | const gchar* _tmp55_; |
| 14648 | BalaCCodeExpression* _tmp56_; |
| 14649 | BalaCCodeExpression* _tmp57_; |
| 14650 | BalaCCodeFunctionCall* _tmp58_; |
| 14651 | BalaCCodeConstant* _tmp59_; |
| 14652 | BalaCCodeConstant* _tmp60_; |
| 14653 | BalaCCodeFunctionCall* _tmp61_; |
| 14654 | BalaCCodeExpression* _tmp62_; |
| 14655 | BalaCCodeFunction* _tmp63_; |
| 14656 | BalaCCodeFunction* _tmp64_; |
| 14657 | BalaCCodeFunctionCall* _tmp65_; |
| 14658 | _tmp48_ = self->cfile; |
| 14659 | bala_ccode_file_add_include (_tmp48_, "string.h", FALSE(0)); |
| 14660 | _tmp49_ = bala_ccode_identifier_new ("memset"); |
| 14661 | _tmp50_ = _tmp49_; |
| 14662 | _tmp51_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp50_); |
| 14663 | _tmp52_ = _tmp51_; |
| 14664 | _bala_ccode_node_unref0 (_tmp50_)((_tmp50_ == ((void*)0)) ? ((void*)0) : (_tmp50_ = (bala_ccode_node_unref (_tmp50_), ((void*)0)))); |
| 14665 | memset_call = _tmp52_; |
| 14666 | _tmp53_ = memset_call; |
| 14667 | _tmp54_ = bala_symbol_get_name ((BalaSymbol*) local); |
| 14668 | _tmp55_ = _tmp54_; |
| 14669 | _tmp56_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp55_); |
| 14670 | _tmp57_ = _tmp56_; |
| 14671 | bala_ccode_function_call_add_argument (_tmp53_, _tmp57_); |
| 14672 | _bala_ccode_node_unref0 (_tmp57_)((_tmp57_ == ((void*)0)) ? ((void*)0) : (_tmp57_ = (bala_ccode_node_unref (_tmp57_), ((void*)0)))); |
| 14673 | _tmp58_ = memset_call; |
| 14674 | _tmp59_ = bala_ccode_constant_new ("0"); |
| 14675 | _tmp60_ = _tmp59_; |
| 14676 | bala_ccode_function_call_add_argument (_tmp58_, (BalaCCodeExpression*) _tmp60_); |
| 14677 | _bala_ccode_node_unref0 (_tmp60_)((_tmp60_ == ((void*)0)) ? ((void*)0) : (_tmp60_ = (bala_ccode_node_unref (_tmp60_), ((void*)0)))); |
| 14678 | _tmp61_ = memset_call; |
| 14679 | _tmp62_ = size; |
| 14680 | bala_ccode_function_call_add_argument (_tmp61_, _tmp62_); |
| 14681 | _tmp63_ = bala_ccode_base_module_get_ccode (self); |
| 14682 | _tmp64_ = _tmp63_; |
| 14683 | _tmp65_ = memset_call; |
| 14684 | bala_ccode_function_add_expression (_tmp64_, (BalaCCodeExpression*) _tmp65_); |
| 14685 | _bala_ccode_node_unref0 (memset_call)((memset_call == ((void*)0)) ? ((void*)0) : (memset_call = (bala_ccode_node_unref (memset_call), ((void*)0)))); |
| 14686 | } |
| 14687 | } |
| 14688 | _tmp66_ = bala_ccode_base_module_get_ccode (self); |
| 14689 | _tmp67_ = _tmp66_; |
| 14690 | _tmp68_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 14691 | _tmp69_ = _tmp68_; |
| 14692 | _tmp70_ = bala_get_ccode_name ((BalaCodeNode*) _tmp69_); |
| 14693 | _tmp71_ = _tmp70_; |
| 14694 | _tmp72_ = cvar; |
| 14695 | bala_ccode_function_add_declaration (_tmp67_, _tmp71_, (BalaCCodeDeclarator*) _tmp72_, 0); |
| 14696 | _g_free0 (_tmp71_)(_tmp71_ = (g_free (_tmp71_), ((void*)0))); |
| 14697 | _bala_ccode_node_unref0 (size)((size == ((void*)0)) ? ((void*)0) : (size = (bala_ccode_node_unref (size), ((void*)0)))); |
| 14698 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 14699 | } |
| 14700 | } |
| 14701 | _tmp73_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14702 | _tmp74_ = _tmp73_; |
| 14703 | if (_tmp74_ != NULL((void*)0)) { |
| 14704 | BalaExpression* _tmp75_; |
| 14705 | BalaExpression* _tmp76_; |
| 14706 | BalaExpression* _tmp77_; |
| 14707 | BalaExpression* _tmp78_; |
| 14708 | _tmp75_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14709 | _tmp76_ = _tmp75_; |
| 14710 | bala_code_node_emit ((BalaCodeNode*) _tmp76_, (BalaCodeGenerator*) self); |
| 14711 | _tmp77_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14712 | _tmp78_ = _tmp77_; |
| 14713 | bala_code_visitor_visit_end_full_expression ((BalaCodeVisitor*) self, _tmp78_); |
| 14714 | } |
| 14715 | rhs = NULL((void*)0); |
| 14716 | _tmp80_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14717 | _tmp81_ = _tmp80_; |
| 14718 | if (_tmp81_ != NULL((void*)0)) { |
| 14719 | BalaExpression* _tmp82_; |
| 14720 | BalaExpression* _tmp83_; |
| 14721 | BalaCCodeExpression* _tmp84_; |
| 14722 | _tmp82_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14723 | _tmp83_ = _tmp82_; |
| 14724 | _tmp84_ = bala_get_cvalue (_tmp83_); |
| 14725 | _tmp79_ = _tmp84_ != NULL((void*)0); |
| 14726 | } else { |
| 14727 | _tmp79_ = FALSE(0); |
| 14728 | } |
| 14729 | if (_tmp79_) { |
| 14730 | BalaExpression* _tmp85_; |
| 14731 | BalaExpression* _tmp86_; |
| 14732 | BalaCCodeExpression* _tmp87_; |
| 14733 | BalaCCodeExpression* _tmp88_; |
| 14734 | _tmp85_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14735 | _tmp86_ = _tmp85_; |
| 14736 | _tmp87_ = bala_get_cvalue (_tmp86_); |
| 14737 | _tmp88_ = _bala_ccode_node_ref0 (_tmp87_); |
| 14738 | _bala_ccode_node_unref0 (rhs)((rhs == ((void*)0)) ? ((void*)0) : (rhs = (bala_ccode_node_unref (rhs), ((void*)0)))); |
| 14739 | rhs = _tmp88_; |
| 14740 | } |
| 14741 | if (declared) { |
| 14742 | BalaDataType* _tmp89_; |
| 14743 | BalaDataType* _tmp90_; |
| 14744 | _tmp89_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 14745 | _tmp90_ = _tmp89_; |
| 14746 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp90_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp90_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 14747 | BalaArrayType* array_type = NULL((void*)0); |
| 14748 | BalaDataType* _tmp91_; |
| 14749 | BalaDataType* _tmp92_; |
| 14750 | BalaArrayType* _tmp93_; |
| 14751 | BalaArrayType* _tmp94_; |
| 14752 | gboolean _tmp95_; |
| 14753 | gboolean _tmp96_; |
| 14754 | _tmp91_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 14755 | _tmp92_ = _tmp91_; |
| 14756 | _tmp93_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp92_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp92_), ((bala_array_type_get_type ())))))); |
| 14757 | array_type = _tmp93_; |
| 14758 | _tmp94_ = array_type; |
| 14759 | _tmp95_ = bala_array_type_get_fixed_length (_tmp94_); |
| 14760 | _tmp96_ = _tmp95_; |
| 14761 | if (!_tmp96_) { |
| 14762 | BalaArrayType* _tmp117_; |
| 14763 | gint _tmp118_; |
| 14764 | gint _tmp119_; |
| 14765 | { |
| 14766 | gint dim = 0; |
| 14767 | dim = 1; |
| 14768 | { |
| 14769 | gboolean _tmp97_ = FALSE(0); |
| 14770 | _tmp97_ = TRUE(!(0)); |
| 14771 | while (TRUE(!(0))) { |
| 14772 | BalaArrayType* _tmp99_; |
| 14773 | gint _tmp100_; |
| 14774 | gint _tmp101_; |
| 14775 | BalaLocalVariable* len_var = NULL((void*)0); |
| 14776 | BalaArrayType* _tmp102_; |
| 14777 | BalaDataType* _tmp103_; |
| 14778 | BalaDataType* _tmp104_; |
| 14779 | BalaDataType* _tmp105_; |
| 14780 | BalaDataType* _tmp106_; |
| 14781 | gchar* _tmp107_; |
| 14782 | gchar* _tmp108_; |
| 14783 | gchar* _tmp109_; |
| 14784 | gchar* _tmp110_; |
| 14785 | BalaLocalVariable* _tmp111_; |
| 14786 | BalaLocalVariable* _tmp112_; |
| 14787 | BalaLocalVariable* _tmp113_; |
| 14788 | BalaExpression* _tmp114_; |
| 14789 | BalaExpression* _tmp115_; |
| 14790 | BalaLocalVariable* _tmp116_; |
| 14791 | if (!_tmp97_) { |
| 14792 | gint _tmp98_; |
| 14793 | _tmp98_ = dim; |
| 14794 | dim = _tmp98_ + 1; |
| 14795 | } |
| 14796 | _tmp97_ = FALSE(0); |
| 14797 | _tmp99_ = array_type; |
| 14798 | _tmp100_ = bala_array_type_get_rank (_tmp99_); |
| 14799 | _tmp101_ = _tmp100_; |
| 14800 | if (!(dim <= _tmp101_)) { |
| 14801 | break; |
| 14802 | } |
| 14803 | _tmp102_ = array_type; |
| 14804 | _tmp103_ = bala_array_type_get_length_type (_tmp102_); |
| 14805 | _tmp104_ = _tmp103_; |
| 14806 | _tmp105_ = bala_data_type_copy (_tmp104_); |
| 14807 | _tmp106_ = _tmp105_; |
| 14808 | _tmp107_ = bala_ccode_base_module_get_local_cname (self, local); |
| 14809 | _tmp108_ = _tmp107_; |
| 14810 | _tmp109_ = bala_ccode_base_module_get_array_length_cname (self, _tmp108_, dim); |
| 14811 | _tmp110_ = _tmp109_; |
| 14812 | _tmp111_ = bala_local_variable_new (_tmp106_, _tmp110_, NULL((void*)0), NULL((void*)0)); |
| 14813 | _tmp112_ = _tmp111_; |
| 14814 | _g_free0 (_tmp110_)(_tmp110_ = (g_free (_tmp110_), ((void*)0))); |
| 14815 | _g_free0 (_tmp108_)(_tmp108_ = (g_free (_tmp108_), ((void*)0))); |
| 14816 | _bala_code_node_unref0 (_tmp106_)((_tmp106_ == ((void*)0)) ? ((void*)0) : (_tmp106_ = (bala_code_node_unref (_tmp106_), ((void*)0)))); |
| 14817 | len_var = _tmp112_; |
| 14818 | _tmp113_ = len_var; |
| 14819 | _tmp114_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14820 | _tmp115_ = _tmp114_; |
| 14821 | bala_local_variable_set_init (_tmp113_, _tmp115_ == NULL((void*)0)); |
| 14822 | _tmp116_ = len_var; |
| 14823 | bala_ccode_base_module_emit_temp_var (self, _tmp116_, FALSE(0)); |
| 14824 | _bala_code_node_unref0 (len_var)((len_var == ((void*)0)) ? ((void*)0) : (len_var = (bala_code_node_unref (len_var), ((void*)0)))); |
| 14825 | } |
| 14826 | } |
| 14827 | } |
| 14828 | _tmp117_ = array_type; |
| 14829 | _tmp118_ = bala_array_type_get_rank (_tmp117_); |
| 14830 | _tmp119_ = _tmp118_; |
| 14831 | if (_tmp119_ == 1) { |
| 14832 | BalaLocalVariable* size_var = NULL((void*)0); |
| 14833 | BalaArrayType* _tmp120_; |
| 14834 | BalaDataType* _tmp121_; |
| 14835 | BalaDataType* _tmp122_; |
| 14836 | BalaDataType* _tmp123_; |
| 14837 | BalaDataType* _tmp124_; |
| 14838 | gchar* _tmp125_; |
| 14839 | gchar* _tmp126_; |
| 14840 | gchar* _tmp127_; |
| 14841 | gchar* _tmp128_; |
| 14842 | BalaLocalVariable* _tmp129_; |
| 14843 | BalaLocalVariable* _tmp130_; |
| 14844 | BalaLocalVariable* _tmp131_; |
| 14845 | BalaExpression* _tmp132_; |
| 14846 | BalaExpression* _tmp133_; |
| 14847 | BalaLocalVariable* _tmp134_; |
| 14848 | _tmp120_ = array_type; |
| 14849 | _tmp121_ = bala_array_type_get_length_type (_tmp120_); |
| 14850 | _tmp122_ = _tmp121_; |
| 14851 | _tmp123_ = bala_data_type_copy (_tmp122_); |
| 14852 | _tmp124_ = _tmp123_; |
| 14853 | _tmp125_ = bala_ccode_base_module_get_local_cname (self, local); |
| 14854 | _tmp126_ = _tmp125_; |
| 14855 | _tmp127_ = bala_ccode_base_module_get_array_size_cname (self, _tmp126_); |
| 14856 | _tmp128_ = _tmp127_; |
| 14857 | _tmp129_ = bala_local_variable_new (_tmp124_, _tmp128_, NULL((void*)0), NULL((void*)0)); |
| 14858 | _tmp130_ = _tmp129_; |
| 14859 | _g_free0 (_tmp128_)(_tmp128_ = (g_free (_tmp128_), ((void*)0))); |
| 14860 | _g_free0 (_tmp126_)(_tmp126_ = (g_free (_tmp126_), ((void*)0))); |
| 14861 | _bala_code_node_unref0 (_tmp124_)((_tmp124_ == ((void*)0)) ? ((void*)0) : (_tmp124_ = (bala_code_node_unref (_tmp124_), ((void*)0)))); |
| 14862 | size_var = _tmp130_; |
| 14863 | _tmp131_ = size_var; |
| 14864 | _tmp132_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14865 | _tmp133_ = _tmp132_; |
| 14866 | bala_local_variable_set_init (_tmp131_, _tmp133_ == NULL((void*)0)); |
| 14867 | _tmp134_ = size_var; |
| 14868 | bala_ccode_base_module_emit_temp_var (self, _tmp134_, FALSE(0)); |
| 14869 | _bala_code_node_unref0 (size_var)((size_var == ((void*)0)) ? ((void*)0) : (size_var = (bala_code_node_unref (size_var), ((void*)0)))); |
| 14870 | } |
| 14871 | } |
| 14872 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 14873 | } else { |
| 14874 | BalaDataType* _tmp135_; |
| 14875 | BalaDataType* _tmp136_; |
| 14876 | _tmp135_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 14877 | _tmp136_ = _tmp135_; |
| 14878 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp136_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp136_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 14879 | BalaDelegateType* deleg_type = NULL((void*)0); |
| 14880 | BalaDataType* _tmp137_; |
| 14881 | BalaDataType* _tmp138_; |
| 14882 | BalaDelegateType* _tmp139_; |
| 14883 | BalaDelegateType* _tmp140_; |
| 14884 | BalaDelegate* _tmp141_; |
| 14885 | BalaDelegate* _tmp142_; |
| 14886 | gboolean _tmp143_; |
| 14887 | gboolean _tmp144_; |
| 14888 | _tmp137_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 14889 | _tmp138_ = _tmp137_; |
| 14890 | _tmp139_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp138_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp138_), ((bala_delegate_type_get_type ())))))); |
| 14891 | deleg_type = _tmp139_; |
| 14892 | _tmp140_ = deleg_type; |
| 14893 | _tmp141_ = bala_delegate_type_get_delegate_symbol (_tmp140_); |
| 14894 | _tmp142_ = _tmp141_; |
| 14895 | _tmp143_ = bala_delegate_get_has_target (_tmp142_); |
| 14896 | _tmp144_ = _tmp143_; |
| 14897 | if (_tmp144_) { |
| 14898 | BalaLocalVariable* target_var = NULL((void*)0); |
| 14899 | BalaDataType* _tmp145_; |
| 14900 | BalaDataType* _tmp146_; |
| 14901 | BalaDataType* _tmp147_; |
| 14902 | gchar* _tmp148_; |
| 14903 | gchar* _tmp149_; |
| 14904 | gchar* _tmp150_; |
| 14905 | gchar* _tmp151_; |
| 14906 | BalaLocalVariable* _tmp152_; |
| 14907 | BalaLocalVariable* _tmp153_; |
| 14908 | BalaLocalVariable* _tmp154_; |
| 14909 | BalaExpression* _tmp155_; |
| 14910 | BalaExpression* _tmp156_; |
| 14911 | BalaLocalVariable* _tmp157_; |
| 14912 | BalaDelegateType* _tmp158_; |
| 14913 | _tmp145_ = self->delegate_target_type; |
| 14914 | _tmp146_ = bala_data_type_copy (_tmp145_); |
| 14915 | _tmp147_ = _tmp146_; |
| 14916 | _tmp148_ = bala_ccode_base_module_get_local_cname (self, local); |
| 14917 | _tmp149_ = _tmp148_; |
| 14918 | _tmp150_ = bala_ccode_base_module_get_delegate_target_cname (self, _tmp149_); |
| 14919 | _tmp151_ = _tmp150_; |
| 14920 | _tmp152_ = bala_local_variable_new (_tmp147_, _tmp151_, NULL((void*)0), NULL((void*)0)); |
| 14921 | _tmp153_ = _tmp152_; |
| 14922 | _g_free0 (_tmp151_)(_tmp151_ = (g_free (_tmp151_), ((void*)0))); |
| 14923 | _g_free0 (_tmp149_)(_tmp149_ = (g_free (_tmp149_), ((void*)0))); |
| 14924 | _bala_code_node_unref0 (_tmp147_)((_tmp147_ == ((void*)0)) ? ((void*)0) : (_tmp147_ = (bala_code_node_unref (_tmp147_), ((void*)0)))); |
| 14925 | target_var = _tmp153_; |
| 14926 | _tmp154_ = target_var; |
| 14927 | _tmp155_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14928 | _tmp156_ = _tmp155_; |
| 14929 | bala_local_variable_set_init (_tmp154_, _tmp156_ == NULL((void*)0)); |
| 14930 | _tmp157_ = target_var; |
| 14931 | bala_ccode_base_module_emit_temp_var (self, _tmp157_, FALSE(0)); |
| 14932 | _tmp158_ = deleg_type; |
| 14933 | if (bala_data_type_is_disposable ((BalaDataType*) _tmp158_)) { |
| 14934 | BalaLocalVariable* target_destroy_notify_var = NULL((void*)0); |
| 14935 | BalaDelegateType* _tmp159_; |
| 14936 | BalaDataType* _tmp160_; |
| 14937 | BalaDataType* _tmp161_; |
| 14938 | gchar* _tmp162_; |
| 14939 | gchar* _tmp163_; |
| 14940 | gchar* _tmp164_; |
| 14941 | gchar* _tmp165_; |
| 14942 | BalaLocalVariable* _tmp166_; |
| 14943 | BalaLocalVariable* _tmp167_; |
| 14944 | BalaLocalVariable* _tmp168_; |
| 14945 | BalaExpression* _tmp169_; |
| 14946 | BalaExpression* _tmp170_; |
| 14947 | BalaLocalVariable* _tmp171_; |
| 14948 | _tmp159_ = self->delegate_target_destroy_type; |
| 14949 | _tmp160_ = bala_data_type_copy ((BalaDataType*) _tmp159_); |
| 14950 | _tmp161_ = _tmp160_; |
| 14951 | _tmp162_ = bala_ccode_base_module_get_local_cname (self, local); |
| 14952 | _tmp163_ = _tmp162_; |
| 14953 | _tmp164_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cname (self, _tmp163_); |
| 14954 | _tmp165_ = _tmp164_; |
| 14955 | _tmp166_ = bala_local_variable_new (_tmp161_, _tmp165_, NULL((void*)0), NULL((void*)0)); |
| 14956 | _tmp167_ = _tmp166_; |
| 14957 | _g_free0 (_tmp165_)(_tmp165_ = (g_free (_tmp165_), ((void*)0))); |
| 14958 | _g_free0 (_tmp163_)(_tmp163_ = (g_free (_tmp163_), ((void*)0))); |
| 14959 | _bala_code_node_unref0 (_tmp161_)((_tmp161_ == ((void*)0)) ? ((void*)0) : (_tmp161_ = (bala_code_node_unref (_tmp161_), ((void*)0)))); |
| 14960 | target_destroy_notify_var = _tmp167_; |
| 14961 | _tmp168_ = target_destroy_notify_var; |
| 14962 | _tmp169_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14963 | _tmp170_ = _tmp169_; |
| 14964 | bala_local_variable_set_init (_tmp168_, _tmp170_ == NULL((void*)0)); |
| 14965 | _tmp171_ = target_destroy_notify_var; |
| 14966 | bala_ccode_base_module_emit_temp_var (self, _tmp171_, FALSE(0)); |
| 14967 | _bala_code_node_unref0 (target_destroy_notify_var)((target_destroy_notify_var == ((void*)0)) ? ((void*)0) : (target_destroy_notify_var = (bala_code_node_unref (target_destroy_notify_var), ((void* )0)))); |
| 14968 | } |
| 14969 | _bala_code_node_unref0 (target_var)((target_var == ((void*)0)) ? ((void*)0) : (target_var = (bala_code_node_unref (target_var), ((void*)0)))); |
| 14970 | } |
| 14971 | _bala_code_node_unref0 (deleg_type)((deleg_type == ((void*)0)) ? ((void*)0) : (deleg_type = (bala_code_node_unref (deleg_type), ((void*)0)))); |
| 14972 | } |
| 14973 | } |
| 14974 | } |
| 14975 | _tmp172_ = rhs; |
| 14976 | if (_tmp172_ != NULL((void*)0)) { |
| 14977 | BalaExpression* _tmp173_; |
| 14978 | BalaExpression* _tmp174_; |
| 14979 | _tmp173_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14980 | _tmp174_ = _tmp173_; |
| 14981 | if (!bala_ccode_base_module_is_simple_struct_creation (self, (BalaVariable*) local, _tmp174_)) { |
| 14982 | BalaExpression* _tmp175_; |
| 14983 | BalaExpression* _tmp176_; |
| 14984 | BalaTargetValue* _tmp177_; |
| 14985 | BalaTargetValue* _tmp178_; |
| 14986 | BalaSourceReference* _tmp179_; |
| 14987 | BalaSourceReference* _tmp180_; |
| 14988 | _tmp175_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14989 | _tmp176_ = _tmp175_; |
| 14990 | _tmp177_ = bala_expression_get_target_value (_tmp176_); |
| 14991 | _tmp178_ = _tmp177_; |
| 14992 | _tmp179_ = bala_code_node_get_source_reference ((BalaCodeNode*) local); |
| 14993 | _tmp180_ = _tmp179_; |
| 14994 | bala_code_generator_store_local ((BalaCodeGenerator*) self, local, _tmp178_, TRUE(!(0)), _tmp180_); |
| 14995 | } |
| 14996 | } |
| 14997 | _tmp182_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 14998 | _tmp183_ = _tmp182_; |
| 14999 | if (_tmp183_ != NULL((void*)0)) { |
| 15000 | BalaExpression* _tmp184_; |
| 15001 | BalaExpression* _tmp185_; |
| 15002 | gboolean _tmp186_; |
| 15003 | gboolean _tmp187_; |
| 15004 | _tmp184_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 15005 | _tmp185_ = _tmp184_; |
| 15006 | _tmp186_ = bala_code_node_get_tree_can_fail ((BalaCodeNode*) _tmp185_); |
| 15007 | _tmp187_ = _tmp186_; |
| 15008 | _tmp181_ = _tmp187_; |
| 15009 | } else { |
| 15010 | _tmp181_ = FALSE(0); |
| 15011 | } |
| 15012 | if (_tmp181_) { |
| 15013 | BalaExpression* _tmp188_; |
| 15014 | BalaExpression* _tmp189_; |
| 15015 | _tmp188_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 15016 | _tmp189_ = _tmp188_; |
| 15017 | bala_ccode_base_module_add_simple_check (self, (BalaCodeNode*) _tmp189_, FALSE(0)); |
| 15018 | } |
| 15019 | bala_symbol_set_active ((BalaSymbol*) local, TRUE(!(0))); |
| 15020 | _bala_ccode_node_unref0 (rhs)((rhs == ((void*)0)) ? ((void*)0) : (rhs = (bala_ccode_node_unref (rhs), ((void*)0)))); |
| 15021 | } |
| 15022 | |
| 15023 | /** |
| 15024 | * Create a temporary variable and return lvalue access to it |
| 15025 | */ |
| 15026 | BalaTargetValue* |
| 15027 | bala_ccode_base_module_create_temp_value (BalaCCodeBaseModule* self, |
| 15028 | BalaDataType* type, |
| 15029 | gboolean init, |
| 15030 | BalaCodeNode* node_reference, |
| 15031 | gboolean* value_owned) |
| 15032 | { |
| 15033 | BalaLocalVariable* local = NULL((void*)0); |
| 15034 | BalaDataType* _tmp2_; |
| 15035 | BalaDataType* _tmp3_; |
| 15036 | gint _tmp4_; |
| 15037 | gint _tmp5_; |
| 15038 | gchar* _tmp6_; |
| 15039 | gchar* _tmp7_; |
| 15040 | BalaSourceReference* _tmp8_; |
| 15041 | BalaSourceReference* _tmp9_; |
| 15042 | BalaLocalVariable* _tmp10_; |
| 15043 | BalaLocalVariable* _tmp11_; |
| 15044 | BalaLocalVariable* _tmp12_; |
| 15045 | BalaArrayType* array_type = NULL((void*)0); |
| 15046 | BalaLocalVariable* _tmp16_; |
| 15047 | BalaDataType* _tmp17_; |
| 15048 | BalaDataType* _tmp18_; |
| 15049 | BalaArrayType* _tmp19_; |
| 15050 | BalaDelegateType* deleg_type = NULL((void*)0); |
| 15051 | BalaLocalVariable* _tmp20_; |
| 15052 | BalaDataType* _tmp21_; |
| 15053 | BalaDataType* _tmp22_; |
| 15054 | BalaDelegateType* _tmp23_; |
| 15055 | BalaLocalVariable* _tmp24_; |
| 15056 | BalaArrayType* _tmp25_; |
| 15057 | BalaTargetValue* value = NULL((void*)0); |
| 15058 | BalaLocalVariable* _tmp83_; |
| 15059 | BalaTargetValue* _tmp84_; |
| 15060 | BalaTargetValue* result = NULL((void*)0); |
| 15061 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 15062 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 15063 | g_return_val_if_fail (node_reference != NULL, NULL)do { if ((node_reference != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "node_reference != NULL" ); return (((void*)0)); } } while (0); |
| 15064 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_VOID_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_void_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 15065 | BalaSourceReference* _tmp0_; |
| 15066 | BalaSourceReference* _tmp1_; |
| 15067 | _tmp0_ = bala_code_node_get_source_reference (node_reference); |
| 15068 | _tmp1_ = _tmp0_; |
| 15069 | bala_report_error (_tmp1_, "internal: 'void' not supported as variable type"); |
| 15070 | } |
| 15071 | _tmp2_ = bala_data_type_copy (type); |
| 15072 | _tmp3_ = _tmp2_; |
| 15073 | _tmp4_ = bala_ccode_base_module_get_next_temp_var_id (self); |
| 15074 | _tmp5_ = _tmp4_; |
| 15075 | bala_ccode_base_module_set_next_temp_var_id (self, _tmp5_ + 1); |
| 15076 | _tmp6_ = g_strdup_printf ("_tmp%d_", _tmp5_); |
| 15077 | _tmp7_ = _tmp6_; |
| 15078 | _tmp8_ = bala_code_node_get_source_reference (node_reference); |
| 15079 | _tmp9_ = _tmp8_; |
| 15080 | _tmp10_ = bala_local_variable_new (_tmp3_, _tmp7_, NULL((void*)0), _tmp9_); |
| 15081 | _tmp11_ = _tmp10_; |
| 15082 | _g_free0 (_tmp7_)(_tmp7_ = (g_free (_tmp7_), ((void*)0))); |
| 15083 | _bala_code_node_unref0 (_tmp3_)((_tmp3_ == ((void*)0)) ? ((void*)0) : (_tmp3_ = (bala_code_node_unref (_tmp3_), ((void*)0)))); |
| 15084 | local = _tmp11_; |
| 15085 | _tmp12_ = local; |
| 15086 | bala_local_variable_set_init (_tmp12_, init); |
| 15087 | if (value_owned != NULL((void*)0)) { |
| 15088 | BalaLocalVariable* _tmp13_; |
| 15089 | BalaDataType* _tmp14_; |
| 15090 | BalaDataType* _tmp15_; |
| 15091 | _tmp13_ = local; |
| 15092 | _tmp14_ = bala_variable_get_variable_type ((BalaVariable*) _tmp13_); |
| 15093 | _tmp15_ = _tmp14_; |
| 15094 | bala_data_type_set_value_owned (_tmp15_, *value_owned); |
| 15095 | } |
| 15096 | _tmp16_ = local; |
| 15097 | _tmp17_ = bala_variable_get_variable_type ((BalaVariable*) _tmp16_); |
| 15098 | _tmp18_ = _tmp17_; |
| 15099 | _tmp19_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp18_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) _tmp18_) : NULL((void*)0)); |
| 15100 | array_type = _tmp19_; |
| 15101 | _tmp20_ = local; |
| 15102 | _tmp21_ = bala_variable_get_variable_type ((BalaVariable*) _tmp20_); |
| 15103 | _tmp22_ = _tmp21_; |
| 15104 | _tmp23_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp22_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp22_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaDelegateType*) _tmp22_) : NULL((void*)0)); |
| 15105 | deleg_type = _tmp23_; |
| 15106 | _tmp24_ = local; |
| 15107 | bala_ccode_base_module_emit_temp_var (self, _tmp24_, FALSE(0)); |
| 15108 | _tmp25_ = array_type; |
| 15109 | if (_tmp25_ != NULL((void*)0)) { |
| 15110 | { |
| 15111 | gint dim = 0; |
| 15112 | dim = 1; |
| 15113 | { |
| 15114 | gboolean _tmp26_ = FALSE(0); |
| 15115 | _tmp26_ = TRUE(!(0)); |
| 15116 | while (TRUE(!(0))) { |
| 15117 | BalaArrayType* _tmp28_; |
| 15118 | gint _tmp29_; |
| 15119 | gint _tmp30_; |
| 15120 | BalaLocalVariable* len_var = NULL((void*)0); |
| 15121 | BalaArrayType* _tmp31_; |
| 15122 | BalaDataType* _tmp32_; |
| 15123 | BalaDataType* _tmp33_; |
| 15124 | BalaDataType* _tmp34_; |
| 15125 | BalaDataType* _tmp35_; |
| 15126 | BalaLocalVariable* _tmp36_; |
| 15127 | const gchar* _tmp37_; |
| 15128 | const gchar* _tmp38_; |
| 15129 | gchar* _tmp39_; |
| 15130 | gchar* _tmp40_; |
| 15131 | BalaSourceReference* _tmp41_; |
| 15132 | BalaSourceReference* _tmp42_; |
| 15133 | BalaLocalVariable* _tmp43_; |
| 15134 | BalaLocalVariable* _tmp44_; |
| 15135 | BalaLocalVariable* _tmp45_; |
| 15136 | BalaLocalVariable* _tmp46_; |
| 15137 | if (!_tmp26_) { |
| 15138 | gint _tmp27_; |
| 15139 | _tmp27_ = dim; |
| 15140 | dim = _tmp27_ + 1; |
| 15141 | } |
| 15142 | _tmp26_ = FALSE(0); |
| 15143 | _tmp28_ = array_type; |
| 15144 | _tmp29_ = bala_array_type_get_rank (_tmp28_); |
| 15145 | _tmp30_ = _tmp29_; |
| 15146 | if (!(dim <= _tmp30_)) { |
| 15147 | break; |
| 15148 | } |
| 15149 | _tmp31_ = array_type; |
| 15150 | _tmp32_ = bala_array_type_get_length_type (_tmp31_); |
| 15151 | _tmp33_ = _tmp32_; |
| 15152 | _tmp34_ = bala_data_type_copy (_tmp33_); |
| 15153 | _tmp35_ = _tmp34_; |
| 15154 | _tmp36_ = local; |
| 15155 | _tmp37_ = bala_symbol_get_name ((BalaSymbol*) _tmp36_); |
| 15156 | _tmp38_ = _tmp37_; |
| 15157 | _tmp39_ = bala_ccode_base_module_get_array_length_cname (self, _tmp38_, dim); |
| 15158 | _tmp40_ = _tmp39_; |
| 15159 | _tmp41_ = bala_code_node_get_source_reference (node_reference); |
| 15160 | _tmp42_ = _tmp41_; |
| 15161 | _tmp43_ = bala_local_variable_new (_tmp35_, _tmp40_, NULL((void*)0), _tmp42_); |
| 15162 | _tmp44_ = _tmp43_; |
| 15163 | _g_free0 (_tmp40_)(_tmp40_ = (g_free (_tmp40_), ((void*)0))); |
| 15164 | _bala_code_node_unref0 (_tmp35_)((_tmp35_ == ((void*)0)) ? ((void*)0) : (_tmp35_ = (bala_code_node_unref (_tmp35_), ((void*)0)))); |
| 15165 | len_var = _tmp44_; |
| 15166 | _tmp45_ = len_var; |
| 15167 | bala_local_variable_set_init (_tmp45_, init); |
| 15168 | _tmp46_ = len_var; |
| 15169 | bala_ccode_base_module_emit_temp_var (self, _tmp46_, FALSE(0)); |
| 15170 | _bala_code_node_unref0 (len_var)((len_var == ((void*)0)) ? ((void*)0) : (len_var = (bala_code_node_unref (len_var), ((void*)0)))); |
| 15171 | } |
| 15172 | } |
| 15173 | } |
| 15174 | } else { |
| 15175 | gboolean _tmp47_ = FALSE(0); |
| 15176 | BalaDelegateType* _tmp48_; |
| 15177 | _tmp48_ = deleg_type; |
| 15178 | if (_tmp48_ != NULL((void*)0)) { |
| 15179 | BalaDelegateType* _tmp49_; |
| 15180 | BalaDelegate* _tmp50_; |
| 15181 | BalaDelegate* _tmp51_; |
| 15182 | gboolean _tmp52_; |
| 15183 | gboolean _tmp53_; |
| 15184 | _tmp49_ = deleg_type; |
| 15185 | _tmp50_ = bala_delegate_type_get_delegate_symbol (_tmp49_); |
| 15186 | _tmp51_ = _tmp50_; |
| 15187 | _tmp52_ = bala_delegate_get_has_target (_tmp51_); |
| 15188 | _tmp53_ = _tmp52_; |
| 15189 | _tmp47_ = _tmp53_; |
| 15190 | } else { |
| 15191 | _tmp47_ = FALSE(0); |
| 15192 | } |
| 15193 | if (_tmp47_) { |
| 15194 | BalaLocalVariable* target_var = NULL((void*)0); |
| 15195 | BalaDataType* _tmp54_; |
| 15196 | BalaDataType* _tmp55_; |
| 15197 | BalaDataType* _tmp56_; |
| 15198 | BalaLocalVariable* _tmp57_; |
| 15199 | const gchar* _tmp58_; |
| 15200 | const gchar* _tmp59_; |
| 15201 | gchar* _tmp60_; |
| 15202 | gchar* _tmp61_; |
| 15203 | BalaSourceReference* _tmp62_; |
| 15204 | BalaSourceReference* _tmp63_; |
| 15205 | BalaLocalVariable* _tmp64_; |
| 15206 | BalaLocalVariable* _tmp65_; |
| 15207 | BalaLocalVariable* _tmp66_; |
| 15208 | BalaLocalVariable* _tmp67_; |
| 15209 | BalaDelegateType* _tmp68_; |
| 15210 | _tmp54_ = self->delegate_target_type; |
| 15211 | _tmp55_ = bala_data_type_copy (_tmp54_); |
| 15212 | _tmp56_ = _tmp55_; |
| 15213 | _tmp57_ = local; |
| 15214 | _tmp58_ = bala_symbol_get_name ((BalaSymbol*) _tmp57_); |
| 15215 | _tmp59_ = _tmp58_; |
| 15216 | _tmp60_ = bala_ccode_base_module_get_delegate_target_cname (self, _tmp59_); |
| 15217 | _tmp61_ = _tmp60_; |
| 15218 | _tmp62_ = bala_code_node_get_source_reference (node_reference); |
| 15219 | _tmp63_ = _tmp62_; |
| 15220 | _tmp64_ = bala_local_variable_new (_tmp56_, _tmp61_, NULL((void*)0), _tmp63_); |
| 15221 | _tmp65_ = _tmp64_; |
| 15222 | _g_free0 (_tmp61_)(_tmp61_ = (g_free (_tmp61_), ((void*)0))); |
| 15223 | _bala_code_node_unref0 (_tmp56_)((_tmp56_ == ((void*)0)) ? ((void*)0) : (_tmp56_ = (bala_code_node_unref (_tmp56_), ((void*)0)))); |
| 15224 | target_var = _tmp65_; |
| 15225 | _tmp66_ = target_var; |
| 15226 | bala_local_variable_set_init (_tmp66_, init); |
| 15227 | _tmp67_ = target_var; |
| 15228 | bala_ccode_base_module_emit_temp_var (self, _tmp67_, FALSE(0)); |
| 15229 | _tmp68_ = deleg_type; |
| 15230 | if (bala_data_type_is_disposable ((BalaDataType*) _tmp68_)) { |
| 15231 | BalaLocalVariable* target_destroy_notify_var = NULL((void*)0); |
| 15232 | BalaDelegateType* _tmp69_; |
| 15233 | BalaDataType* _tmp70_; |
| 15234 | BalaDataType* _tmp71_; |
| 15235 | BalaLocalVariable* _tmp72_; |
| 15236 | const gchar* _tmp73_; |
| 15237 | const gchar* _tmp74_; |
| 15238 | gchar* _tmp75_; |
| 15239 | gchar* _tmp76_; |
| 15240 | BalaSourceReference* _tmp77_; |
| 15241 | BalaSourceReference* _tmp78_; |
| 15242 | BalaLocalVariable* _tmp79_; |
| 15243 | BalaLocalVariable* _tmp80_; |
| 15244 | BalaLocalVariable* _tmp81_; |
| 15245 | BalaLocalVariable* _tmp82_; |
| 15246 | _tmp69_ = self->delegate_target_destroy_type; |
| 15247 | _tmp70_ = bala_data_type_copy ((BalaDataType*) _tmp69_); |
| 15248 | _tmp71_ = _tmp70_; |
| 15249 | _tmp72_ = local; |
| 15250 | _tmp73_ = bala_symbol_get_name ((BalaSymbol*) _tmp72_); |
| 15251 | _tmp74_ = _tmp73_; |
| 15252 | _tmp75_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cname (self, _tmp74_); |
| 15253 | _tmp76_ = _tmp75_; |
| 15254 | _tmp77_ = bala_code_node_get_source_reference (node_reference); |
| 15255 | _tmp78_ = _tmp77_; |
| 15256 | _tmp79_ = bala_local_variable_new (_tmp71_, _tmp76_, NULL((void*)0), _tmp78_); |
| 15257 | _tmp80_ = _tmp79_; |
| 15258 | _g_free0 (_tmp76_)(_tmp76_ = (g_free (_tmp76_), ((void*)0))); |
| 15259 | _bala_code_node_unref0 (_tmp71_)((_tmp71_ == ((void*)0)) ? ((void*)0) : (_tmp71_ = (bala_code_node_unref (_tmp71_), ((void*)0)))); |
| 15260 | target_destroy_notify_var = _tmp80_; |
| 15261 | _tmp81_ = target_destroy_notify_var; |
| 15262 | bala_local_variable_set_init (_tmp81_, init); |
| 15263 | _tmp82_ = target_destroy_notify_var; |
| 15264 | bala_ccode_base_module_emit_temp_var (self, _tmp82_, FALSE(0)); |
| 15265 | _bala_code_node_unref0 (target_destroy_notify_var)((target_destroy_notify_var == ((void*)0)) ? ((void*)0) : (target_destroy_notify_var = (bala_code_node_unref (target_destroy_notify_var), ((void* )0)))); |
| 15266 | } |
| 15267 | _bala_code_node_unref0 (target_var)((target_var == ((void*)0)) ? ((void*)0) : (target_var = (bala_code_node_unref (target_var), ((void*)0)))); |
| 15268 | } |
| 15269 | } |
| 15270 | _tmp83_ = local; |
| 15271 | _tmp84_ = bala_ccode_base_module_get_local_cvalue (self, _tmp83_); |
| 15272 | value = _tmp84_; |
| 15273 | bala_set_array_size_cvalue (value, NULL((void*)0)); |
| 15274 | result = value; |
| 15275 | _bala_code_node_unref0 (deleg_type)((deleg_type == ((void*)0)) ? ((void*)0) : (deleg_type = (bala_code_node_unref (deleg_type), ((void*)0)))); |
| 15276 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 15277 | _bala_code_node_unref0 (local)((local == ((void*)0)) ? ((void*)0) : (local = (bala_code_node_unref (local), ((void*)0)))); |
| 15278 | return result; |
| 15279 | } |
| 15280 | |
| 15281 | /** |
| 15282 | * Load a temporary variable returning unowned or owned rvalue access to it, depending on the ownership of the value type. |
| 15283 | */ |
| 15284 | BalaTargetValue* |
| 15285 | bala_ccode_base_module_load_temp_value (BalaCCodeBaseModule* self, |
| 15286 | BalaTargetValue* lvalue) |
| 15287 | { |
| 15288 | BalaGLibValue* value = NULL((void*)0); |
| 15289 | BalaGLibValue* _tmp0_; |
| 15290 | BalaDelegateType* deleg_type = NULL((void*)0); |
| 15291 | BalaGLibValue* _tmp1_; |
| 15292 | BalaDataType* _tmp2_; |
| 15293 | BalaDataType* _tmp3_; |
| 15294 | BalaDelegateType* _tmp4_; |
| 15295 | BalaDelegateType* _tmp5_; |
| 15296 | BalaTargetValue* result = NULL((void*)0); |
| 15297 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 15298 | g_return_val_if_fail (lvalue != NULL, NULL)do { if ((lvalue != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "lvalue != NULL" ); return (((void*)0)); } } while (0); |
| 15299 | _tmp0_ = bala_glib_value_copy (G_TYPE_CHECK_INSTANCE_CAST (lvalue, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (lvalue), ((bala_glib_value_get_type ())))))); |
| 15300 | value = _tmp0_; |
| 15301 | _tmp1_ = value; |
| 15302 | _tmp2_ = bala_target_value_get_value_type ((BalaTargetValue*) _tmp1_); |
| 15303 | _tmp3_ = _tmp2_; |
| 15304 | _tmp4_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaDelegateType*) _tmp3_) : NULL((void*)0)); |
| 15305 | deleg_type = _tmp4_; |
| 15306 | _tmp5_ = deleg_type; |
| 15307 | if (_tmp5_ != NULL((void*)0)) { |
| 15308 | BalaDelegateType* _tmp6_; |
| 15309 | BalaDelegate* _tmp7_; |
| 15310 | BalaDelegate* _tmp8_; |
| 15311 | gboolean _tmp9_; |
| 15312 | gboolean _tmp10_; |
| 15313 | _tmp6_ = deleg_type; |
| 15314 | _tmp7_ = bala_delegate_type_get_delegate_symbol (_tmp6_); |
| 15315 | _tmp8_ = _tmp7_; |
| 15316 | _tmp9_ = bala_delegate_get_has_target (_tmp8_); |
| 15317 | _tmp10_ = _tmp9_; |
| 15318 | if (!_tmp10_) { |
| 15319 | BalaGLibValue* _tmp11_; |
| 15320 | BalaCCodeConstant* _tmp12_; |
| 15321 | BalaGLibValue* _tmp13_; |
| 15322 | _tmp11_ = value; |
| 15323 | _tmp12_ = bala_ccode_constant_new ("NULL"); |
| 15324 | _bala_ccode_node_unref0 (_tmp11_->delegate_target_cvalue)((_tmp11_->delegate_target_cvalue == ((void*)0)) ? ((void* )0) : (_tmp11_->delegate_target_cvalue = (bala_ccode_node_unref (_tmp11_->delegate_target_cvalue), ((void*)0)))); |
| 15325 | _tmp11_->delegate_target_cvalue = (BalaCCodeExpression*) _tmp12_; |
| 15326 | _tmp13_ = value; |
| 15327 | G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp13_), ((bala_glib_value_get_type ())))))->lvalue = FALSE(0); |
| 15328 | } else { |
| 15329 | BalaDelegateType* _tmp14_; |
| 15330 | _tmp14_ = deleg_type; |
| 15331 | if (!bala_data_type_is_disposable ((BalaDataType*) _tmp14_)) { |
| 15332 | BalaGLibValue* _tmp15_; |
| 15333 | BalaCCodeConstant* _tmp16_; |
| 15334 | BalaGLibValue* _tmp17_; |
| 15335 | _tmp15_ = value; |
| 15336 | _tmp16_ = bala_ccode_constant_new ("NULL"); |
| 15337 | _bala_ccode_node_unref0 (_tmp15_->delegate_target_destroy_notify_cvalue)((_tmp15_->delegate_target_destroy_notify_cvalue == ((void *)0)) ? ((void*)0) : (_tmp15_->delegate_target_destroy_notify_cvalue = (bala_ccode_node_unref (_tmp15_->delegate_target_destroy_notify_cvalue ), ((void*)0)))); |
| 15338 | _tmp15_->delegate_target_destroy_notify_cvalue = (BalaCCodeExpression*) _tmp16_; |
| 15339 | _tmp17_ = value; |
| 15340 | G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp17_), ((bala_glib_value_get_type ())))))->lvalue = FALSE(0); |
| 15341 | } |
| 15342 | } |
| 15343 | } |
| 15344 | result = (BalaTargetValue*) value; |
| 15345 | _bala_code_node_unref0 (deleg_type)((deleg_type == ((void*)0)) ? ((void*)0) : (deleg_type = (bala_code_node_unref (deleg_type), ((void*)0)))); |
| 15346 | return result; |
| 15347 | } |
| 15348 | |
| 15349 | /** |
| 15350 | * Store a value in a temporary variable and return unowned or owned rvalue access to it, depending on the ownership of the given type. |
| 15351 | */ |
| 15352 | BalaTargetValue* |
| 15353 | bala_ccode_base_module_store_temp_value (BalaCCodeBaseModule* self, |
| 15354 | BalaTargetValue* initializer, |
| 15355 | BalaCodeNode* node_reference, |
| 15356 | gboolean* value_owned) |
| 15357 | { |
| 15358 | BalaTargetValue* lvalue = NULL((void*)0); |
| 15359 | BalaDataType* _tmp0_; |
| 15360 | BalaDataType* _tmp1_; |
| 15361 | BalaTargetValue* _tmp2_; |
| 15362 | BalaSourceReference* _tmp3_; |
| 15363 | BalaSourceReference* _tmp4_; |
| 15364 | BalaTargetValue* _tmp5_; |
| 15365 | BalaTargetValue* result = NULL((void*)0); |
| 15366 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 15367 | g_return_val_if_fail (initializer != NULL, NULL)do { if ((initializer != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "initializer != NULL" ); return (((void*)0)); } } while (0); |
| 15368 | g_return_val_if_fail (node_reference != NULL, NULL)do { if ((node_reference != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "node_reference != NULL" ); return (((void*)0)); } } while (0); |
| 15369 | _tmp0_ = bala_target_value_get_value_type (initializer); |
| 15370 | _tmp1_ = _tmp0_; |
| 15371 | _tmp2_ = bala_ccode_base_module_create_temp_value (self, _tmp1_, FALSE(0), node_reference, value_owned); |
| 15372 | lvalue = _tmp2_; |
| 15373 | _tmp3_ = bala_code_node_get_source_reference (node_reference); |
| 15374 | _tmp4_ = _tmp3_; |
| 15375 | bala_ccode_base_module_store_value (self, lvalue, initializer, _tmp4_); |
| 15376 | _tmp5_ = bala_ccode_base_module_load_temp_value (self, lvalue); |
| 15377 | result = _tmp5_; |
| 15378 | _bala_target_value_unref0 (lvalue)((lvalue == ((void*)0)) ? ((void*)0) : (lvalue = (bala_target_value_unref (lvalue), ((void*)0)))); |
| 15379 | return result; |
| 15380 | } |
| 15381 | |
| 15382 | static void |
| 15383 | bala_ccode_base_module_real_visit_initializer_list (BalaCodeVisitor* base, |
| 15384 | BalaInitializerList* list) |
| 15385 | { |
| 15386 | BalaCCodeBaseModule * self; |
| 15387 | BalaDataType* _tmp0_; |
| 15388 | BalaDataType* _tmp1_; |
| 15389 | BalaTypeSymbol* _tmp2_; |
| 15390 | BalaTypeSymbol* _tmp3_; |
| 15391 | self = (BalaCCodeBaseModule*) base; |
| 15392 | g_return_if_fail (list != NULL)do { if ((list != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "list != NULL" ); return; } } while (0); |
| 15393 | _tmp0_ = bala_expression_get_target_type ((BalaExpression*) list); |
| 15394 | _tmp1_ = _tmp0_; |
| 15395 | _tmp2_ = bala_data_type_get_type_symbol (_tmp1_); |
| 15396 | _tmp3_ = _tmp2_; |
| 15397 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 15398 | BalaStruct* st = NULL((void*)0); |
| 15399 | BalaDataType* _tmp4_; |
| 15400 | BalaDataType* _tmp5_; |
| 15401 | BalaTypeSymbol* _tmp6_; |
| 15402 | BalaTypeSymbol* _tmp7_; |
| 15403 | gboolean _tmp14_ = FALSE(0); |
| 15404 | gboolean _tmp15_ = FALSE(0); |
| 15405 | BalaCodeNode* _tmp16_; |
| 15406 | BalaCodeNode* _tmp17_; |
| 15407 | _tmp4_ = bala_expression_get_target_type ((BalaExpression*) list); |
| 15408 | _tmp5_ = _tmp4_; |
| 15409 | _tmp6_ = bala_data_type_get_type_symbol (_tmp5_); |
| 15410 | _tmp7_ = _tmp6_; |
| 15411 | st = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp7_), ((bala_struct_get_type ()))))); |
| 15412 | while (TRUE(!(0))) { |
| 15413 | BalaStruct* _tmp8_; |
| 15414 | BalaStruct* _tmp9_; |
| 15415 | BalaStruct* _tmp10_; |
| 15416 | BalaStruct* _tmp11_; |
| 15417 | BalaStruct* _tmp12_; |
| 15418 | BalaStruct* _tmp13_; |
| 15419 | _tmp8_ = st; |
| 15420 | _tmp9_ = bala_struct_get_base_struct (_tmp8_); |
| 15421 | _tmp10_ = _tmp9_; |
| 15422 | if (!(_tmp10_ != NULL((void*)0))) { |
| 15423 | break; |
| 15424 | } |
| 15425 | _tmp11_ = st; |
| 15426 | _tmp12_ = bala_struct_get_base_struct (_tmp11_); |
| 15427 | _tmp13_ = _tmp12_; |
| 15428 | st = _tmp13_; |
| 15429 | } |
| 15430 | _tmp16_ = bala_code_node_get_parent_node ((BalaCodeNode*) list); |
| 15431 | _tmp17_ = _tmp16_; |
| 15432 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, BALA_TYPE_CONSTANT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp17_); GType __t = ((bala_constant_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 15433 | _tmp15_ = TRUE(!(0)); |
| 15434 | } else { |
| 15435 | BalaCodeNode* _tmp18_; |
| 15436 | BalaCodeNode* _tmp19_; |
| 15437 | _tmp18_ = bala_code_node_get_parent_node ((BalaCodeNode*) list); |
| 15438 | _tmp19_ = _tmp18_; |
| 15439 | _tmp15_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, BALA_TYPE_FIELD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp19_); GType __t = ((bala_field_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 15440 | } |
| 15441 | if (_tmp15_) { |
| 15442 | _tmp14_ = TRUE(!(0)); |
| 15443 | } else { |
| 15444 | BalaCodeNode* _tmp20_; |
| 15445 | BalaCodeNode* _tmp21_; |
| 15446 | _tmp20_ = bala_code_node_get_parent_node ((BalaCodeNode*) list); |
| 15447 | _tmp21_ = _tmp20_; |
| 15448 | _tmp14_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, BALA_TYPE_INITIALIZER_LIST)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp21_); GType __t = ((bala_initializer_list_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 15449 | } |
| 15450 | if (_tmp14_) { |
| 15451 | BalaCCodeInitializerList* clist = NULL((void*)0); |
| 15452 | BalaCCodeInitializerList* _tmp22_; |
| 15453 | BalaIterator* field_it = NULL((void*)0); |
| 15454 | BalaStruct* _tmp23_; |
| 15455 | BalaList* _tmp24_; |
| 15456 | BalaIterator* _tmp25_; |
| 15457 | gboolean _tmp88_ = FALSE(0); |
| 15458 | BalaCodeNode* _tmp89_; |
| 15459 | BalaCodeNode* _tmp90_; |
| 15460 | _tmp22_ = bala_ccode_initializer_list_new (); |
| 15461 | clist = _tmp22_; |
| 15462 | _tmp23_ = st; |
| 15463 | _tmp24_ = bala_struct_get_fields (_tmp23_); |
| 15464 | _tmp25_ = bala_iterable_iterator ((BalaIterable*) _tmp24_); |
| 15465 | field_it = _tmp25_; |
| 15466 | { |
| 15467 | BalaList* _expr_list = NULL((void*)0); |
| 15468 | BalaList* _tmp26_; |
| 15469 | BalaList* _tmp27_; |
| 15470 | gint _expr_size = 0; |
| 15471 | BalaList* _tmp28_; |
| 15472 | gint _tmp29_; |
| 15473 | gint _tmp30_; |
| 15474 | gint _expr_index = 0; |
| 15475 | _tmp26_ = bala_initializer_list_get_initializers (list); |
| 15476 | _tmp27_ = _bala_iterable_ref0 (_tmp26_); |
| 15477 | _expr_list = _tmp27_; |
| 15478 | _tmp28_ = _expr_list; |
| 15479 | _tmp29_ = bala_collection_get_size ((BalaCollection*) _tmp28_); |
| 15480 | _tmp30_ = _tmp29_; |
| 15481 | _expr_size = _tmp30_; |
| 15482 | _expr_index = -1; |
| 15483 | while (TRUE(!(0))) { |
| 15484 | gint _tmp31_; |
| 15485 | gint _tmp32_; |
| 15486 | BalaExpression* expr = NULL((void*)0); |
| 15487 | BalaList* _tmp33_; |
| 15488 | gpointer _tmp34_; |
| 15489 | BalaField* field = NULL((void*)0); |
| 15490 | BalaCCodeExpression* cexpr = NULL((void*)0); |
| 15491 | BalaExpression* _tmp42_; |
| 15492 | BalaCCodeExpression* _tmp43_; |
| 15493 | BalaCCodeExpression* _tmp44_; |
| 15494 | gchar* ctype = NULL((void*)0); |
| 15495 | BalaField* _tmp45_; |
| 15496 | gchar* _tmp46_; |
| 15497 | const gchar* _tmp47_; |
| 15498 | BalaCCodeInitializerList* _tmp51_; |
| 15499 | BalaCCodeExpression* _tmp52_; |
| 15500 | BalaArrayType* array_type = NULL((void*)0); |
| 15501 | BalaField* _tmp53_; |
| 15502 | BalaDataType* _tmp54_; |
| 15503 | BalaDataType* _tmp55_; |
| 15504 | BalaArrayType* _tmp56_; |
| 15505 | gboolean _tmp57_ = FALSE(0); |
| 15506 | gboolean _tmp58_ = FALSE(0); |
| 15507 | gboolean _tmp59_ = FALSE(0); |
| 15508 | BalaArrayType* _tmp60_; |
| 15509 | _expr_index = _expr_index + 1; |
| 15510 | _tmp31_ = _expr_index; |
| 15511 | _tmp32_ = _expr_size; |
| 15512 | if (!(_tmp31_ < _tmp32_)) { |
| 15513 | break; |
| 15514 | } |
| 15515 | _tmp33_ = _expr_list; |
| 15516 | _tmp34_ = bala_list_get (_tmp33_, _expr_index); |
| 15517 | expr = (BalaExpression*) _tmp34_; |
| 15518 | field = NULL((void*)0); |
| 15519 | while (TRUE(!(0))) { |
| 15520 | BalaField* _tmp35_; |
| 15521 | BalaIterator* _tmp36_; |
| 15522 | BalaIterator* _tmp37_; |
| 15523 | gpointer _tmp38_; |
| 15524 | BalaField* _tmp39_; |
| 15525 | BalaMemberBinding _tmp40_; |
| 15526 | BalaMemberBinding _tmp41_; |
| 15527 | _tmp35_ = field; |
| 15528 | if (!(_tmp35_ == NULL((void*)0))) { |
| 15529 | break; |
| 15530 | } |
| 15531 | _tmp36_ = field_it; |
| 15532 | bala_iterator_next (_tmp36_); |
| 15533 | _tmp37_ = field_it; |
| 15534 | _tmp38_ = bala_iterator_get (_tmp37_); |
| 15535 | _bala_code_node_unref0 (field)((field == ((void*)0)) ? ((void*)0) : (field = (bala_code_node_unref (field), ((void*)0)))); |
| 15536 | field = (BalaField*) _tmp38_; |
| 15537 | _tmp39_ = field; |
| 15538 | _tmp40_ = bala_field_get_binding (_tmp39_); |
| 15539 | _tmp41_ = _tmp40_; |
| 15540 | if (_tmp41_ != BALA_MEMBER_BINDING_INSTANCE) { |
| 15541 | _bala_code_node_unref0 (field)((field == ((void*)0)) ? ((void*)0) : (field = (bala_code_node_unref (field), ((void*)0)))); |
| 15542 | field = NULL((void*)0); |
| 15543 | } |
| 15544 | } |
| 15545 | _tmp42_ = expr; |
| 15546 | _tmp43_ = bala_get_cvalue (_tmp42_); |
| 15547 | _tmp44_ = _bala_ccode_node_ref0 (_tmp43_); |
| 15548 | cexpr = _tmp44_; |
| 15549 | _tmp45_ = field; |
| 15550 | _tmp46_ = bala_get_ccode_type ((BalaCodeNode*) _tmp45_); |
| 15551 | ctype = _tmp46_; |
| 15552 | _tmp47_ = ctype; |
| 15553 | if (_tmp47_ != NULL((void*)0)) { |
| 15554 | BalaCCodeExpression* _tmp48_; |
| 15555 | const gchar* _tmp49_; |
| 15556 | BalaCCodeCastExpression* _tmp50_; |
| 15557 | _tmp48_ = cexpr; |
| 15558 | _tmp49_ = ctype; |
| 15559 | _tmp50_ = bala_ccode_cast_expression_new (_tmp48_, _tmp49_); |
| 15560 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 15561 | cexpr = (BalaCCodeExpression*) _tmp50_; |
| 15562 | } |
| 15563 | _tmp51_ = clist; |
| 15564 | _tmp52_ = cexpr; |
| 15565 | bala_ccode_initializer_list_append (_tmp51_, _tmp52_); |
| 15566 | _tmp53_ = field; |
| 15567 | _tmp54_ = bala_variable_get_variable_type ((BalaVariable*) _tmp53_); |
| 15568 | _tmp55_ = _tmp54_; |
| 15569 | _tmp56_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp55_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp55_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) _tmp55_) : NULL((void*)0)); |
| 15570 | array_type = _tmp56_; |
| 15571 | _tmp60_ = array_type; |
| 15572 | if (_tmp60_ != NULL((void*)0)) { |
| 15573 | BalaArrayType* _tmp61_; |
| 15574 | gboolean _tmp62_; |
| 15575 | gboolean _tmp63_; |
| 15576 | _tmp61_ = array_type; |
| 15577 | _tmp62_ = bala_array_type_get_fixed_length (_tmp61_); |
| 15578 | _tmp63_ = _tmp62_; |
| 15579 | _tmp59_ = !_tmp63_; |
| 15580 | } else { |
| 15581 | _tmp59_ = FALSE(0); |
| 15582 | } |
| 15583 | if (_tmp59_) { |
| 15584 | BalaField* _tmp64_; |
| 15585 | _tmp64_ = field; |
| 15586 | _tmp58_ = bala_get_ccode_array_length ((BalaCodeNode*) _tmp64_); |
| 15587 | } else { |
| 15588 | _tmp58_ = FALSE(0); |
| 15589 | } |
| 15590 | if (_tmp58_) { |
| 15591 | BalaField* _tmp65_; |
| 15592 | _tmp65_ = field; |
| 15593 | _tmp57_ = !bala_get_ccode_array_null_terminated ((BalaCodeNode*) _tmp65_); |
| 15594 | } else { |
| 15595 | _tmp57_ = FALSE(0); |
| 15596 | } |
| 15597 | if (_tmp57_) { |
| 15598 | gboolean _tmp77_ = FALSE(0); |
| 15599 | BalaArrayType* _tmp78_; |
| 15600 | gint _tmp79_; |
| 15601 | gint _tmp80_; |
| 15602 | { |
| 15603 | gint dim = 0; |
| 15604 | dim = 1; |
| 15605 | { |
| 15606 | gboolean _tmp66_ = FALSE(0); |
| 15607 | _tmp66_ = TRUE(!(0)); |
| 15608 | while (TRUE(!(0))) { |
| 15609 | BalaArrayType* _tmp68_; |
| 15610 | gint _tmp69_; |
| 15611 | gint _tmp70_; |
| 15612 | BalaCCodeInitializerList* _tmp71_; |
| 15613 | BalaExpression* _tmp72_; |
| 15614 | BalaTargetValue* _tmp73_; |
| 15615 | BalaTargetValue* _tmp74_; |
| 15616 | BalaCCodeExpression* _tmp75_; |
| 15617 | BalaCCodeExpression* _tmp76_; |
| 15618 | if (!_tmp66_) { |
| 15619 | gint _tmp67_; |
| 15620 | _tmp67_ = dim; |
| 15621 | dim = _tmp67_ + 1; |
| 15622 | } |
| 15623 | _tmp66_ = FALSE(0); |
| 15624 | _tmp68_ = array_type; |
| 15625 | _tmp69_ = bala_array_type_get_rank (_tmp68_); |
| 15626 | _tmp70_ = _tmp69_; |
| 15627 | if (!(dim <= _tmp70_)) { |
| 15628 | break; |
| 15629 | } |
| 15630 | _tmp71_ = clist; |
| 15631 | _tmp72_ = expr; |
| 15632 | _tmp73_ = bala_expression_get_target_value (_tmp72_); |
| 15633 | _tmp74_ = _tmp73_; |
| 15634 | _tmp75_ = bala_ccode_base_module_get_array_length_cvalue (self, _tmp74_, dim); |
| 15635 | _tmp76_ = _tmp75_; |
| 15636 | bala_ccode_initializer_list_append (_tmp71_, _tmp76_); |
| 15637 | _bala_ccode_node_unref0 (_tmp76_)((_tmp76_ == ((void*)0)) ? ((void*)0) : (_tmp76_ = (bala_ccode_node_unref (_tmp76_), ((void*)0)))); |
| 15638 | } |
| 15639 | } |
| 15640 | } |
| 15641 | _tmp78_ = array_type; |
| 15642 | _tmp79_ = bala_array_type_get_rank (_tmp78_); |
| 15643 | _tmp80_ = _tmp79_; |
| 15644 | if (_tmp80_ == 1) { |
| 15645 | BalaField* _tmp81_; |
| 15646 | _tmp81_ = field; |
| 15647 | _tmp77_ = bala_symbol_is_internal_symbol ((BalaSymbol*) _tmp81_); |
| 15648 | } else { |
| 15649 | _tmp77_ = FALSE(0); |
| 15650 | } |
| 15651 | if (_tmp77_) { |
| 15652 | BalaCCodeInitializerList* _tmp82_; |
| 15653 | BalaExpression* _tmp83_; |
| 15654 | BalaTargetValue* _tmp84_; |
| 15655 | BalaTargetValue* _tmp85_; |
| 15656 | BalaCCodeExpression* _tmp86_; |
| 15657 | BalaCCodeExpression* _tmp87_; |
| 15658 | _tmp82_ = clist; |
| 15659 | _tmp83_ = expr; |
| 15660 | _tmp84_ = bala_expression_get_target_value (_tmp83_); |
| 15661 | _tmp85_ = _tmp84_; |
| 15662 | _tmp86_ = bala_ccode_base_module_get_array_length_cvalue (self, _tmp85_, 1); |
| 15663 | _tmp87_ = _tmp86_; |
| 15664 | bala_ccode_initializer_list_append (_tmp82_, _tmp87_); |
| 15665 | _bala_ccode_node_unref0 (_tmp87_)((_tmp87_ == ((void*)0)) ? ((void*)0) : (_tmp87_ = (bala_ccode_node_unref (_tmp87_), ((void*)0)))); |
| 15666 | } |
| 15667 | } |
| 15668 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 15669 | _g_free0 (ctype)(ctype = (g_free (ctype), ((void*)0))); |
| 15670 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 15671 | _bala_code_node_unref0 (field)((field == ((void*)0)) ? ((void*)0) : (field = (bala_code_node_unref (field), ((void*)0)))); |
| 15672 | _bala_code_node_unref0 (expr)((expr == ((void*)0)) ? ((void*)0) : (expr = (bala_code_node_unref (expr), ((void*)0)))); |
| 15673 | } |
| 15674 | _bala_iterable_unref0 (_expr_list)((_expr_list == ((void*)0)) ? ((void*)0) : (_expr_list = (bala_iterable_unref (_expr_list), ((void*)0)))); |
| 15675 | } |
| 15676 | _tmp89_ = bala_code_node_get_parent_node ((BalaCodeNode*) list); |
| 15677 | _tmp90_ = _tmp89_; |
| 15678 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp90_, BALA_TYPE_CONSTANT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp90_); GType __t = ((bala_constant_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 15679 | _tmp88_ = TRUE(!(0)); |
| 15680 | } else { |
| 15681 | gboolean _tmp91_ = FALSE(0); |
| 15682 | BalaCodeNode* _tmp92_; |
| 15683 | BalaCodeNode* _tmp93_; |
| 15684 | _tmp92_ = bala_code_node_get_parent_node ((BalaCodeNode*) list); |
| 15685 | _tmp93_ = _tmp92_; |
| 15686 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp93_, BALA_TYPE_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp93_); GType __t = ((bala_expression_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 15687 | BalaCodeNode* _tmp94_; |
| 15688 | BalaCodeNode* _tmp95_; |
| 15689 | BalaDataType* _tmp96_; |
| 15690 | BalaDataType* _tmp97_; |
| 15691 | _tmp94_ = bala_code_node_get_parent_node ((BalaCodeNode*) list); |
| 15692 | _tmp95_ = _tmp94_; |
| 15693 | _tmp96_ = bala_expression_get_value_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp95_, BALA_TYPE_EXPRESSION, BalaExpression)(((BalaExpression*) g_type_check_instance_cast ((GTypeInstance *) (_tmp95_), ((bala_expression_get_type ())))))); |
| 15694 | _tmp97_ = _tmp96_; |
| 15695 | _tmp91_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp97_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp97_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 15696 | } else { |
| 15697 | _tmp91_ = FALSE(0); |
| 15698 | } |
| 15699 | _tmp88_ = _tmp91_; |
| 15700 | } |
| 15701 | if (_tmp88_) { |
| 15702 | BalaCCodeInitializerList* _tmp98_; |
| 15703 | _tmp98_ = clist; |
| 15704 | bala_set_cvalue ((BalaExpression*) list, (BalaCCodeExpression*) _tmp98_); |
| 15705 | } else { |
| 15706 | BalaCCodeInitializerList* _tmp99_; |
| 15707 | BalaDataType* _tmp100_; |
| 15708 | BalaDataType* _tmp101_; |
| 15709 | BalaTypeSymbol* _tmp102_; |
| 15710 | BalaTypeSymbol* _tmp103_; |
| 15711 | gchar* _tmp104_; |
| 15712 | gchar* _tmp105_; |
| 15713 | BalaCCodeCastExpression* _tmp106_; |
| 15714 | BalaCCodeCastExpression* _tmp107_; |
| 15715 | _tmp99_ = clist; |
| 15716 | _tmp100_ = bala_expression_get_target_type ((BalaExpression*) list); |
| 15717 | _tmp101_ = _tmp100_; |
| 15718 | _tmp102_ = bala_data_type_get_type_symbol (_tmp101_); |
| 15719 | _tmp103_ = _tmp102_; |
| 15720 | _tmp104_ = bala_get_ccode_name ((BalaCodeNode*) _tmp103_); |
| 15721 | _tmp105_ = _tmp104_; |
| 15722 | _tmp106_ = bala_ccode_cast_expression_new ((BalaCCodeExpression*) _tmp99_, _tmp105_); |
| 15723 | _tmp107_ = _tmp106_; |
| 15724 | bala_set_cvalue ((BalaExpression*) list, (BalaCCodeExpression*) _tmp107_); |
| 15725 | _bala_ccode_node_unref0 (_tmp107_)((_tmp107_ == ((void*)0)) ? ((void*)0) : (_tmp107_ = (bala_ccode_node_unref (_tmp107_), ((void*)0)))); |
| 15726 | _g_free0 (_tmp105_)(_tmp105_ = (g_free (_tmp105_), ((void*)0))); |
| 15727 | } |
| 15728 | _bala_iterator_unref0 (field_it)((field_it == ((void*)0)) ? ((void*)0) : (field_it = (bala_iterator_unref (field_it), ((void*)0)))); |
| 15729 | _bala_ccode_node_unref0 (clist)((clist == ((void*)0)) ? ((void*)0) : (clist = (bala_ccode_node_unref (clist), ((void*)0)))); |
| 15730 | } else { |
| 15731 | BalaTargetValue* instance = NULL((void*)0); |
| 15732 | BalaDataType* _tmp108_; |
| 15733 | BalaDataType* _tmp109_; |
| 15734 | BalaTargetValue* _tmp110_; |
| 15735 | BalaIterator* field_it = NULL((void*)0); |
| 15736 | BalaStruct* _tmp111_; |
| 15737 | BalaList* _tmp112_; |
| 15738 | BalaIterator* _tmp113_; |
| 15739 | BalaTargetValue* _tmp138_; |
| 15740 | _tmp108_ = bala_expression_get_value_type ((BalaExpression*) list); |
| 15741 | _tmp109_ = _tmp108_; |
| 15742 | _tmp110_ = bala_ccode_base_module_create_temp_value (self, _tmp109_, TRUE(!(0)), (BalaCodeNode*) list, NULL((void*)0)); |
| 15743 | instance = _tmp110_; |
| 15744 | _tmp111_ = st; |
| 15745 | _tmp112_ = bala_struct_get_fields (_tmp111_); |
| 15746 | _tmp113_ = bala_iterable_iterator ((BalaIterable*) _tmp112_); |
| 15747 | field_it = _tmp113_; |
| 15748 | { |
| 15749 | BalaList* _expr_list = NULL((void*)0); |
| 15750 | BalaList* _tmp114_; |
| 15751 | BalaList* _tmp115_; |
| 15752 | gint _expr_size = 0; |
| 15753 | BalaList* _tmp116_; |
| 15754 | gint _tmp117_; |
| 15755 | gint _tmp118_; |
| 15756 | gint _expr_index = 0; |
| 15757 | _tmp114_ = bala_initializer_list_get_initializers (list); |
| 15758 | _tmp115_ = _bala_iterable_ref0 (_tmp114_); |
| 15759 | _expr_list = _tmp115_; |
| 15760 | _tmp116_ = _expr_list; |
| 15761 | _tmp117_ = bala_collection_get_size ((BalaCollection*) _tmp116_); |
| 15762 | _tmp118_ = _tmp117_; |
| 15763 | _expr_size = _tmp118_; |
| 15764 | _expr_index = -1; |
| 15765 | while (TRUE(!(0))) { |
| 15766 | gint _tmp119_; |
| 15767 | gint _tmp120_; |
| 15768 | BalaExpression* expr = NULL((void*)0); |
| 15769 | BalaList* _tmp121_; |
| 15770 | gpointer _tmp122_; |
| 15771 | BalaField* field = NULL((void*)0); |
| 15772 | BalaField* _tmp130_; |
| 15773 | BalaTargetValue* _tmp131_; |
| 15774 | BalaExpression* _tmp132_; |
| 15775 | BalaTargetValue* _tmp133_; |
| 15776 | BalaTargetValue* _tmp134_; |
| 15777 | BalaExpression* _tmp135_; |
| 15778 | BalaSourceReference* _tmp136_; |
| 15779 | BalaSourceReference* _tmp137_; |
| 15780 | _expr_index = _expr_index + 1; |
| 15781 | _tmp119_ = _expr_index; |
| 15782 | _tmp120_ = _expr_size; |
| 15783 | if (!(_tmp119_ < _tmp120_)) { |
| 15784 | break; |
| 15785 | } |
| 15786 | _tmp121_ = _expr_list; |
| 15787 | _tmp122_ = bala_list_get (_tmp121_, _expr_index); |
| 15788 | expr = (BalaExpression*) _tmp122_; |
| 15789 | field = NULL((void*)0); |
| 15790 | while (TRUE(!(0))) { |
| 15791 | BalaField* _tmp123_; |
| 15792 | BalaIterator* _tmp124_; |
| 15793 | BalaIterator* _tmp125_; |
| 15794 | gpointer _tmp126_; |
| 15795 | BalaField* _tmp127_; |
| 15796 | BalaMemberBinding _tmp128_; |
| 15797 | BalaMemberBinding _tmp129_; |
| 15798 | _tmp123_ = field; |
| 15799 | if (!(_tmp123_ == NULL((void*)0))) { |
| 15800 | break; |
| 15801 | } |
| 15802 | _tmp124_ = field_it; |
| 15803 | bala_iterator_next (_tmp124_); |
| 15804 | _tmp125_ = field_it; |
| 15805 | _tmp126_ = bala_iterator_get (_tmp125_); |
| 15806 | _bala_code_node_unref0 (field)((field == ((void*)0)) ? ((void*)0) : (field = (bala_code_node_unref (field), ((void*)0)))); |
| 15807 | field = (BalaField*) _tmp126_; |
| 15808 | _tmp127_ = field; |
| 15809 | _tmp128_ = bala_field_get_binding (_tmp127_); |
| 15810 | _tmp129_ = _tmp128_; |
| 15811 | if (_tmp129_ != BALA_MEMBER_BINDING_INSTANCE) { |
| 15812 | _bala_code_node_unref0 (field)((field == ((void*)0)) ? ((void*)0) : (field = (bala_code_node_unref (field), ((void*)0)))); |
| 15813 | field = NULL((void*)0); |
| 15814 | } |
| 15815 | } |
| 15816 | _tmp130_ = field; |
| 15817 | _tmp131_ = instance; |
| 15818 | _tmp132_ = expr; |
| 15819 | _tmp133_ = bala_expression_get_target_value (_tmp132_); |
| 15820 | _tmp134_ = _tmp133_; |
| 15821 | _tmp135_ = expr; |
| 15822 | _tmp136_ = bala_code_node_get_source_reference ((BalaCodeNode*) _tmp135_); |
| 15823 | _tmp137_ = _tmp136_; |
| 15824 | bala_code_generator_store_field ((BalaCodeGenerator*) self, _tmp130_, _tmp131_, _tmp134_, _tmp137_); |
| 15825 | _bala_code_node_unref0 (field)((field == ((void*)0)) ? ((void*)0) : (field = (bala_code_node_unref (field), ((void*)0)))); |
| 15826 | _bala_code_node_unref0 (expr)((expr == ((void*)0)) ? ((void*)0) : (expr = (bala_code_node_unref (expr), ((void*)0)))); |
| 15827 | } |
| 15828 | _bala_iterable_unref0 (_expr_list)((_expr_list == ((void*)0)) ? ((void*)0) : (_expr_list = (bala_iterable_unref (_expr_list), ((void*)0)))); |
| 15829 | } |
| 15830 | _tmp138_ = instance; |
| 15831 | bala_expression_set_target_value ((BalaExpression*) list, _tmp138_); |
| 15832 | _bala_iterator_unref0 (field_it)((field_it == ((void*)0)) ? ((void*)0) : (field_it = (bala_iterator_unref (field_it), ((void*)0)))); |
| 15833 | _bala_target_value_unref0 (instance)((instance == ((void*)0)) ? ((void*)0) : (instance = (bala_target_value_unref (instance), ((void*)0)))); |
| 15834 | } |
| 15835 | } else { |
| 15836 | BalaCCodeInitializerList* clist = NULL((void*)0); |
| 15837 | BalaCCodeInitializerList* _tmp139_; |
| 15838 | BalaCCodeInitializerList* _tmp152_; |
| 15839 | _tmp139_ = bala_ccode_initializer_list_new (); |
| 15840 | clist = _tmp139_; |
| 15841 | { |
| 15842 | BalaList* _expr_list = NULL((void*)0); |
| 15843 | BalaList* _tmp140_; |
| 15844 | BalaList* _tmp141_; |
| 15845 | gint _expr_size = 0; |
| 15846 | BalaList* _tmp142_; |
| 15847 | gint _tmp143_; |
| 15848 | gint _tmp144_; |
| 15849 | gint _expr_index = 0; |
| 15850 | _tmp140_ = bala_initializer_list_get_initializers (list); |
| 15851 | _tmp141_ = _bala_iterable_ref0 (_tmp140_); |
| 15852 | _expr_list = _tmp141_; |
| 15853 | _tmp142_ = _expr_list; |
| 15854 | _tmp143_ = bala_collection_get_size ((BalaCollection*) _tmp142_); |
| 15855 | _tmp144_ = _tmp143_; |
| 15856 | _expr_size = _tmp144_; |
| 15857 | _expr_index = -1; |
| 15858 | while (TRUE(!(0))) { |
| 15859 | gint _tmp145_; |
| 15860 | gint _tmp146_; |
| 15861 | BalaExpression* expr = NULL((void*)0); |
| 15862 | BalaList* _tmp147_; |
| 15863 | gpointer _tmp148_; |
| 15864 | BalaCCodeInitializerList* _tmp149_; |
| 15865 | BalaExpression* _tmp150_; |
| 15866 | BalaCCodeExpression* _tmp151_; |
| 15867 | _expr_index = _expr_index + 1; |
| 15868 | _tmp145_ = _expr_index; |
| 15869 | _tmp146_ = _expr_size; |
| 15870 | if (!(_tmp145_ < _tmp146_)) { |
| 15871 | break; |
| 15872 | } |
| 15873 | _tmp147_ = _expr_list; |
| 15874 | _tmp148_ = bala_list_get (_tmp147_, _expr_index); |
| 15875 | expr = (BalaExpression*) _tmp148_; |
| 15876 | _tmp149_ = clist; |
| 15877 | _tmp150_ = expr; |
| 15878 | _tmp151_ = bala_get_cvalue (_tmp150_); |
| 15879 | bala_ccode_initializer_list_append (_tmp149_, _tmp151_); |
| 15880 | _bala_code_node_unref0 (expr)((expr == ((void*)0)) ? ((void*)0) : (expr = (bala_code_node_unref (expr), ((void*)0)))); |
| 15881 | } |
| 15882 | _bala_iterable_unref0 (_expr_list)((_expr_list == ((void*)0)) ? ((void*)0) : (_expr_list = (bala_iterable_unref (_expr_list), ((void*)0)))); |
| 15883 | } |
| 15884 | _tmp152_ = clist; |
| 15885 | bala_set_cvalue ((BalaExpression*) list, (BalaCCodeExpression*) _tmp152_); |
| 15886 | _bala_ccode_node_unref0 (clist)((clist == ((void*)0)) ? ((void*)0) : (clist = (bala_ccode_node_unref (clist), ((void*)0)))); |
| 15887 | } |
| 15888 | } |
| 15889 | |
| 15890 | BalaLocalVariable* |
| 15891 | bala_ccode_base_module_get_temp_variable (BalaCCodeBaseModule* self, |
| 15892 | BalaDataType* type, |
| 15893 | gboolean value_owned, |
| 15894 | BalaCodeNode* node_reference, |
| 15895 | gboolean init) |
| 15896 | { |
| 15897 | BalaDataType* var_type = NULL((void*)0); |
| 15898 | BalaDataType* _tmp0_; |
| 15899 | BalaDataType* _tmp1_; |
| 15900 | BalaLocalVariable* local = NULL((void*)0); |
| 15901 | BalaDataType* _tmp2_; |
| 15902 | gint _tmp3_; |
| 15903 | gint _tmp4_; |
| 15904 | gchar* _tmp5_; |
| 15905 | gchar* _tmp6_; |
| 15906 | BalaLocalVariable* _tmp7_; |
| 15907 | BalaLocalVariable* _tmp8_; |
| 15908 | BalaLocalVariable* _tmp9_; |
| 15909 | gint _tmp13_; |
| 15910 | gint _tmp14_; |
| 15911 | BalaLocalVariable* result = NULL((void*)0); |
| 15912 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 15913 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 15914 | _tmp0_ = bala_data_type_copy (type); |
| 15915 | var_type = _tmp0_; |
| 15916 | _tmp1_ = var_type; |
| 15917 | bala_data_type_set_value_owned (_tmp1_, value_owned); |
| 15918 | _tmp2_ = var_type; |
| 15919 | _tmp3_ = bala_ccode_base_module_get_next_temp_var_id (self); |
| 15920 | _tmp4_ = _tmp3_; |
| 15921 | _tmp5_ = g_strdup_printf ("_tmp%d_", _tmp4_); |
| 15922 | _tmp6_ = _tmp5_; |
| 15923 | _tmp7_ = bala_local_variable_new (_tmp2_, _tmp6_, NULL((void*)0), NULL((void*)0)); |
| 15924 | _tmp8_ = _tmp7_; |
| 15925 | _g_free0 (_tmp6_)(_tmp6_ = (g_free (_tmp6_), ((void*)0))); |
| 15926 | local = _tmp8_; |
| 15927 | _tmp9_ = local; |
| 15928 | bala_local_variable_set_init (_tmp9_, init); |
| 15929 | if (node_reference != NULL((void*)0)) { |
| 15930 | BalaLocalVariable* _tmp10_; |
| 15931 | BalaSourceReference* _tmp11_; |
| 15932 | BalaSourceReference* _tmp12_; |
| 15933 | _tmp10_ = local; |
| 15934 | _tmp11_ = bala_code_node_get_source_reference (node_reference); |
| 15935 | _tmp12_ = _tmp11_; |
| 15936 | bala_code_node_set_source_reference ((BalaCodeNode*) _tmp10_, _tmp12_); |
| 15937 | } |
| 15938 | _tmp13_ = bala_ccode_base_module_get_next_temp_var_id (self); |
| 15939 | _tmp14_ = _tmp13_; |
| 15940 | bala_ccode_base_module_set_next_temp_var_id (self, _tmp14_ + 1); |
| 15941 | result = local; |
| 15942 | _bala_code_node_unref0 (var_type)((var_type == ((void*)0)) ? ((void*)0) : (var_type = (bala_code_node_unref (var_type), ((void*)0)))); |
| 15943 | return result; |
| 15944 | } |
| 15945 | |
| 15946 | static gboolean |
| 15947 | bala_ccode_base_module_is_in_generic_type (BalaCCodeBaseModule* self, |
| 15948 | BalaGenericType* type) |
| 15949 | { |
| 15950 | gboolean _tmp0_ = FALSE(0); |
| 15951 | gboolean _tmp1_ = FALSE(0); |
| 15952 | BalaSymbol* _tmp2_; |
| 15953 | BalaSymbol* _tmp3_; |
| 15954 | gboolean result = FALSE(0); |
| 15955 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 15956 | g_return_val_if_fail (type != NULL, FALSE)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return ((0)); } } while (0); |
| 15957 | _tmp2_ = bala_ccode_base_module_get_current_symbol (self); |
| 15958 | _tmp3_ = _tmp2_; |
| 15959 | if (_tmp3_ != NULL((void*)0)) { |
| 15960 | BalaTypeParameter* _tmp4_; |
| 15961 | BalaTypeParameter* _tmp5_; |
| 15962 | BalaSymbol* _tmp6_; |
| 15963 | BalaSymbol* _tmp7_; |
| 15964 | _tmp4_ = bala_generic_type_get_type_parameter (type); |
| 15965 | _tmp5_ = _tmp4_; |
| 15966 | _tmp6_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp5_); |
| 15967 | _tmp7_ = _tmp6_; |
| 15968 | _tmp1_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, BALA_TYPE_TYPESYMBOL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp7_); GType __t = ((bala_typesymbol_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 15969 | } else { |
| 15970 | _tmp1_ = FALSE(0); |
| 15971 | } |
| 15972 | if (_tmp1_) { |
| 15973 | gboolean _tmp8_ = FALSE(0); |
| 15974 | BalaMethod* _tmp9_; |
| 15975 | BalaMethod* _tmp10_; |
| 15976 | _tmp9_ = bala_ccode_base_module_get_current_method (self); |
| 15977 | _tmp10_ = _tmp9_; |
| 15978 | if (_tmp10_ == NULL((void*)0)) { |
| 15979 | _tmp8_ = TRUE(!(0)); |
| 15980 | } else { |
| 15981 | BalaMethod* _tmp11_; |
| 15982 | BalaMethod* _tmp12_; |
| 15983 | BalaMemberBinding _tmp13_; |
| 15984 | BalaMemberBinding _tmp14_; |
| 15985 | _tmp11_ = bala_ccode_base_module_get_current_method (self); |
| 15986 | _tmp12_ = _tmp11_; |
| 15987 | _tmp13_ = bala_method_get_binding (_tmp12_); |
| 15988 | _tmp14_ = _tmp13_; |
| 15989 | _tmp8_ = _tmp14_ == BALA_MEMBER_BINDING_INSTANCE; |
| 15990 | } |
| 15991 | _tmp0_ = _tmp8_; |
| 15992 | } else { |
| 15993 | _tmp0_ = FALSE(0); |
| 15994 | } |
| 15995 | if (_tmp0_) { |
| 15996 | result = TRUE(!(0)); |
| 15997 | return result; |
| 15998 | } else { |
| 15999 | result = FALSE(0); |
| 16000 | return result; |
| 16001 | } |
| 16002 | } |
| 16003 | |
| 16004 | static void |
| 16005 | bala_ccode_base_module_require_generic_accessors (BalaCCodeBaseModule* self, |
| 16006 | BalaInterface* iface) |
| 16007 | { |
| 16008 | BalaAttribute* _tmp0_; |
| 16009 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 16010 | g_return_if_fail (iface != NULL)do { if ((iface != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "iface != NULL" ); return; } } while (0); |
| 16011 | _tmp0_ = bala_code_node_get_attribute ((BalaCodeNode*) iface, "GenericAccessors"); |
| 16012 | if (_tmp0_ == NULL((void*)0)) { |
| 16013 | BalaSourceReference* _tmp1_; |
| 16014 | BalaSourceReference* _tmp2_; |
| 16015 | gchar* _tmp3_; |
| 16016 | gchar* _tmp4_; |
| 16017 | gchar* _tmp5_; |
| 16018 | gchar* _tmp6_; |
| 16019 | _tmp1_ = bala_code_node_get_source_reference ((BalaCodeNode*) iface); |
| 16020 | _tmp2_ = _tmp1_; |
| 16021 | _tmp3_ = bala_symbol_get_full_name ((BalaSymbol*) iface); |
| 16022 | _tmp4_ = _tmp3_; |
| 16023 | _tmp5_ = g_strdup_printf ("missing generic type for interface `%s', add GenericAccessors attribut" \ |
| 16024 | "e to interface declaration", _tmp4_); |
| 16025 | _tmp6_ = _tmp5_; |
| 16026 | bala_report_error (_tmp2_, _tmp6_); |
| 16027 | _g_free0 (_tmp6_)(_tmp6_ = (g_free (_tmp6_), ((void*)0))); |
| 16028 | _g_free0 (_tmp4_)(_tmp4_ = (g_free (_tmp4_), ((void*)0))); |
| 16029 | } |
| 16030 | } |
| 16031 | |
| 16032 | BalaCCodeExpression* |
| 16033 | bala_ccode_base_module_get_type_id_expression (BalaCCodeBaseModule* self, |
| 16034 | BalaDataType* type, |
| 16035 | gboolean is_chainup) |
| 16036 | { |
| 16037 | BalaCCodeExpression* result = NULL((void*)0); |
| 16038 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 16039 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 16040 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 16041 | BalaTypeParameter* type_parameter = NULL((void*)0); |
| 16042 | BalaTypeParameter* _tmp0_; |
| 16043 | BalaTypeParameter* _tmp1_; |
| 16044 | BalaTypeParameter* _tmp2_; |
| 16045 | gchar* var_name = NULL((void*)0); |
| 16046 | BalaTypeParameter* _tmp3_; |
| 16047 | const gchar* _tmp4_; |
| 16048 | const gchar* _tmp5_; |
| 16049 | gchar* _tmp6_; |
| 16050 | gchar* _tmp7_; |
| 16051 | gchar* _tmp8_; |
| 16052 | gchar* _tmp9_; |
| 16053 | BalaTypeParameter* _tmp10_; |
| 16054 | BalaSymbol* _tmp11_; |
| 16055 | BalaSymbol* _tmp12_; |
| 16056 | gboolean _tmp44_ = FALSE(0); |
| 16057 | gboolean _tmp45_ = FALSE(0); |
| 16058 | _tmp0_ = bala_generic_type_get_type_parameter (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_GENERIC_TYPE, BalaGenericType)(((BalaGenericType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_generic_type_get_type ())))))); |
| 16059 | _tmp1_ = _tmp0_; |
| 16060 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 16061 | type_parameter = _tmp2_; |
| 16062 | _tmp3_ = type_parameter; |
| 16063 | _tmp4_ = bala_symbol_get_name ((BalaSymbol*) _tmp3_); |
| 16064 | _tmp5_ = _tmp4_; |
| 16065 | _tmp6_ = g_ascii_strdown (_tmp5_, (gssize) -1); |
| 16066 | _tmp7_ = _tmp6_; |
| 16067 | _tmp8_ = g_strdup_printf ("%s_type", _tmp7_); |
| 16068 | _tmp9_ = _tmp8_; |
| 16069 | _g_free0 (_tmp7_)(_tmp7_ = (g_free (_tmp7_), ((void*)0))); |
| 16070 | var_name = _tmp9_; |
| 16071 | _tmp10_ = type_parameter; |
| 16072 | _tmp11_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp10_); |
| 16073 | _tmp12_ = _tmp11_; |
| 16074 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, BALA_TYPE_INTERFACE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp12_); GType __t = ((bala_interface_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 16075 | BalaInterface* iface = NULL((void*)0); |
| 16076 | BalaTypeParameter* _tmp13_; |
| 16077 | BalaSymbol* _tmp14_; |
| 16078 | BalaSymbol* _tmp15_; |
| 16079 | BalaInterface* _tmp16_; |
| 16080 | BalaInterface* _tmp17_; |
| 16081 | gchar* method_name = NULL((void*)0); |
| 16082 | BalaTypeParameter* _tmp18_; |
| 16083 | const gchar* _tmp19_; |
| 16084 | const gchar* _tmp20_; |
| 16085 | gchar* _tmp21_; |
| 16086 | gchar* _tmp22_; |
| 16087 | gchar* _tmp23_; |
| 16088 | gchar* _tmp24_; |
| 16089 | BalaCCodeFunctionCall* cast_self = NULL((void*)0); |
| 16090 | BalaInterface* _tmp25_; |
| 16091 | gchar* _tmp26_; |
| 16092 | gchar* _tmp27_; |
| 16093 | BalaCCodeIdentifier* _tmp28_; |
| 16094 | BalaCCodeIdentifier* _tmp29_; |
| 16095 | BalaCCodeFunctionCall* _tmp30_; |
| 16096 | BalaCCodeFunctionCall* _tmp31_; |
| 16097 | BalaCCodeFunctionCall* _tmp32_; |
| 16098 | BalaCCodeExpression* _tmp33_; |
| 16099 | BalaCCodeExpression* _tmp34_; |
| 16100 | BalaCCodeFunctionCall* function_call = NULL((void*)0); |
| 16101 | BalaCCodeFunctionCall* _tmp35_; |
| 16102 | const gchar* _tmp36_; |
| 16103 | BalaCCodeMemberAccess* _tmp37_; |
| 16104 | BalaCCodeMemberAccess* _tmp38_; |
| 16105 | BalaCCodeFunctionCall* _tmp39_; |
| 16106 | BalaCCodeFunctionCall* _tmp40_; |
| 16107 | BalaCCodeFunctionCall* _tmp41_; |
| 16108 | BalaCCodeExpression* _tmp42_; |
| 16109 | BalaCCodeExpression* _tmp43_; |
| 16110 | _tmp13_ = type_parameter; |
| 16111 | _tmp14_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp13_); |
| 16112 | _tmp15_ = _tmp14_; |
| 16113 | _tmp16_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, BALA_TYPE_INTERFACE, BalaInterface)(((BalaInterface*) g_type_check_instance_cast ((GTypeInstance *) (_tmp15_), ((bala_interface_get_type ())))))); |
| 16114 | iface = _tmp16_; |
| 16115 | _tmp17_ = iface; |
| 16116 | bala_ccode_base_module_require_generic_accessors (self, _tmp17_); |
| 16117 | _tmp18_ = type_parameter; |
| 16118 | _tmp19_ = bala_symbol_get_name ((BalaSymbol*) _tmp18_); |
| 16119 | _tmp20_ = _tmp19_; |
| 16120 | _tmp21_ = g_ascii_strdown (_tmp20_, (gssize) -1); |
| 16121 | _tmp22_ = _tmp21_; |
| 16122 | _tmp23_ = g_strdup_printf ("get_%s_type", _tmp22_); |
| 16123 | _tmp24_ = _tmp23_; |
| 16124 | _g_free0 (_tmp22_)(_tmp22_ = (g_free (_tmp22_), ((void*)0))); |
| 16125 | method_name = _tmp24_; |
| 16126 | _tmp25_ = iface; |
| 16127 | _tmp26_ = bala_get_ccode_type_get_function ((BalaObjectTypeSymbol*) _tmp25_); |
| 16128 | _tmp27_ = _tmp26_; |
| 16129 | _tmp28_ = bala_ccode_identifier_new (_tmp27_); |
| 16130 | _tmp29_ = _tmp28_; |
| 16131 | _tmp30_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp29_); |
| 16132 | _tmp31_ = _tmp30_; |
| 16133 | _bala_ccode_node_unref0 (_tmp29_)((_tmp29_ == ((void*)0)) ? ((void*)0) : (_tmp29_ = (bala_ccode_node_unref (_tmp29_), ((void*)0)))); |
| 16134 | _g_free0 (_tmp27_)(_tmp27_ = (g_free (_tmp27_), ((void*)0))); |
| 16135 | cast_self = _tmp31_; |
| 16136 | _tmp32_ = cast_self; |
| 16137 | _tmp33_ = bala_ccode_base_module_get_this_cexpression (self); |
| 16138 | _tmp34_ = _tmp33_; |
| 16139 | bala_ccode_function_call_add_argument (_tmp32_, _tmp34_); |
| 16140 | _bala_ccode_node_unref0 (_tmp34_)((_tmp34_ == ((void*)0)) ? ((void*)0) : (_tmp34_ = (bala_ccode_node_unref (_tmp34_), ((void*)0)))); |
| 16141 | _tmp35_ = cast_self; |
| 16142 | _tmp36_ = method_name; |
| 16143 | _tmp37_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp35_, _tmp36_); |
| 16144 | _tmp38_ = _tmp37_; |
| 16145 | _tmp39_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp38_); |
| 16146 | _tmp40_ = _tmp39_; |
| 16147 | _bala_ccode_node_unref0 (_tmp38_)((_tmp38_ == ((void*)0)) ? ((void*)0) : (_tmp38_ = (bala_ccode_node_unref (_tmp38_), ((void*)0)))); |
| 16148 | function_call = _tmp40_; |
| 16149 | _tmp41_ = function_call; |
| 16150 | _tmp42_ = bala_ccode_base_module_get_this_cexpression (self); |
| 16151 | _tmp43_ = _tmp42_; |
| 16152 | bala_ccode_function_call_add_argument (_tmp41_, _tmp43_); |
| 16153 | _bala_ccode_node_unref0 (_tmp43_)((_tmp43_ == ((void*)0)) ? ((void*)0) : (_tmp43_ = (bala_ccode_node_unref (_tmp43_), ((void*)0)))); |
| 16154 | result = (BalaCCodeExpression*) function_call; |
| 16155 | _bala_ccode_node_unref0 (cast_self)((cast_self == ((void*)0)) ? ((void*)0) : (cast_self = (bala_ccode_node_unref (cast_self), ((void*)0)))); |
| 16156 | _g_free0 (method_name)(method_name = (g_free (method_name), ((void*)0))); |
| 16157 | _bala_code_node_unref0 (iface)((iface == ((void*)0)) ? ((void*)0) : (iface = (bala_code_node_unref (iface), ((void*)0)))); |
| 16158 | _g_free0 (var_name)(var_name = (g_free (var_name), ((void*)0))); |
| 16159 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 16160 | return result; |
| 16161 | } |
| 16162 | if (bala_ccode_base_module_is_in_generic_type (self, G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_GENERIC_TYPE, BalaGenericType)(((BalaGenericType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_generic_type_get_type ()))))))) { |
| 16163 | _tmp45_ = !is_chainup; |
| 16164 | } else { |
| 16165 | _tmp45_ = FALSE(0); |
| 16166 | } |
| 16167 | if (_tmp45_) { |
| 16168 | gboolean _tmp46_; |
| 16169 | gboolean _tmp47_; |
| 16170 | _tmp46_ = bala_ccode_base_module_get_in_creation_method (self); |
| 16171 | _tmp47_ = _tmp46_; |
| 16172 | _tmp44_ = !_tmp47_; |
| 16173 | } else { |
| 16174 | _tmp44_ = FALSE(0); |
| 16175 | } |
| 16176 | if (_tmp44_) { |
| 16177 | BalaCCodeExpression* _tmp48_; |
| 16178 | BalaCCodeExpression* _tmp49_; |
| 16179 | BalaCCodeMemberAccess* _tmp50_; |
| 16180 | BalaCCodeMemberAccess* _tmp51_; |
| 16181 | const gchar* _tmp52_; |
| 16182 | BalaCCodeMemberAccess* _tmp53_; |
| 16183 | BalaCCodeExpression* _tmp54_; |
| 16184 | _tmp48_ = bala_ccode_base_module_get_this_cexpression (self); |
| 16185 | _tmp49_ = _tmp48_; |
| 16186 | _tmp50_ = bala_ccode_member_access_new_pointer (_tmp49_, "priv"); |
| 16187 | _tmp51_ = _tmp50_; |
| 16188 | _tmp52_ = var_name; |
| 16189 | _tmp53_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp51_, _tmp52_); |
| 16190 | _tmp54_ = (BalaCCodeExpression*) _tmp53_; |
| 16191 | _bala_ccode_node_unref0 (_tmp51_)((_tmp51_ == ((void*)0)) ? ((void*)0) : (_tmp51_ = (bala_ccode_node_unref (_tmp51_), ((void*)0)))); |
| 16192 | _bala_ccode_node_unref0 (_tmp49_)((_tmp49_ == ((void*)0)) ? ((void*)0) : (_tmp49_ = (bala_ccode_node_unref (_tmp49_), ((void*)0)))); |
| 16193 | result = _tmp54_; |
| 16194 | _g_free0 (var_name)(var_name = (g_free (var_name), ((void*)0))); |
| 16195 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 16196 | return result; |
| 16197 | } else { |
| 16198 | const gchar* _tmp55_; |
| 16199 | BalaCCodeExpression* _tmp56_; |
| 16200 | _tmp55_ = var_name; |
| 16201 | _tmp56_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp55_); |
| 16202 | result = _tmp56_; |
| 16203 | _g_free0 (var_name)(var_name = (g_free (var_name), ((void*)0))); |
| 16204 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 16205 | return result; |
| 16206 | } |
| 16207 | _g_free0 (var_name)(var_name = (g_free (var_name), ((void*)0))); |
| 16208 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 16209 | } else { |
| 16210 | gchar* type_id = NULL((void*)0); |
| 16211 | gchar* _tmp57_; |
| 16212 | const gchar* _tmp58_; |
| 16213 | const gchar* _tmp61_; |
| 16214 | BalaCCodeIdentifier* _tmp62_; |
| 16215 | _tmp57_ = bala_get_ccode_type_id ((BalaCodeNode*) type); |
| 16216 | type_id = _tmp57_; |
| 16217 | _tmp58_ = type_id; |
| 16218 | if (g_strcmp0 (_tmp58_, "") == 0) { |
| 16219 | gchar* _tmp59_; |
| 16220 | _tmp59_ = g_strdup ("G_TYPE_INVALID"); |
| 16221 | _g_free0 (type_id)(type_id = (g_free (type_id), ((void*)0))); |
| 16222 | type_id = _tmp59_; |
| 16223 | } else { |
| 16224 | BalaCCodeFile* _tmp60_; |
| 16225 | _tmp60_ = self->cfile; |
| 16226 | bala_ccode_base_module_generate_type_declaration (self, type, _tmp60_); |
| 16227 | } |
| 16228 | _tmp61_ = type_id; |
| 16229 | _tmp62_ = bala_ccode_identifier_new (_tmp61_); |
| 16230 | result = (BalaCCodeExpression*) _tmp62_; |
| 16231 | _g_free0 (type_id)(type_id = (g_free (type_id), ((void*)0))); |
| 16232 | return result; |
| 16233 | } |
| 16234 | } |
| 16235 | |
| 16236 | static BalaCCodeExpression* |
| 16237 | bala_ccode_base_module_real_get_dup_func_expression (BalaCCodeBaseModule* self, |
| 16238 | BalaDataType* type, |
| 16239 | BalaSourceReference* source_reference, |
| 16240 | gboolean is_chainup) |
| 16241 | { |
| 16242 | BalaCCodeExpression* result = NULL((void*)0); |
| 16243 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 16244 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ERROR_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_error_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 16245 | BalaCCodeIdentifier* _tmp0_; |
| 16246 | _tmp0_ = bala_ccode_identifier_new ("g_error_copy"); |
| 16247 | result = (BalaCCodeExpression*) _tmp0_; |
| 16248 | return result; |
| 16249 | } else { |
| 16250 | BalaTypeSymbol* _tmp1_; |
| 16251 | BalaTypeSymbol* _tmp2_; |
| 16252 | _tmp1_ = bala_data_type_get_type_symbol (type); |
| 16253 | _tmp2_ = _tmp1_; |
| 16254 | if (_tmp2_ != NULL((void*)0)) { |
| 16255 | gchar* dup_function = NULL((void*)0); |
| 16256 | BalaClass* cl = NULL((void*)0); |
| 16257 | BalaTypeSymbol* _tmp3_; |
| 16258 | BalaTypeSymbol* _tmp4_; |
| 16259 | BalaTypeSymbol* _tmp5_; |
| 16260 | BalaTypeSymbol* _tmp6_; |
| 16261 | const gchar* _tmp53_; |
| 16262 | BalaCCodeIdentifier* _tmp54_; |
| 16263 | _tmp3_ = bala_data_type_get_type_symbol (type); |
| 16264 | _tmp4_ = _tmp3_; |
| 16265 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp4_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp4_) : NULL((void*)0); |
| 16266 | _tmp5_ = bala_data_type_get_type_symbol (type); |
| 16267 | _tmp6_ = _tmp5_; |
| 16268 | if (bala_is_reference_counting (_tmp6_)) { |
| 16269 | BalaTypeSymbol* _tmp7_; |
| 16270 | BalaTypeSymbol* _tmp8_; |
| 16271 | gchar* _tmp9_; |
| 16272 | gboolean _tmp10_ = FALSE(0); |
| 16273 | BalaTypeSymbol* _tmp11_; |
| 16274 | BalaTypeSymbol* _tmp12_; |
| 16275 | _tmp7_ = bala_data_type_get_type_symbol (type); |
| 16276 | _tmp8_ = _tmp7_; |
| 16277 | _tmp9_ = bala_get_ccode_ref_function ((BalaTypeSymbol*) G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, BALA_TYPE_OBJECT_TYPE_SYMBOL, BalaObjectTypeSymbol)(((BalaObjectTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp8_), ((bala_object_type_symbol_get_type ())))))); |
| 16278 | _g_free0 (dup_function)(dup_function = (g_free (dup_function), ((void*)0))); |
| 16279 | dup_function = _tmp9_; |
| 16280 | _tmp11_ = bala_data_type_get_type_symbol (type); |
| 16281 | _tmp12_ = _tmp11_; |
| 16282 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, BALA_TYPE_INTERFACE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp12_); GType __t = ((bala_interface_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 16283 | const gchar* _tmp13_; |
| 16284 | _tmp13_ = dup_function; |
| 16285 | _tmp10_ = _tmp13_ == NULL((void*)0); |
| 16286 | } else { |
| 16287 | _tmp10_ = FALSE(0); |
| 16288 | } |
| 16289 | if (_tmp10_) { |
| 16290 | BalaTypeSymbol* _tmp14_; |
| 16291 | BalaTypeSymbol* _tmp15_; |
| 16292 | gchar* _tmp16_; |
| 16293 | gchar* _tmp17_; |
| 16294 | gchar* _tmp18_; |
| 16295 | gchar* _tmp19_; |
| 16296 | BalaCCodeInvalidExpression* _tmp20_; |
| 16297 | _tmp14_ = bala_data_type_get_type_symbol (type); |
| 16298 | _tmp15_ = _tmp14_; |
| 16299 | _tmp16_ = bala_symbol_get_full_name ((BalaSymbol*) _tmp15_); |
| 16300 | _tmp17_ = _tmp16_; |
| 16301 | _tmp18_ = g_strdup_printf ("missing class prerequisite for interface `%s', add GLib.Object to inte" \ |
| 16302 | "rface declaration if unsure", _tmp17_); |
| 16303 | _tmp19_ = _tmp18_; |
| 16304 | bala_report_error (source_reference, _tmp19_); |
| 16305 | _g_free0 (_tmp19_)(_tmp19_ = (g_free (_tmp19_), ((void*)0))); |
| 16306 | _g_free0 (_tmp17_)(_tmp17_ = (g_free (_tmp17_), ((void*)0))); |
| 16307 | _tmp20_ = bala_ccode_invalid_expression_new (); |
| 16308 | result = (BalaCCodeExpression*) _tmp20_; |
| 16309 | _g_free0 (dup_function)(dup_function = (g_free (dup_function), ((void*)0))); |
| 16310 | return result; |
| 16311 | } |
| 16312 | } else { |
| 16313 | gboolean _tmp21_ = FALSE(0); |
| 16314 | BalaClass* _tmp22_; |
| 16315 | _tmp22_ = cl; |
| 16316 | if (_tmp22_ != NULL((void*)0)) { |
| 16317 | BalaClass* _tmp23_; |
| 16318 | gboolean _tmp24_; |
| 16319 | gboolean _tmp25_; |
| 16320 | _tmp23_ = cl; |
| 16321 | _tmp24_ = bala_class_get_is_immutable (_tmp23_); |
| 16322 | _tmp25_ = _tmp24_; |
| 16323 | _tmp21_ = _tmp25_; |
| 16324 | } else { |
| 16325 | _tmp21_ = FALSE(0); |
| 16326 | } |
| 16327 | if (_tmp21_) { |
| 16328 | BalaTypeSymbol* _tmp26_; |
| 16329 | BalaTypeSymbol* _tmp27_; |
| 16330 | gchar* _tmp28_; |
| 16331 | const gchar* _tmp29_; |
| 16332 | _tmp26_ = bala_data_type_get_type_symbol (type); |
| 16333 | _tmp27_ = _tmp26_; |
| 16334 | _tmp28_ = bala_get_ccode_dup_function (_tmp27_); |
| 16335 | _g_free0 (dup_function)(dup_function = (g_free (dup_function), ((void*)0))); |
| 16336 | dup_function = _tmp28_; |
| 16337 | _tmp29_ = dup_function; |
| 16338 | if (_tmp29_ == NULL((void*)0)) { |
| 16339 | gchar* _tmp30_; |
| 16340 | _tmp30_ = g_strdup (""); |
| 16341 | _g_free0 (dup_function)(dup_function = (g_free (dup_function), ((void*)0))); |
| 16342 | dup_function = _tmp30_; |
| 16343 | } |
| 16344 | } else { |
| 16345 | BalaTypeSymbol* _tmp31_; |
| 16346 | BalaTypeSymbol* _tmp32_; |
| 16347 | _tmp31_ = bala_data_type_get_type_symbol (type); |
| 16348 | _tmp32_ = _tmp31_; |
| 16349 | if (bala_get_ccode_is_gboxed (_tmp32_)) { |
| 16350 | gchar* _tmp33_; |
| 16351 | const gchar* _tmp34_; |
| 16352 | _tmp33_ = bala_ccode_base_module_generate_dup_func_wrapper (self, type); |
| 16353 | _g_free0 (dup_function)(dup_function = (g_free (dup_function), ((void*)0))); |
| 16354 | dup_function = _tmp33_; |
| 16355 | _tmp34_ = dup_function; |
| 16356 | if (_tmp34_ == NULL((void*)0)) { |
| 16357 | gchar* _tmp35_; |
| 16358 | _tmp35_ = g_strdup (""); |
| 16359 | _g_free0 (dup_function)(dup_function = (g_free (dup_function), ((void*)0))); |
| 16360 | dup_function = _tmp35_; |
| 16361 | } |
| 16362 | } else { |
| 16363 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_value_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 16364 | BalaTypeSymbol* _tmp36_; |
| 16365 | BalaTypeSymbol* _tmp37_; |
| 16366 | gchar* _tmp38_; |
| 16367 | gboolean _tmp39_ = FALSE(0); |
| 16368 | const gchar* _tmp40_; |
| 16369 | _tmp36_ = bala_data_type_get_type_symbol (type); |
| 16370 | _tmp37_ = _tmp36_; |
| 16371 | _tmp38_ = bala_get_ccode_dup_function (_tmp37_); |
| 16372 | _g_free0 (dup_function)(dup_function = (g_free (dup_function), ((void*)0))); |
| 16373 | dup_function = _tmp38_; |
| 16374 | _tmp40_ = dup_function; |
| 16375 | if (_tmp40_ == NULL((void*)0)) { |
| 16376 | gboolean _tmp41_; |
| 16377 | gboolean _tmp42_; |
| 16378 | _tmp41_ = bala_data_type_get_nullable (type); |
| 16379 | _tmp42_ = _tmp41_; |
| 16380 | _tmp39_ = _tmp42_; |
| 16381 | } else { |
| 16382 | _tmp39_ = FALSE(0); |
| 16383 | } |
| 16384 | if (_tmp39_) { |
| 16385 | gchar* _tmp43_; |
| 16386 | _tmp43_ = bala_ccode_base_module_generate_struct_dup_wrapper (self, G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_VALUE_TYPE, BalaValueType)(((BalaValueType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_value_type_get_type ())))))); |
| 16387 | _g_free0 (dup_function)(dup_function = (g_free (dup_function), ((void*)0))); |
| 16388 | dup_function = _tmp43_; |
| 16389 | } else { |
| 16390 | const gchar* _tmp44_; |
| 16391 | _tmp44_ = dup_function; |
| 16392 | if (_tmp44_ == NULL((void*)0)) { |
| 16393 | gchar* _tmp45_; |
| 16394 | _tmp45_ = g_strdup (""); |
| 16395 | _g_free0 (dup_function)(dup_function = (g_free (dup_function), ((void*)0))); |
| 16396 | dup_function = _tmp45_; |
| 16397 | } |
| 16398 | } |
| 16399 | } else { |
| 16400 | BalaTypeSymbol* _tmp46_; |
| 16401 | BalaTypeSymbol* _tmp47_; |
| 16402 | const gchar* _tmp48_; |
| 16403 | const gchar* _tmp49_; |
| 16404 | gchar* _tmp50_; |
| 16405 | gchar* _tmp51_; |
| 16406 | BalaCCodeInvalidExpression* _tmp52_; |
| 16407 | _tmp46_ = bala_data_type_get_type_symbol (type); |
| 16408 | _tmp47_ = _tmp46_; |
| 16409 | _tmp48_ = bala_symbol_get_name ((BalaSymbol*) _tmp47_); |
| 16410 | _tmp49_ = _tmp48_; |
| 16411 | _tmp50_ = g_strdup_printf ("duplicating %s instance, use unowned variable or explicitly invoke cop" \ |
| 16412 | "y method", _tmp49_); |
| 16413 | _tmp51_ = _tmp50_; |
| 16414 | bala_report_error (source_reference, _tmp51_); |
| 16415 | _g_free0 (_tmp51_)(_tmp51_ = (g_free (_tmp51_), ((void*)0))); |
| 16416 | _tmp52_ = bala_ccode_invalid_expression_new (); |
| 16417 | result = (BalaCCodeExpression*) _tmp52_; |
| 16418 | _g_free0 (dup_function)(dup_function = (g_free (dup_function), ((void*)0))); |
| 16419 | return result; |
| 16420 | } |
| 16421 | } |
| 16422 | } |
| 16423 | } |
| 16424 | _tmp53_ = dup_function; |
| 16425 | _tmp54_ = bala_ccode_identifier_new (_tmp53_); |
| 16426 | result = (BalaCCodeExpression*) _tmp54_; |
| 16427 | _g_free0 (dup_function)(dup_function = (g_free (dup_function), ((void*)0))); |
| 16428 | return result; |
| 16429 | } else { |
| 16430 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 16431 | BalaTypeParameter* type_parameter = NULL((void*)0); |
| 16432 | BalaTypeParameter* _tmp55_; |
| 16433 | BalaTypeParameter* _tmp56_; |
| 16434 | BalaTypeParameter* _tmp57_; |
| 16435 | gchar* func_name = NULL((void*)0); |
| 16436 | BalaTypeParameter* _tmp58_; |
| 16437 | const gchar* _tmp59_; |
| 16438 | const gchar* _tmp60_; |
| 16439 | gchar* _tmp61_; |
| 16440 | gchar* _tmp62_; |
| 16441 | gchar* _tmp63_; |
| 16442 | gchar* _tmp64_; |
| 16443 | BalaTypeParameter* _tmp65_; |
| 16444 | BalaSymbol* _tmp66_; |
| 16445 | BalaSymbol* _tmp67_; |
| 16446 | gboolean _tmp99_ = FALSE(0); |
| 16447 | gboolean _tmp100_ = FALSE(0); |
| 16448 | _tmp55_ = bala_generic_type_get_type_parameter (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_GENERIC_TYPE, BalaGenericType)(((BalaGenericType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_generic_type_get_type ())))))); |
| 16449 | _tmp56_ = _tmp55_; |
| 16450 | _tmp57_ = _bala_code_node_ref0 (_tmp56_); |
| 16451 | type_parameter = _tmp57_; |
| 16452 | _tmp58_ = type_parameter; |
| 16453 | _tmp59_ = bala_symbol_get_name ((BalaSymbol*) _tmp58_); |
| 16454 | _tmp60_ = _tmp59_; |
| 16455 | _tmp61_ = g_ascii_strdown (_tmp60_, (gssize) -1); |
| 16456 | _tmp62_ = _tmp61_; |
| 16457 | _tmp63_ = g_strdup_printf ("%s_dup_func", _tmp62_); |
| 16458 | _tmp64_ = _tmp63_; |
| 16459 | _g_free0 (_tmp62_)(_tmp62_ = (g_free (_tmp62_), ((void*)0))); |
| 16460 | func_name = _tmp64_; |
| 16461 | _tmp65_ = type_parameter; |
| 16462 | _tmp66_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp65_); |
| 16463 | _tmp67_ = _tmp66_; |
| 16464 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp67_, BALA_TYPE_INTERFACE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp67_); GType __t = ((bala_interface_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 16465 | BalaInterface* iface = NULL((void*)0); |
| 16466 | BalaTypeParameter* _tmp68_; |
| 16467 | BalaSymbol* _tmp69_; |
| 16468 | BalaSymbol* _tmp70_; |
| 16469 | BalaInterface* _tmp71_; |
| 16470 | BalaInterface* _tmp72_; |
| 16471 | gchar* method_name = NULL((void*)0); |
| 16472 | BalaTypeParameter* _tmp73_; |
| 16473 | const gchar* _tmp74_; |
| 16474 | const gchar* _tmp75_; |
| 16475 | gchar* _tmp76_; |
| 16476 | gchar* _tmp77_; |
| 16477 | gchar* _tmp78_; |
| 16478 | gchar* _tmp79_; |
| 16479 | BalaCCodeFunctionCall* cast_self = NULL((void*)0); |
| 16480 | BalaInterface* _tmp80_; |
| 16481 | gchar* _tmp81_; |
| 16482 | gchar* _tmp82_; |
| 16483 | BalaCCodeIdentifier* _tmp83_; |
| 16484 | BalaCCodeIdentifier* _tmp84_; |
| 16485 | BalaCCodeFunctionCall* _tmp85_; |
| 16486 | BalaCCodeFunctionCall* _tmp86_; |
| 16487 | BalaCCodeFunctionCall* _tmp87_; |
| 16488 | BalaCCodeIdentifier* _tmp88_; |
| 16489 | BalaCCodeIdentifier* _tmp89_; |
| 16490 | BalaCCodeFunctionCall* function_call = NULL((void*)0); |
| 16491 | BalaCCodeFunctionCall* _tmp90_; |
| 16492 | const gchar* _tmp91_; |
| 16493 | BalaCCodeMemberAccess* _tmp92_; |
| 16494 | BalaCCodeMemberAccess* _tmp93_; |
| 16495 | BalaCCodeFunctionCall* _tmp94_; |
| 16496 | BalaCCodeFunctionCall* _tmp95_; |
| 16497 | BalaCCodeFunctionCall* _tmp96_; |
| 16498 | BalaCCodeIdentifier* _tmp97_; |
| 16499 | BalaCCodeIdentifier* _tmp98_; |
| 16500 | _tmp68_ = type_parameter; |
| 16501 | _tmp69_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp68_); |
| 16502 | _tmp70_ = _tmp69_; |
| 16503 | _tmp71_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp70_, BALA_TYPE_INTERFACE, BalaInterface)(((BalaInterface*) g_type_check_instance_cast ((GTypeInstance *) (_tmp70_), ((bala_interface_get_type ())))))); |
| 16504 | iface = _tmp71_; |
| 16505 | _tmp72_ = iface; |
| 16506 | bala_ccode_base_module_require_generic_accessors (self, _tmp72_); |
| 16507 | _tmp73_ = type_parameter; |
| 16508 | _tmp74_ = bala_symbol_get_name ((BalaSymbol*) _tmp73_); |
| 16509 | _tmp75_ = _tmp74_; |
| 16510 | _tmp76_ = g_ascii_strdown (_tmp75_, (gssize) -1); |
| 16511 | _tmp77_ = _tmp76_; |
| 16512 | _tmp78_ = g_strdup_printf ("get_%s_dup_func", _tmp77_); |
| 16513 | _tmp79_ = _tmp78_; |
| 16514 | _g_free0 (_tmp77_)(_tmp77_ = (g_free (_tmp77_), ((void*)0))); |
| 16515 | method_name = _tmp79_; |
| 16516 | _tmp80_ = iface; |
| 16517 | _tmp81_ = bala_get_ccode_type_get_function ((BalaObjectTypeSymbol*) _tmp80_); |
| 16518 | _tmp82_ = _tmp81_; |
| 16519 | _tmp83_ = bala_ccode_identifier_new (_tmp82_); |
| 16520 | _tmp84_ = _tmp83_; |
| 16521 | _tmp85_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp84_); |
| 16522 | _tmp86_ = _tmp85_; |
| 16523 | _bala_ccode_node_unref0 (_tmp84_)((_tmp84_ == ((void*)0)) ? ((void*)0) : (_tmp84_ = (bala_ccode_node_unref (_tmp84_), ((void*)0)))); |
| 16524 | _g_free0 (_tmp82_)(_tmp82_ = (g_free (_tmp82_), ((void*)0))); |
| 16525 | cast_self = _tmp86_; |
| 16526 | _tmp87_ = cast_self; |
| 16527 | _tmp88_ = bala_ccode_identifier_new ("self"); |
| 16528 | _tmp89_ = _tmp88_; |
| 16529 | bala_ccode_function_call_add_argument (_tmp87_, (BalaCCodeExpression*) _tmp89_); |
| 16530 | _bala_ccode_node_unref0 (_tmp89_)((_tmp89_ == ((void*)0)) ? ((void*)0) : (_tmp89_ = (bala_ccode_node_unref (_tmp89_), ((void*)0)))); |
| 16531 | _tmp90_ = cast_self; |
| 16532 | _tmp91_ = method_name; |
| 16533 | _tmp92_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp90_, _tmp91_); |
| 16534 | _tmp93_ = _tmp92_; |
| 16535 | _tmp94_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp93_); |
| 16536 | _tmp95_ = _tmp94_; |
| 16537 | _bala_ccode_node_unref0 (_tmp93_)((_tmp93_ == ((void*)0)) ? ((void*)0) : (_tmp93_ = (bala_ccode_node_unref (_tmp93_), ((void*)0)))); |
| 16538 | function_call = _tmp95_; |
| 16539 | _tmp96_ = function_call; |
| 16540 | _tmp97_ = bala_ccode_identifier_new ("self"); |
| 16541 | _tmp98_ = _tmp97_; |
| 16542 | bala_ccode_function_call_add_argument (_tmp96_, (BalaCCodeExpression*) _tmp98_); |
| 16543 | _bala_ccode_node_unref0 (_tmp98_)((_tmp98_ == ((void*)0)) ? ((void*)0) : (_tmp98_ = (bala_ccode_node_unref (_tmp98_), ((void*)0)))); |
| 16544 | result = (BalaCCodeExpression*) function_call; |
| 16545 | _bala_ccode_node_unref0 (cast_self)((cast_self == ((void*)0)) ? ((void*)0) : (cast_self = (bala_ccode_node_unref (cast_self), ((void*)0)))); |
| 16546 | _g_free0 (method_name)(method_name = (g_free (method_name), ((void*)0))); |
| 16547 | _bala_code_node_unref0 (iface)((iface == ((void*)0)) ? ((void*)0) : (iface = (bala_code_node_unref (iface), ((void*)0)))); |
| 16548 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 16549 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 16550 | return result; |
| 16551 | } |
| 16552 | if (bala_ccode_base_module_is_in_generic_type (self, G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_GENERIC_TYPE, BalaGenericType)(((BalaGenericType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_generic_type_get_type ()))))))) { |
| 16553 | _tmp100_ = !is_chainup; |
| 16554 | } else { |
| 16555 | _tmp100_ = FALSE(0); |
| 16556 | } |
| 16557 | if (_tmp100_) { |
| 16558 | gboolean _tmp101_; |
| 16559 | gboolean _tmp102_; |
| 16560 | _tmp101_ = bala_ccode_base_module_get_in_creation_method (self); |
| 16561 | _tmp102_ = _tmp101_; |
| 16562 | _tmp99_ = !_tmp102_; |
| 16563 | } else { |
| 16564 | _tmp99_ = FALSE(0); |
| 16565 | } |
| 16566 | if (_tmp99_) { |
| 16567 | BalaCCodeExpression* _tmp103_; |
| 16568 | BalaCCodeExpression* _tmp104_; |
| 16569 | BalaCCodeMemberAccess* _tmp105_; |
| 16570 | BalaCCodeMemberAccess* _tmp106_; |
| 16571 | const gchar* _tmp107_; |
| 16572 | BalaCCodeMemberAccess* _tmp108_; |
| 16573 | BalaCCodeExpression* _tmp109_; |
| 16574 | _tmp103_ = bala_ccode_base_module_get_this_cexpression (self); |
| 16575 | _tmp104_ = _tmp103_; |
| 16576 | _tmp105_ = bala_ccode_member_access_new_pointer (_tmp104_, "priv"); |
| 16577 | _tmp106_ = _tmp105_; |
| 16578 | _tmp107_ = func_name; |
| 16579 | _tmp108_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp106_, _tmp107_); |
| 16580 | _tmp109_ = (BalaCCodeExpression*) _tmp108_; |
| 16581 | _bala_ccode_node_unref0 (_tmp106_)((_tmp106_ == ((void*)0)) ? ((void*)0) : (_tmp106_ = (bala_ccode_node_unref (_tmp106_), ((void*)0)))); |
| 16582 | _bala_ccode_node_unref0 (_tmp104_)((_tmp104_ == ((void*)0)) ? ((void*)0) : (_tmp104_ = (bala_ccode_node_unref (_tmp104_), ((void*)0)))); |
| 16583 | result = _tmp109_; |
| 16584 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 16585 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 16586 | return result; |
| 16587 | } else { |
| 16588 | const gchar* _tmp110_; |
| 16589 | BalaCCodeExpression* _tmp111_; |
| 16590 | _tmp110_ = func_name; |
| 16591 | _tmp111_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp110_); |
| 16592 | result = _tmp111_; |
| 16593 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 16594 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 16595 | return result; |
| 16596 | } |
| 16597 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 16598 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 16599 | } else { |
| 16600 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_POINTER_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_pointer_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 16601 | BalaPointerType* pointer_type = NULL((void*)0); |
| 16602 | BalaPointerType* _tmp112_; |
| 16603 | BalaPointerType* _tmp113_; |
| 16604 | BalaDataType* _tmp114_; |
| 16605 | BalaDataType* _tmp115_; |
| 16606 | BalaCCodeExpression* _tmp116_; |
| 16607 | _tmp112_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_POINTER_TYPE, BalaPointerType)(((BalaPointerType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_pointer_type_get_type ())))))); |
| 16608 | pointer_type = _tmp112_; |
| 16609 | _tmp113_ = pointer_type; |
| 16610 | _tmp114_ = bala_pointer_type_get_base_type (_tmp113_); |
| 16611 | _tmp115_ = _tmp114_; |
| 16612 | _tmp116_ = bala_ccode_base_module_get_dup_func_expression (self, _tmp115_, source_reference, FALSE(0)); |
| 16613 | result = _tmp116_; |
| 16614 | _bala_code_node_unref0 (pointer_type)((pointer_type == ((void*)0)) ? ((void*)0) : (pointer_type = ( bala_code_node_unref (pointer_type), ((void*)0)))); |
| 16615 | return result; |
| 16616 | } else { |
| 16617 | BalaCCodeConstant* _tmp117_; |
| 16618 | _tmp117_ = bala_ccode_constant_new ("NULL"); |
| 16619 | result = (BalaCCodeExpression*) _tmp117_; |
| 16620 | return result; |
| 16621 | } |
| 16622 | } |
| 16623 | } |
| 16624 | } |
| 16625 | } |
| 16626 | |
| 16627 | BalaCCodeExpression* |
| 16628 | bala_ccode_base_module_get_dup_func_expression (BalaCCodeBaseModule* self, |
| 16629 | BalaDataType* type, |
| 16630 | BalaSourceReference* source_reference, |
| 16631 | gboolean is_chainup) |
| 16632 | { |
| 16633 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 16634 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_dup_func_expression (self, type, source_reference, is_chainup); |
| 16635 | } |
| 16636 | |
| 16637 | static void |
| 16638 | bala_ccode_base_module_make_comparable_cexpression (BalaCCodeBaseModule* self, |
| 16639 | BalaDataType* * left_type, |
| 16640 | BalaCCodeExpression* * cleft, |
| 16641 | BalaDataType* * right_type, |
| 16642 | BalaCCodeExpression* * cright) |
| 16643 | { |
| 16644 | BalaStruct* left_type_as_struct = NULL((void*)0); |
| 16645 | BalaTypeSymbol* _tmp0_; |
| 16646 | BalaTypeSymbol* _tmp1_; |
| 16647 | BalaStruct* right_type_as_struct = NULL((void*)0); |
| 16648 | BalaTypeSymbol* _tmp2_; |
| 16649 | BalaTypeSymbol* _tmp3_; |
| 16650 | BalaObjectTypeSymbol* left_type_as_object_type = NULL((void*)0); |
| 16651 | BalaTypeSymbol* _tmp4_; |
| 16652 | BalaTypeSymbol* _tmp5_; |
| 16653 | BalaObjectTypeSymbol* right_type_as_object_type = NULL((void*)0); |
| 16654 | BalaTypeSymbol* _tmp6_; |
| 16655 | BalaTypeSymbol* _tmp7_; |
| 16656 | gboolean _tmp8_ = FALSE(0); |
| 16657 | gboolean _tmp9_ = FALSE(0); |
| 16658 | gboolean _tmp10_ = FALSE(0); |
| 16659 | BalaObjectTypeSymbol* _tmp11_; |
| 16660 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 16661 | g_return_if_fail (*left_type != NULL)do { if ((*left_type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "*left_type != NULL" ); return; } } while (0); |
| 16662 | g_return_if_fail (*cleft != NULL)do { if ((*cleft != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "*cleft != NULL" ); return; } } while (0); |
| 16663 | g_return_if_fail (*right_type != NULL)do { if ((*right_type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "*right_type != NULL" ); return; } } while (0); |
| 16664 | g_return_if_fail (*cright != NULL)do { if ((*cright != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "*cright != NULL" ); return; } } while (0); |
| 16665 | _tmp0_ = bala_data_type_get_type_symbol (*left_type); |
| 16666 | _tmp1_ = _tmp0_; |
| 16667 | left_type_as_struct = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp1_) : NULL((void*)0); |
| 16668 | _tmp2_ = bala_data_type_get_type_symbol (*right_type); |
| 16669 | _tmp3_ = _tmp2_; |
| 16670 | right_type_as_struct = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp3_) : NULL((void*)0); |
| 16671 | _tmp4_ = bala_data_type_get_type_symbol (*left_type); |
| 16672 | _tmp5_ = _tmp4_; |
| 16673 | left_type_as_object_type = G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, BALA_TYPE_OBJECT_TYPE_SYMBOL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp5_); GType __t = ((bala_object_type_symbol_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } ))) ? ((BalaObjectTypeSymbol*) _tmp5_) : NULL((void*)0); |
| 16674 | _tmp6_ = bala_data_type_get_type_symbol (*right_type); |
| 16675 | _tmp7_ = _tmp6_; |
| 16676 | right_type_as_object_type = G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, BALA_TYPE_OBJECT_TYPE_SYMBOL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp7_); GType __t = ((bala_object_type_symbol_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } ))) ? ((BalaObjectTypeSymbol*) _tmp7_) : NULL((void*)0); |
| 16677 | _tmp11_ = left_type_as_object_type; |
| 16678 | if (_tmp11_ != NULL((void*)0)) { |
| 16679 | gboolean _tmp12_ = FALSE(0); |
| 16680 | BalaObjectTypeSymbol* _tmp13_; |
| 16681 | _tmp13_ = left_type_as_object_type; |
| 16682 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp13_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 16683 | _tmp12_ = TRUE(!(0)); |
| 16684 | } else { |
| 16685 | BalaObjectTypeSymbol* _tmp14_; |
| 16686 | gboolean _tmp15_; |
| 16687 | gboolean _tmp16_; |
| 16688 | _tmp14_ = left_type_as_object_type; |
| 16689 | _tmp15_ = bala_class_get_is_compact (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp14_), ((bala_class_get_type ())))))); |
| 16690 | _tmp16_ = _tmp15_; |
| 16691 | _tmp12_ = !_tmp16_; |
| 16692 | } |
| 16693 | _tmp10_ = _tmp12_; |
| 16694 | } else { |
| 16695 | _tmp10_ = FALSE(0); |
| 16696 | } |
| 16697 | if (_tmp10_) { |
| 16698 | BalaObjectTypeSymbol* _tmp17_; |
| 16699 | _tmp17_ = right_type_as_object_type; |
| 16700 | _tmp9_ = _tmp17_ != NULL((void*)0); |
| 16701 | } else { |
| 16702 | _tmp9_ = FALSE(0); |
| 16703 | } |
| 16704 | if (_tmp9_) { |
| 16705 | gboolean _tmp18_ = FALSE(0); |
| 16706 | BalaObjectTypeSymbol* _tmp19_; |
| 16707 | _tmp19_ = right_type_as_object_type; |
| 16708 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp19_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 16709 | _tmp18_ = TRUE(!(0)); |
| 16710 | } else { |
| 16711 | BalaObjectTypeSymbol* _tmp20_; |
| 16712 | gboolean _tmp21_; |
| 16713 | gboolean _tmp22_; |
| 16714 | _tmp20_ = right_type_as_object_type; |
| 16715 | _tmp21_ = bala_class_get_is_compact (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp20_), ((bala_class_get_type ())))))); |
| 16716 | _tmp22_ = _tmp21_; |
| 16717 | _tmp18_ = !_tmp22_; |
| 16718 | } |
| 16719 | _tmp8_ = _tmp18_; |
| 16720 | } else { |
| 16721 | _tmp8_ = FALSE(0); |
| 16722 | } |
| 16723 | if (_tmp8_) { |
| 16724 | BalaObjectTypeSymbol* _tmp23_; |
| 16725 | BalaObjectTypeSymbol* _tmp24_; |
| 16726 | _tmp23_ = left_type_as_object_type; |
| 16727 | _tmp24_ = right_type_as_object_type; |
| 16728 | if (_tmp23_ != _tmp24_) { |
| 16729 | BalaObjectTypeSymbol* _tmp25_; |
| 16730 | BalaObjectTypeSymbol* _tmp26_; |
| 16731 | _tmp25_ = left_type_as_object_type; |
| 16732 | _tmp26_ = right_type_as_object_type; |
| 16733 | if (bala_typesymbol_is_subtype_of ((BalaTypeSymbol*) _tmp25_, (BalaTypeSymbol*) _tmp26_)) { |
| 16734 | BalaObjectTypeSymbol* _tmp27_; |
| 16735 | BalaCCodeFunctionCall* _tmp28_; |
| 16736 | _tmp27_ = right_type_as_object_type; |
| 16737 | _tmp28_ = bala_ccode_base_module_generate_instance_cast (self, *cleft, (BalaTypeSymbol*) _tmp27_); |
| 16738 | _bala_ccode_node_unref0 (*cleft)((*cleft == ((void*)0)) ? ((void*)0) : (*cleft = (bala_ccode_node_unref (*cleft), ((void*)0)))); |
| 16739 | *cleft = (BalaCCodeExpression*) _tmp28_; |
| 16740 | } else { |
| 16741 | BalaObjectTypeSymbol* _tmp29_; |
| 16742 | BalaObjectTypeSymbol* _tmp30_; |
| 16743 | _tmp29_ = right_type_as_object_type; |
| 16744 | _tmp30_ = left_type_as_object_type; |
| 16745 | if (bala_typesymbol_is_subtype_of ((BalaTypeSymbol*) _tmp29_, (BalaTypeSymbol*) _tmp30_)) { |
| 16746 | BalaObjectTypeSymbol* _tmp31_; |
| 16747 | BalaCCodeFunctionCall* _tmp32_; |
| 16748 | _tmp31_ = left_type_as_object_type; |
| 16749 | _tmp32_ = bala_ccode_base_module_generate_instance_cast (self, *cright, (BalaTypeSymbol*) _tmp31_); |
| 16750 | _bala_ccode_node_unref0 (*cright)((*cright == ((void*)0)) ? ((void*)0) : (*cright = (bala_ccode_node_unref (*cright), ((void*)0)))); |
| 16751 | *cright = (BalaCCodeExpression*) _tmp32_; |
| 16752 | } |
| 16753 | } |
| 16754 | } |
| 16755 | } else { |
| 16756 | gboolean _tmp33_ = FALSE(0); |
| 16757 | BalaStruct* _tmp34_; |
| 16758 | _tmp34_ = left_type_as_struct; |
| 16759 | if (_tmp34_ != NULL((void*)0)) { |
| 16760 | BalaStruct* _tmp35_; |
| 16761 | _tmp35_ = right_type_as_struct; |
| 16762 | _tmp33_ = _tmp35_ != NULL((void*)0); |
| 16763 | } else { |
| 16764 | _tmp33_ = FALSE(0); |
| 16765 | } |
| 16766 | if (_tmp33_) { |
| 16767 | if (G_TYPE_CHECK_INSTANCE_TYPE (*left_type, BALA_TYPE_STRUCT_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( *left_type); GType __t = ((bala_struct_value_type_get_type () )); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 16768 | gboolean _tmp36_; |
| 16769 | gboolean _tmp37_; |
| 16770 | gboolean _tmp39_; |
| 16771 | gboolean _tmp40_; |
| 16772 | _tmp36_ = bala_data_type_get_nullable (*left_type); |
| 16773 | _tmp37_ = _tmp36_; |
| 16774 | if (!_tmp37_) { |
| 16775 | BalaCCodeUnaryExpression* _tmp38_; |
| 16776 | _tmp38_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, *cleft); |
| 16777 | _bala_ccode_node_unref0 (*cleft)((*cleft == ((void*)0)) ? ((void*)0) : (*cleft = (bala_ccode_node_unref (*cleft), ((void*)0)))); |
| 16778 | *cleft = (BalaCCodeExpression*) _tmp38_; |
| 16779 | } |
| 16780 | _tmp39_ = bala_data_type_get_nullable (*right_type); |
| 16781 | _tmp40_ = _tmp39_; |
| 16782 | if (!_tmp40_) { |
| 16783 | BalaCCodeUnaryExpression* _tmp41_; |
| 16784 | _tmp41_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, *cright); |
| 16785 | _bala_ccode_node_unref0 (*cright)((*cright == ((void*)0)) ? ((void*)0) : (*cright = (bala_ccode_node_unref (*cright), ((void*)0)))); |
| 16786 | *cright = (BalaCCodeExpression*) _tmp41_; |
| 16787 | } |
| 16788 | } else { |
| 16789 | gboolean _tmp42_ = FALSE(0); |
| 16790 | gboolean _tmp43_; |
| 16791 | gboolean _tmp44_; |
| 16792 | _tmp43_ = bala_data_type_get_nullable (*left_type); |
| 16793 | _tmp44_ = _tmp43_; |
| 16794 | if (_tmp44_) { |
| 16795 | gboolean _tmp45_; |
| 16796 | gboolean _tmp46_; |
| 16797 | _tmp45_ = bala_data_type_get_nullable (*right_type); |
| 16798 | _tmp46_ = _tmp45_; |
| 16799 | _tmp42_ = _tmp46_; |
| 16800 | } else { |
| 16801 | _tmp42_ = FALSE(0); |
| 16802 | } |
| 16803 | if (_tmp42_) { |
| 16804 | } else { |
| 16805 | gboolean _tmp47_; |
| 16806 | gboolean _tmp48_; |
| 16807 | _tmp47_ = bala_data_type_get_nullable (*left_type); |
| 16808 | _tmp48_ = _tmp47_; |
| 16809 | if (_tmp48_) { |
| 16810 | BalaCCodeUnaryExpression* _tmp49_; |
| 16811 | _tmp49_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, *cleft); |
| 16812 | _bala_ccode_node_unref0 (*cleft)((*cleft == ((void*)0)) ? ((void*)0) : (*cleft = (bala_ccode_node_unref (*cleft), ((void*)0)))); |
| 16813 | *cleft = (BalaCCodeExpression*) _tmp49_; |
| 16814 | } else { |
| 16815 | gboolean _tmp50_; |
| 16816 | gboolean _tmp51_; |
| 16817 | _tmp50_ = bala_data_type_get_nullable (*right_type); |
| 16818 | _tmp51_ = _tmp50_; |
| 16819 | if (_tmp51_) { |
| 16820 | BalaCCodeUnaryExpression* _tmp52_; |
| 16821 | _tmp52_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, *cright); |
| 16822 | _bala_ccode_node_unref0 (*cright)((*cright == ((void*)0)) ? ((void*)0) : (*cright = (bala_ccode_node_unref (*cright), ((void*)0)))); |
| 16823 | *cright = (BalaCCodeExpression*) _tmp52_; |
| 16824 | } |
| 16825 | } |
| 16826 | } |
| 16827 | } |
| 16828 | } |
| 16829 | } |
| 16830 | } |
| 16831 | |
| 16832 | static gchar* |
| 16833 | bala_ccode_base_module_generate_struct_equal_function (BalaCCodeBaseModule* self, |
| 16834 | BalaStruct* st) |
| 16835 | { |
| 16836 | BalaStruct* _tmp0_; |
| 16837 | BalaStruct* _tmp1_; |
| 16838 | gchar* equal_func = NULL((void*)0); |
| 16839 | gchar* _tmp5_; |
| 16840 | gchar* _tmp6_; |
| 16841 | gchar* _tmp7_; |
| 16842 | gchar* _tmp8_; |
| 16843 | const gchar* _tmp9_; |
| 16844 | BalaCCodeFunction* function = NULL((void*)0); |
| 16845 | const gchar* _tmp10_; |
| 16846 | BalaDataType* _tmp11_; |
| 16847 | gchar* _tmp12_; |
| 16848 | gchar* _tmp13_; |
| 16849 | BalaCCodeFunction* _tmp14_; |
| 16850 | BalaCCodeFunction* _tmp15_; |
| 16851 | BalaCCodeFunction* _tmp16_; |
| 16852 | BalaCCodeFunction* _tmp17_; |
| 16853 | gchar* _tmp18_; |
| 16854 | gchar* _tmp19_; |
| 16855 | gchar* _tmp20_; |
| 16856 | gchar* _tmp21_; |
| 16857 | BalaCCodeParameter* _tmp22_; |
| 16858 | BalaCCodeParameter* _tmp23_; |
| 16859 | BalaCCodeFunction* _tmp24_; |
| 16860 | gchar* _tmp25_; |
| 16861 | gchar* _tmp26_; |
| 16862 | gchar* _tmp27_; |
| 16863 | gchar* _tmp28_; |
| 16864 | BalaCCodeParameter* _tmp29_; |
| 16865 | BalaCCodeParameter* _tmp30_; |
| 16866 | BalaCCodeFunction* _tmp31_; |
| 16867 | gboolean has_instance_fields = FALSE(0); |
| 16868 | BalaCCodeFile* _tmp187_; |
| 16869 | BalaCCodeFunction* _tmp188_; |
| 16870 | BalaCCodeFile* _tmp189_; |
| 16871 | BalaCCodeFunction* _tmp190_; |
| 16872 | gchar* result = NULL((void*)0); |
| 16873 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 16874 | g_return_val_if_fail (st != NULL, NULL)do { if ((st != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "st != NULL"); return (((void*)0)); } } while (0); |
| 16875 | _tmp0_ = bala_struct_get_base_struct (st); |
| 16876 | _tmp1_ = _tmp0_; |
| 16877 | if (_tmp1_ != NULL((void*)0)) { |
| 16878 | BalaStruct* _tmp2_; |
| 16879 | BalaStruct* _tmp3_; |
| 16880 | gchar* _tmp4_; |
| 16881 | _tmp2_ = bala_struct_get_base_struct (st); |
| 16882 | _tmp3_ = _tmp2_; |
| 16883 | _tmp4_ = bala_ccode_base_module_generate_struct_equal_function (self, _tmp3_); |
| 16884 | result = _tmp4_; |
| 16885 | return result; |
| 16886 | } |
| 16887 | _tmp5_ = bala_get_ccode_lower_case_prefix ((BalaSymbol*) st); |
| 16888 | _tmp6_ = _tmp5_; |
| 16889 | _tmp7_ = g_strdup_printf ("_%sequal", _tmp6_); |
| 16890 | _tmp8_ = _tmp7_; |
| 16891 | _g_free0 (_tmp6_)(_tmp6_ = (g_free (_tmp6_), ((void*)0))); |
| 16892 | equal_func = _tmp8_; |
| 16893 | _tmp9_ = equal_func; |
| 16894 | if (!bala_ccode_base_module_add_wrapper (self, _tmp9_)) { |
| 16895 | result = equal_func; |
| 16896 | return result; |
| 16897 | } |
| 16898 | _tmp10_ = equal_func; |
| 16899 | _tmp11_ = self->bool_type; |
| 16900 | _tmp12_ = bala_get_ccode_name ((BalaCodeNode*) _tmp11_); |
| 16901 | _tmp13_ = _tmp12_; |
| 16902 | _tmp14_ = bala_ccode_function_new (_tmp10_, _tmp13_); |
| 16903 | _tmp15_ = _tmp14_; |
| 16904 | _g_free0 (_tmp13_)(_tmp13_ = (g_free (_tmp13_), ((void*)0))); |
| 16905 | function = _tmp15_; |
| 16906 | _tmp16_ = function; |
| 16907 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp16_, BALA_CCODE_MODIFIERS_STATIC); |
| 16908 | _tmp17_ = function; |
| 16909 | _tmp18_ = bala_get_ccode_name ((BalaCodeNode*) st); |
| 16910 | _tmp19_ = _tmp18_; |
| 16911 | _tmp20_ = g_strdup_printf ("const %s *", _tmp19_); |
| 16912 | _tmp21_ = _tmp20_; |
| 16913 | _tmp22_ = bala_ccode_parameter_new ("s1", _tmp21_); |
| 16914 | _tmp23_ = _tmp22_; |
| 16915 | bala_ccode_function_add_parameter (_tmp17_, _tmp23_); |
| 16916 | _bala_ccode_node_unref0 (_tmp23_)((_tmp23_ == ((void*)0)) ? ((void*)0) : (_tmp23_ = (bala_ccode_node_unref (_tmp23_), ((void*)0)))); |
| 16917 | _g_free0 (_tmp21_)(_tmp21_ = (g_free (_tmp21_), ((void*)0))); |
| 16918 | _g_free0 (_tmp19_)(_tmp19_ = (g_free (_tmp19_), ((void*)0))); |
| 16919 | _tmp24_ = function; |
| 16920 | _tmp25_ = bala_get_ccode_name ((BalaCodeNode*) st); |
| 16921 | _tmp26_ = _tmp25_; |
| 16922 | _tmp27_ = g_strdup_printf ("const %s *", _tmp26_); |
| 16923 | _tmp28_ = _tmp27_; |
| 16924 | _tmp29_ = bala_ccode_parameter_new ("s2", _tmp28_); |
| 16925 | _tmp30_ = _tmp29_; |
| 16926 | bala_ccode_function_add_parameter (_tmp24_, _tmp30_); |
| 16927 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 16928 | _g_free0 (_tmp28_)(_tmp28_ = (g_free (_tmp28_), ((void*)0))); |
| 16929 | _g_free0 (_tmp26_)(_tmp26_ = (g_free (_tmp26_), ((void*)0))); |
| 16930 | _tmp31_ = function; |
| 16931 | bala_ccode_base_module_push_function (self, _tmp31_); |
| 16932 | { |
| 16933 | BalaCCodeBinaryExpression* cexp = NULL((void*)0); |
| 16934 | BalaCCodeIdentifier* _tmp32_; |
| 16935 | BalaCCodeIdentifier* _tmp33_; |
| 16936 | BalaCCodeIdentifier* _tmp34_; |
| 16937 | BalaCCodeIdentifier* _tmp35_; |
| 16938 | BalaCCodeBinaryExpression* _tmp36_; |
| 16939 | BalaCCodeBinaryExpression* _tmp37_; |
| 16940 | BalaCCodeFunction* _tmp38_; |
| 16941 | BalaCCodeFunction* _tmp39_; |
| 16942 | BalaCCodeBinaryExpression* _tmp40_; |
| 16943 | BalaCCodeFunction* _tmp41_; |
| 16944 | BalaCCodeFunction* _tmp42_; |
| 16945 | BalaCCodeExpression* _tmp43_; |
| 16946 | BalaCCodeExpression* _tmp44_; |
| 16947 | BalaCCodeFunction* _tmp45_; |
| 16948 | BalaCCodeFunction* _tmp46_; |
| 16949 | _tmp32_ = bala_ccode_identifier_new ("s1"); |
| 16950 | _tmp33_ = _tmp32_; |
| 16951 | _tmp34_ = bala_ccode_identifier_new ("s2"); |
| 16952 | _tmp35_ = _tmp34_; |
| 16953 | _tmp36_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp33_, (BalaCCodeExpression*) _tmp35_); |
| 16954 | _tmp37_ = _tmp36_; |
| 16955 | _bala_ccode_node_unref0 (_tmp35_)((_tmp35_ == ((void*)0)) ? ((void*)0) : (_tmp35_ = (bala_ccode_node_unref (_tmp35_), ((void*)0)))); |
| 16956 | _bala_ccode_node_unref0 (_tmp33_)((_tmp33_ == ((void*)0)) ? ((void*)0) : (_tmp33_ = (bala_ccode_node_unref (_tmp33_), ((void*)0)))); |
| 16957 | cexp = _tmp37_; |
| 16958 | _tmp38_ = bala_ccode_base_module_get_ccode (self); |
| 16959 | _tmp39_ = _tmp38_; |
| 16960 | _tmp40_ = cexp; |
| 16961 | bala_ccode_function_open_if (_tmp39_, (BalaCCodeExpression*) _tmp40_); |
| 16962 | _tmp41_ = bala_ccode_base_module_get_ccode (self); |
| 16963 | _tmp42_ = _tmp41_; |
| 16964 | _tmp43_ = bala_ccode_base_module_get_boolean_cconstant (self, TRUE(!(0))); |
| 16965 | _tmp44_ = _tmp43_; |
| 16966 | bala_ccode_function_add_return (_tmp42_, _tmp44_); |
| 16967 | _bala_ccode_node_unref0 (_tmp44_)((_tmp44_ == ((void*)0)) ? ((void*)0) : (_tmp44_ = (bala_ccode_node_unref (_tmp44_), ((void*)0)))); |
| 16968 | _tmp45_ = bala_ccode_base_module_get_ccode (self); |
| 16969 | _tmp46_ = _tmp45_; |
| 16970 | bala_ccode_function_close (_tmp46_); |
| 16971 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 16972 | } |
| 16973 | { |
| 16974 | BalaCCodeBinaryExpression* cexp = NULL((void*)0); |
| 16975 | BalaCCodeIdentifier* _tmp47_; |
| 16976 | BalaCCodeIdentifier* _tmp48_; |
| 16977 | BalaCCodeConstant* _tmp49_; |
| 16978 | BalaCCodeConstant* _tmp50_; |
| 16979 | BalaCCodeBinaryExpression* _tmp51_; |
| 16980 | BalaCCodeBinaryExpression* _tmp52_; |
| 16981 | BalaCCodeFunction* _tmp53_; |
| 16982 | BalaCCodeFunction* _tmp54_; |
| 16983 | BalaCCodeBinaryExpression* _tmp55_; |
| 16984 | BalaCCodeFunction* _tmp56_; |
| 16985 | BalaCCodeFunction* _tmp57_; |
| 16986 | BalaCCodeExpression* _tmp58_; |
| 16987 | BalaCCodeExpression* _tmp59_; |
| 16988 | BalaCCodeFunction* _tmp60_; |
| 16989 | BalaCCodeFunction* _tmp61_; |
| 16990 | BalaCCodeIdentifier* _tmp62_; |
| 16991 | BalaCCodeIdentifier* _tmp63_; |
| 16992 | BalaCCodeConstant* _tmp64_; |
| 16993 | BalaCCodeConstant* _tmp65_; |
| 16994 | BalaCCodeBinaryExpression* _tmp66_; |
| 16995 | BalaCCodeFunction* _tmp67_; |
| 16996 | BalaCCodeFunction* _tmp68_; |
| 16997 | BalaCCodeBinaryExpression* _tmp69_; |
| 16998 | BalaCCodeFunction* _tmp70_; |
| 16999 | BalaCCodeFunction* _tmp71_; |
| 17000 | BalaCCodeExpression* _tmp72_; |
| 17001 | BalaCCodeExpression* _tmp73_; |
| 17002 | BalaCCodeFunction* _tmp74_; |
| 17003 | BalaCCodeFunction* _tmp75_; |
| 17004 | _tmp47_ = bala_ccode_identifier_new ("s1"); |
| 17005 | _tmp48_ = _tmp47_; |
| 17006 | _tmp49_ = bala_ccode_constant_new ("NULL"); |
| 17007 | _tmp50_ = _tmp49_; |
| 17008 | _tmp51_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp48_, (BalaCCodeExpression*) _tmp50_); |
| 17009 | _tmp52_ = _tmp51_; |
| 17010 | _bala_ccode_node_unref0 (_tmp50_)((_tmp50_ == ((void*)0)) ? ((void*)0) : (_tmp50_ = (bala_ccode_node_unref (_tmp50_), ((void*)0)))); |
| 17011 | _bala_ccode_node_unref0 (_tmp48_)((_tmp48_ == ((void*)0)) ? ((void*)0) : (_tmp48_ = (bala_ccode_node_unref (_tmp48_), ((void*)0)))); |
| 17012 | cexp = _tmp52_; |
| 17013 | _tmp53_ = bala_ccode_base_module_get_ccode (self); |
| 17014 | _tmp54_ = _tmp53_; |
| 17015 | _tmp55_ = cexp; |
| 17016 | bala_ccode_function_open_if (_tmp54_, (BalaCCodeExpression*) _tmp55_); |
| 17017 | _tmp56_ = bala_ccode_base_module_get_ccode (self); |
| 17018 | _tmp57_ = _tmp56_; |
| 17019 | _tmp58_ = bala_ccode_base_module_get_boolean_cconstant (self, FALSE(0)); |
| 17020 | _tmp59_ = _tmp58_; |
| 17021 | bala_ccode_function_add_return (_tmp57_, _tmp59_); |
| 17022 | _bala_ccode_node_unref0 (_tmp59_)((_tmp59_ == ((void*)0)) ? ((void*)0) : (_tmp59_ = (bala_ccode_node_unref (_tmp59_), ((void*)0)))); |
| 17023 | _tmp60_ = bala_ccode_base_module_get_ccode (self); |
| 17024 | _tmp61_ = _tmp60_; |
| 17025 | bala_ccode_function_close (_tmp61_); |
| 17026 | _tmp62_ = bala_ccode_identifier_new ("s2"); |
| 17027 | _tmp63_ = _tmp62_; |
| 17028 | _tmp64_ = bala_ccode_constant_new ("NULL"); |
| 17029 | _tmp65_ = _tmp64_; |
| 17030 | _tmp66_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp63_, (BalaCCodeExpression*) _tmp65_); |
| 17031 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 17032 | cexp = _tmp66_; |
| 17033 | _bala_ccode_node_unref0 (_tmp65_)((_tmp65_ == ((void*)0)) ? ((void*)0) : (_tmp65_ = (bala_ccode_node_unref (_tmp65_), ((void*)0)))); |
| 17034 | _bala_ccode_node_unref0 (_tmp63_)((_tmp63_ == ((void*)0)) ? ((void*)0) : (_tmp63_ = (bala_ccode_node_unref (_tmp63_), ((void*)0)))); |
| 17035 | _tmp67_ = bala_ccode_base_module_get_ccode (self); |
| 17036 | _tmp68_ = _tmp67_; |
| 17037 | _tmp69_ = cexp; |
| 17038 | bala_ccode_function_open_if (_tmp68_, (BalaCCodeExpression*) _tmp69_); |
| 17039 | _tmp70_ = bala_ccode_base_module_get_ccode (self); |
| 17040 | _tmp71_ = _tmp70_; |
| 17041 | _tmp72_ = bala_ccode_base_module_get_boolean_cconstant (self, FALSE(0)); |
| 17042 | _tmp73_ = _tmp72_; |
| 17043 | bala_ccode_function_add_return (_tmp71_, _tmp73_); |
| 17044 | _bala_ccode_node_unref0 (_tmp73_)((_tmp73_ == ((void*)0)) ? ((void*)0) : (_tmp73_ = (bala_ccode_node_unref (_tmp73_), ((void*)0)))); |
| 17045 | _tmp74_ = bala_ccode_base_module_get_ccode (self); |
| 17046 | _tmp75_ = _tmp74_; |
| 17047 | bala_ccode_function_close (_tmp75_); |
| 17048 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 17049 | } |
| 17050 | has_instance_fields = FALSE(0); |
| 17051 | { |
| 17052 | BalaList* _f_list = NULL((void*)0); |
| 17053 | BalaList* _tmp76_; |
| 17054 | BalaList* _tmp77_; |
| 17055 | gint _f_size = 0; |
| 17056 | BalaList* _tmp78_; |
| 17057 | gint _tmp79_; |
| 17058 | gint _tmp80_; |
| 17059 | gint _f_index = 0; |
| 17060 | _tmp76_ = bala_struct_get_fields (st); |
| 17061 | _tmp77_ = _bala_iterable_ref0 (_tmp76_); |
| 17062 | _f_list = _tmp77_; |
| 17063 | _tmp78_ = _f_list; |
| 17064 | _tmp79_ = bala_collection_get_size ((BalaCollection*) _tmp78_); |
| 17065 | _tmp80_ = _tmp79_; |
| 17066 | _f_size = _tmp80_; |
| 17067 | _f_index = -1; |
| 17068 | while (TRUE(!(0))) { |
| 17069 | gint _tmp81_; |
| 17070 | gint _tmp82_; |
| 17071 | BalaField* f = NULL((void*)0); |
| 17072 | BalaList* _tmp83_; |
| 17073 | gpointer _tmp84_; |
| 17074 | BalaField* _tmp85_; |
| 17075 | BalaMemberBinding _tmp86_; |
| 17076 | BalaMemberBinding _tmp87_; |
| 17077 | BalaCCodeExpression* cexp = NULL((void*)0); |
| 17078 | BalaCCodeExpression* s1 = NULL((void*)0); |
| 17079 | BalaCCodeIdentifier* _tmp88_; |
| 17080 | BalaCCodeIdentifier* _tmp89_; |
| 17081 | BalaField* _tmp90_; |
| 17082 | gchar* _tmp91_; |
| 17083 | gchar* _tmp92_; |
| 17084 | BalaCCodeMemberAccess* _tmp93_; |
| 17085 | BalaCCodeExpression* _tmp94_; |
| 17086 | BalaCCodeExpression* s2 = NULL((void*)0); |
| 17087 | BalaCCodeIdentifier* _tmp95_; |
| 17088 | BalaCCodeIdentifier* _tmp96_; |
| 17089 | BalaField* _tmp97_; |
| 17090 | gchar* _tmp98_; |
| 17091 | gchar* _tmp99_; |
| 17092 | BalaCCodeMemberAccess* _tmp100_; |
| 17093 | BalaCCodeExpression* _tmp101_; |
| 17094 | BalaDataType* variable_type = NULL((void*)0); |
| 17095 | BalaField* _tmp102_; |
| 17096 | BalaDataType* _tmp103_; |
| 17097 | BalaDataType* _tmp104_; |
| 17098 | BalaDataType* _tmp105_; |
| 17099 | gboolean _tmp106_ = FALSE(0); |
| 17100 | BalaField* _tmp107_; |
| 17101 | BalaDataType* _tmp108_; |
| 17102 | BalaDataType* _tmp109_; |
| 17103 | BalaCCodeFunction* _tmp157_; |
| 17104 | BalaCCodeFunction* _tmp158_; |
| 17105 | BalaCCodeExpression* _tmp159_; |
| 17106 | BalaCCodeFunction* _tmp160_; |
| 17107 | BalaCCodeFunction* _tmp161_; |
| 17108 | BalaCCodeExpression* _tmp162_; |
| 17109 | BalaCCodeExpression* _tmp163_; |
| 17110 | BalaCCodeFunction* _tmp164_; |
| 17111 | BalaCCodeFunction* _tmp165_; |
| 17112 | _f_index = _f_index + 1; |
| 17113 | _tmp81_ = _f_index; |
| 17114 | _tmp82_ = _f_size; |
| 17115 | if (!(_tmp81_ < _tmp82_)) { |
| 17116 | break; |
| 17117 | } |
| 17118 | _tmp83_ = _f_list; |
| 17119 | _tmp84_ = bala_list_get (_tmp83_, _f_index); |
| 17120 | f = (BalaField*) _tmp84_; |
| 17121 | _tmp85_ = f; |
| 17122 | _tmp86_ = bala_field_get_binding (_tmp85_); |
| 17123 | _tmp87_ = _tmp86_; |
| 17124 | if (_tmp87_ != BALA_MEMBER_BINDING_INSTANCE) { |
| 17125 | _bala_code_node_unref0 (f)((f == ((void*)0)) ? ((void*)0) : (f = (bala_code_node_unref ( f), ((void*)0)))); |
| 17126 | continue; |
| 17127 | } |
| 17128 | has_instance_fields = TRUE(!(0)); |
| 17129 | _tmp88_ = bala_ccode_identifier_new ("s1"); |
| 17130 | _tmp89_ = _tmp88_; |
| 17131 | _tmp90_ = f; |
| 17132 | _tmp91_ = bala_get_ccode_name ((BalaCodeNode*) _tmp90_); |
| 17133 | _tmp92_ = _tmp91_; |
| 17134 | _tmp93_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp89_, _tmp92_); |
| 17135 | _tmp94_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp93_, BALA_TYPE_CCODE_EXPRESSION, BalaCCodeExpression)(((BalaCCodeExpression*) g_type_check_instance_cast ((GTypeInstance *) (_tmp93_), ((bala_ccode_expression_get_type ()))))); |
| 17136 | _g_free0 (_tmp92_)(_tmp92_ = (g_free (_tmp92_), ((void*)0))); |
| 17137 | _bala_ccode_node_unref0 (_tmp89_)((_tmp89_ == ((void*)0)) ? ((void*)0) : (_tmp89_ = (bala_ccode_node_unref (_tmp89_), ((void*)0)))); |
| 17138 | s1 = _tmp94_; |
| 17139 | _tmp95_ = bala_ccode_identifier_new ("s2"); |
| 17140 | _tmp96_ = _tmp95_; |
| 17141 | _tmp97_ = f; |
| 17142 | _tmp98_ = bala_get_ccode_name ((BalaCodeNode*) _tmp97_); |
| 17143 | _tmp99_ = _tmp98_; |
| 17144 | _tmp100_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp96_, _tmp99_); |
| 17145 | _tmp101_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp100_, BALA_TYPE_CCODE_EXPRESSION, BalaCCodeExpression)(((BalaCCodeExpression*) g_type_check_instance_cast ((GTypeInstance *) (_tmp100_), ((bala_ccode_expression_get_type ()))))); |
| 17146 | _g_free0 (_tmp99_)(_tmp99_ = (g_free (_tmp99_), ((void*)0))); |
| 17147 | _bala_ccode_node_unref0 (_tmp96_)((_tmp96_ == ((void*)0)) ? ((void*)0) : (_tmp96_ = (bala_ccode_node_unref (_tmp96_), ((void*)0)))); |
| 17148 | s2 = _tmp101_; |
| 17149 | _tmp102_ = f; |
| 17150 | _tmp103_ = bala_variable_get_variable_type ((BalaVariable*) _tmp102_); |
| 17151 | _tmp104_ = _tmp103_; |
| 17152 | _tmp105_ = bala_data_type_copy (_tmp104_); |
| 17153 | variable_type = _tmp105_; |
| 17154 | bala_ccode_base_module_make_comparable_cexpression (self, &variable_type, &s1, &variable_type, &s2); |
| 17155 | _tmp107_ = f; |
| 17156 | _tmp108_ = bala_variable_get_variable_type ((BalaVariable*) _tmp107_); |
| 17157 | _tmp109_ = _tmp108_; |
| 17158 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp109_, BALA_TYPE_NULL_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp109_); GType __t = ((bala_null_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 17159 | BalaField* _tmp110_; |
| 17160 | BalaDataType* _tmp111_; |
| 17161 | BalaDataType* _tmp112_; |
| 17162 | BalaDataType* _tmp113_; |
| 17163 | _tmp110_ = f; |
| 17164 | _tmp111_ = bala_variable_get_variable_type ((BalaVariable*) _tmp110_); |
| 17165 | _tmp112_ = _tmp111_; |
| 17166 | _tmp113_ = self->string_type; |
| 17167 | _tmp106_ = bala_data_type_compatible (_tmp112_, _tmp113_); |
| 17168 | } else { |
| 17169 | _tmp106_ = FALSE(0); |
| 17170 | } |
| 17171 | if (_tmp106_) { |
| 17172 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 17173 | BalaCodeContext* _tmp114_; |
| 17174 | BalaProfile _tmp115_; |
| 17175 | BalaProfile _tmp116_; |
| 17176 | BalaCCodeFunctionCall* _tmp128_; |
| 17177 | BalaCCodeExpression* _tmp129_; |
| 17178 | BalaCCodeFunctionCall* _tmp130_; |
| 17179 | BalaCCodeExpression* _tmp131_; |
| 17180 | BalaCCodeFunctionCall* _tmp132_; |
| 17181 | BalaCCodeExpression* _tmp133_; |
| 17182 | _tmp114_ = self->priv->_context; |
| 17183 | _tmp115_ = bala_code_context_get_profile (_tmp114_); |
| 17184 | _tmp116_ = _tmp115_; |
| 17185 | if (_tmp116_ == BALA_PROFILE_POSIX) { |
| 17186 | BalaCCodeFile* _tmp117_; |
| 17187 | BalaCCodeIdentifier* _tmp118_; |
| 17188 | BalaCCodeIdentifier* _tmp119_; |
| 17189 | gchar* _tmp120_; |
| 17190 | gchar* _tmp121_; |
| 17191 | BalaCCodeIdentifier* _tmp122_; |
| 17192 | BalaCCodeIdentifier* _tmp123_; |
| 17193 | BalaCCodeFunctionCall* _tmp124_; |
| 17194 | _tmp117_ = self->cfile; |
| 17195 | bala_ccode_file_add_include (_tmp117_, "string.h", FALSE(0)); |
| 17196 | _tmp118_ = bala_ccode_identifier_new ("strcmp"); |
| 17197 | _tmp119_ = _tmp118_; |
| 17198 | _tmp120_ = bala_ccode_base_module_generate_cmp_wrapper (self, _tmp119_); |
| 17199 | _tmp121_ = _tmp120_; |
| 17200 | _tmp122_ = bala_ccode_identifier_new (_tmp121_); |
| 17201 | _tmp123_ = _tmp122_; |
| 17202 | _tmp124_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp123_); |
| 17203 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 17204 | ccall = _tmp124_; |
| 17205 | _bala_ccode_node_unref0 (_tmp123_)((_tmp123_ == ((void*)0)) ? ((void*)0) : (_tmp123_ = (bala_ccode_node_unref (_tmp123_), ((void*)0)))); |
| 17206 | _g_free0 (_tmp121_)(_tmp121_ = (g_free (_tmp121_), ((void*)0))); |
| 17207 | _bala_ccode_node_unref0 (_tmp119_)((_tmp119_ == ((void*)0)) ? ((void*)0) : (_tmp119_ = (bala_ccode_node_unref (_tmp119_), ((void*)0)))); |
| 17208 | } else { |
| 17209 | BalaCCodeIdentifier* _tmp125_; |
| 17210 | BalaCCodeIdentifier* _tmp126_; |
| 17211 | BalaCCodeFunctionCall* _tmp127_; |
| 17212 | _tmp125_ = bala_ccode_identifier_new ("g_strcmp0"); |
| 17213 | _tmp126_ = _tmp125_; |
| 17214 | _tmp127_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp126_); |
| 17215 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 17216 | ccall = _tmp127_; |
| 17217 | _bala_ccode_node_unref0 (_tmp126_)((_tmp126_ == ((void*)0)) ? ((void*)0) : (_tmp126_ = (bala_ccode_node_unref (_tmp126_), ((void*)0)))); |
| 17218 | } |
| 17219 | _tmp128_ = ccall; |
| 17220 | _tmp129_ = s1; |
| 17221 | bala_ccode_function_call_add_argument (_tmp128_, _tmp129_); |
| 17222 | _tmp130_ = ccall; |
| 17223 | _tmp131_ = s2; |
| 17224 | bala_ccode_function_call_add_argument (_tmp130_, _tmp131_); |
| 17225 | _tmp132_ = ccall; |
| 17226 | _tmp133_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp132_); |
| 17227 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 17228 | cexp = _tmp133_; |
| 17229 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 17230 | } else { |
| 17231 | BalaField* _tmp134_; |
| 17232 | BalaDataType* _tmp135_; |
| 17233 | BalaDataType* _tmp136_; |
| 17234 | _tmp134_ = f; |
| 17235 | _tmp135_ = bala_variable_get_variable_type ((BalaVariable*) _tmp134_); |
| 17236 | _tmp136_ = _tmp135_; |
| 17237 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp136_, BALA_TYPE_STRUCT_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp136_); GType __t = ((bala_struct_value_type_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 17238 | gchar* equalfunc = NULL((void*)0); |
| 17239 | BalaField* _tmp137_; |
| 17240 | BalaDataType* _tmp138_; |
| 17241 | BalaDataType* _tmp139_; |
| 17242 | BalaTypeSymbol* _tmp140_; |
| 17243 | BalaTypeSymbol* _tmp141_; |
| 17244 | gchar* _tmp142_; |
| 17245 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 17246 | const gchar* _tmp143_; |
| 17247 | BalaCCodeIdentifier* _tmp144_; |
| 17248 | BalaCCodeIdentifier* _tmp145_; |
| 17249 | BalaCCodeFunctionCall* _tmp146_; |
| 17250 | BalaCCodeFunctionCall* _tmp147_; |
| 17251 | BalaCCodeFunctionCall* _tmp148_; |
| 17252 | BalaCCodeExpression* _tmp149_; |
| 17253 | BalaCCodeFunctionCall* _tmp150_; |
| 17254 | BalaCCodeExpression* _tmp151_; |
| 17255 | BalaCCodeFunctionCall* _tmp152_; |
| 17256 | BalaCCodeUnaryExpression* _tmp153_; |
| 17257 | _tmp137_ = f; |
| 17258 | _tmp138_ = bala_variable_get_variable_type ((BalaVariable*) _tmp137_); |
| 17259 | _tmp139_ = _tmp138_; |
| 17260 | _tmp140_ = bala_data_type_get_type_symbol (_tmp139_); |
| 17261 | _tmp141_ = _tmp140_; |
| 17262 | _tmp142_ = bala_ccode_base_module_generate_struct_equal_function (self, G_TYPE_CHECK_INSTANCE_TYPE (_tmp141_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp141_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp141_) : NULL((void*)0)); |
| 17263 | equalfunc = _tmp142_; |
| 17264 | _tmp143_ = equalfunc; |
| 17265 | _tmp144_ = bala_ccode_identifier_new (_tmp143_); |
| 17266 | _tmp145_ = _tmp144_; |
| 17267 | _tmp146_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp145_); |
| 17268 | _tmp147_ = _tmp146_; |
| 17269 | _bala_ccode_node_unref0 (_tmp145_)((_tmp145_ == ((void*)0)) ? ((void*)0) : (_tmp145_ = (bala_ccode_node_unref (_tmp145_), ((void*)0)))); |
| 17270 | ccall = _tmp147_; |
| 17271 | _tmp148_ = ccall; |
| 17272 | _tmp149_ = s1; |
| 17273 | bala_ccode_function_call_add_argument (_tmp148_, _tmp149_); |
| 17274 | _tmp150_ = ccall; |
| 17275 | _tmp151_ = s2; |
| 17276 | bala_ccode_function_call_add_argument (_tmp150_, _tmp151_); |
| 17277 | _tmp152_ = ccall; |
| 17278 | _tmp153_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_LOGICAL_NEGATION, (BalaCCodeExpression*) _tmp152_); |
| 17279 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 17280 | cexp = (BalaCCodeExpression*) _tmp153_; |
| 17281 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 17282 | _g_free0 (equalfunc)(equalfunc = (g_free (equalfunc), ((void*)0))); |
| 17283 | } else { |
| 17284 | BalaCCodeExpression* _tmp154_; |
| 17285 | BalaCCodeExpression* _tmp155_; |
| 17286 | BalaCCodeBinaryExpression* _tmp156_; |
| 17287 | _tmp154_ = s1; |
| 17288 | _tmp155_ = s2; |
| 17289 | _tmp156_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_INEQUALITY, _tmp154_, _tmp155_); |
| 17290 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 17291 | cexp = (BalaCCodeExpression*) _tmp156_; |
| 17292 | } |
| 17293 | } |
| 17294 | _tmp157_ = bala_ccode_base_module_get_ccode (self); |
| 17295 | _tmp158_ = _tmp157_; |
| 17296 | _tmp159_ = cexp; |
| 17297 | bala_ccode_function_open_if (_tmp158_, _tmp159_); |
| 17298 | _tmp160_ = bala_ccode_base_module_get_ccode (self); |
| 17299 | _tmp161_ = _tmp160_; |
| 17300 | _tmp162_ = bala_ccode_base_module_get_boolean_cconstant (self, FALSE(0)); |
| 17301 | _tmp163_ = _tmp162_; |
| 17302 | bala_ccode_function_add_return (_tmp161_, _tmp163_); |
| 17303 | _bala_ccode_node_unref0 (_tmp163_)((_tmp163_ == ((void*)0)) ? ((void*)0) : (_tmp163_ = (bala_ccode_node_unref (_tmp163_), ((void*)0)))); |
| 17304 | _tmp164_ = bala_ccode_base_module_get_ccode (self); |
| 17305 | _tmp165_ = _tmp164_; |
| 17306 | bala_ccode_function_close (_tmp165_); |
| 17307 | _bala_code_node_unref0 (variable_type)((variable_type == ((void*)0)) ? ((void*)0) : (variable_type = (bala_code_node_unref (variable_type), ((void*)0)))); |
| 17308 | _bala_ccode_node_unref0 (s2)((s2 == ((void*)0)) ? ((void*)0) : (s2 = (bala_ccode_node_unref (s2), ((void*)0)))); |
| 17309 | _bala_ccode_node_unref0 (s1)((s1 == ((void*)0)) ? ((void*)0) : (s1 = (bala_ccode_node_unref (s1), ((void*)0)))); |
| 17310 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 17311 | _bala_code_node_unref0 (f)((f == ((void*)0)) ? ((void*)0) : (f = (bala_code_node_unref ( f), ((void*)0)))); |
| 17312 | } |
| 17313 | _bala_iterable_unref0 (_f_list)((_f_list == ((void*)0)) ? ((void*)0) : (_f_list = (bala_iterable_unref (_f_list), ((void*)0)))); |
| 17314 | } |
| 17315 | if (!has_instance_fields) { |
| 17316 | if (bala_struct_is_simple_type (st)) { |
| 17317 | BalaCCodeBinaryExpression* cexp = NULL((void*)0); |
| 17318 | BalaCCodeIdentifier* _tmp166_; |
| 17319 | BalaCCodeIdentifier* _tmp167_; |
| 17320 | BalaCCodeUnaryExpression* _tmp168_; |
| 17321 | BalaCCodeUnaryExpression* _tmp169_; |
| 17322 | BalaCCodeIdentifier* _tmp170_; |
| 17323 | BalaCCodeIdentifier* _tmp171_; |
| 17324 | BalaCCodeUnaryExpression* _tmp172_; |
| 17325 | BalaCCodeUnaryExpression* _tmp173_; |
| 17326 | BalaCCodeBinaryExpression* _tmp174_; |
| 17327 | BalaCCodeBinaryExpression* _tmp175_; |
| 17328 | BalaCCodeFunction* _tmp176_; |
| 17329 | BalaCCodeFunction* _tmp177_; |
| 17330 | BalaCCodeBinaryExpression* _tmp178_; |
| 17331 | _tmp166_ = bala_ccode_identifier_new ("s1"); |
| 17332 | _tmp167_ = _tmp166_; |
| 17333 | _tmp168_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, (BalaCCodeExpression*) _tmp167_); |
| 17334 | _tmp169_ = _tmp168_; |
| 17335 | _tmp170_ = bala_ccode_identifier_new ("s2"); |
| 17336 | _tmp171_ = _tmp170_; |
| 17337 | _tmp172_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, (BalaCCodeExpression*) _tmp171_); |
| 17338 | _tmp173_ = _tmp172_; |
| 17339 | _tmp174_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp169_, (BalaCCodeExpression*) _tmp173_); |
| 17340 | _tmp175_ = _tmp174_; |
| 17341 | _bala_ccode_node_unref0 (_tmp173_)((_tmp173_ == ((void*)0)) ? ((void*)0) : (_tmp173_ = (bala_ccode_node_unref (_tmp173_), ((void*)0)))); |
| 17342 | _bala_ccode_node_unref0 (_tmp171_)((_tmp171_ == ((void*)0)) ? ((void*)0) : (_tmp171_ = (bala_ccode_node_unref (_tmp171_), ((void*)0)))); |
| 17343 | _bala_ccode_node_unref0 (_tmp169_)((_tmp169_ == ((void*)0)) ? ((void*)0) : (_tmp169_ = (bala_ccode_node_unref (_tmp169_), ((void*)0)))); |
| 17344 | _bala_ccode_node_unref0 (_tmp167_)((_tmp167_ == ((void*)0)) ? ((void*)0) : (_tmp167_ = (bala_ccode_node_unref (_tmp167_), ((void*)0)))); |
| 17345 | cexp = _tmp175_; |
| 17346 | _tmp176_ = bala_ccode_base_module_get_ccode (self); |
| 17347 | _tmp177_ = _tmp176_; |
| 17348 | _tmp178_ = cexp; |
| 17349 | bala_ccode_function_add_return (_tmp177_, (BalaCCodeExpression*) _tmp178_); |
| 17350 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 17351 | } else { |
| 17352 | BalaCCodeFunction* _tmp179_; |
| 17353 | BalaCCodeFunction* _tmp180_; |
| 17354 | BalaCCodeExpression* _tmp181_; |
| 17355 | BalaCCodeExpression* _tmp182_; |
| 17356 | _tmp179_ = bala_ccode_base_module_get_ccode (self); |
| 17357 | _tmp180_ = _tmp179_; |
| 17358 | _tmp181_ = bala_ccode_base_module_get_boolean_cconstant (self, FALSE(0)); |
| 17359 | _tmp182_ = _tmp181_; |
| 17360 | bala_ccode_function_add_return (_tmp180_, _tmp182_); |
| 17361 | _bala_ccode_node_unref0 (_tmp182_)((_tmp182_ == ((void*)0)) ? ((void*)0) : (_tmp182_ = (bala_ccode_node_unref (_tmp182_), ((void*)0)))); |
| 17362 | } |
| 17363 | } else { |
| 17364 | BalaCCodeFunction* _tmp183_; |
| 17365 | BalaCCodeFunction* _tmp184_; |
| 17366 | BalaCCodeExpression* _tmp185_; |
| 17367 | BalaCCodeExpression* _tmp186_; |
| 17368 | _tmp183_ = bala_ccode_base_module_get_ccode (self); |
| 17369 | _tmp184_ = _tmp183_; |
| 17370 | _tmp185_ = bala_ccode_base_module_get_boolean_cconstant (self, TRUE(!(0))); |
| 17371 | _tmp186_ = _tmp185_; |
| 17372 | bala_ccode_function_add_return (_tmp184_, _tmp186_); |
| 17373 | _bala_ccode_node_unref0 (_tmp186_)((_tmp186_ == ((void*)0)) ? ((void*)0) : (_tmp186_ = (bala_ccode_node_unref (_tmp186_), ((void*)0)))); |
| 17374 | } |
| 17375 | bala_ccode_base_module_pop_function (self); |
| 17376 | _tmp187_ = self->cfile; |
| 17377 | _tmp188_ = function; |
| 17378 | bala_ccode_file_add_function_declaration (_tmp187_, _tmp188_); |
| 17379 | _tmp189_ = self->cfile; |
| 17380 | _tmp190_ = function; |
| 17381 | bala_ccode_file_add_function (_tmp189_, _tmp190_); |
| 17382 | result = equal_func; |
| 17383 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 17384 | return result; |
| 17385 | } |
| 17386 | |
| 17387 | static gchar* |
| 17388 | bala_ccode_base_module_generate_numeric_equal_function (BalaCCodeBaseModule* self, |
| 17389 | BalaTypeSymbol* sym) |
| 17390 | { |
| 17391 | gchar* equal_func = NULL((void*)0); |
| 17392 | gchar* _tmp0_; |
| 17393 | gchar* _tmp1_; |
| 17394 | gchar* _tmp2_; |
| 17395 | gchar* _tmp3_; |
| 17396 | const gchar* _tmp4_; |
| 17397 | BalaCCodeFunction* function = NULL((void*)0); |
| 17398 | const gchar* _tmp5_; |
| 17399 | BalaDataType* _tmp6_; |
| 17400 | gchar* _tmp7_; |
| 17401 | gchar* _tmp8_; |
| 17402 | BalaCCodeFunction* _tmp9_; |
| 17403 | BalaCCodeFunction* _tmp10_; |
| 17404 | BalaCCodeFunction* _tmp11_; |
| 17405 | BalaCCodeFunction* _tmp12_; |
| 17406 | gchar* _tmp13_; |
| 17407 | gchar* _tmp14_; |
| 17408 | gchar* _tmp15_; |
| 17409 | gchar* _tmp16_; |
| 17410 | BalaCCodeParameter* _tmp17_; |
| 17411 | BalaCCodeParameter* _tmp18_; |
| 17412 | BalaCCodeFunction* _tmp19_; |
| 17413 | gchar* _tmp20_; |
| 17414 | gchar* _tmp21_; |
| 17415 | gchar* _tmp22_; |
| 17416 | gchar* _tmp23_; |
| 17417 | BalaCCodeParameter* _tmp24_; |
| 17418 | BalaCCodeParameter* _tmp25_; |
| 17419 | BalaCCodeFunction* _tmp26_; |
| 17420 | BalaCCodeFile* _tmp84_; |
| 17421 | BalaCCodeFunction* _tmp85_; |
| 17422 | BalaCCodeFile* _tmp86_; |
| 17423 | BalaCCodeFunction* _tmp87_; |
| 17424 | gchar* result = NULL((void*)0); |
| 17425 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 17426 | g_return_val_if_fail (sym != NULL, NULL)do { if ((sym != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "sym != NULL") ; return (((void*)0)); } } while (0); |
| 17427 | _tmp0_ = bala_get_ccode_lower_case_prefix ((BalaSymbol*) sym); |
| 17428 | _tmp1_ = _tmp0_; |
| 17429 | _tmp2_ = g_strdup_printf ("_%sequal", _tmp1_); |
| 17430 | _tmp3_ = _tmp2_; |
| 17431 | _g_free0 (_tmp1_)(_tmp1_ = (g_free (_tmp1_), ((void*)0))); |
| 17432 | equal_func = _tmp3_; |
| 17433 | _tmp4_ = equal_func; |
| 17434 | if (!bala_ccode_base_module_add_wrapper (self, _tmp4_)) { |
| 17435 | result = equal_func; |
| 17436 | return result; |
| 17437 | } |
| 17438 | _tmp5_ = equal_func; |
| 17439 | _tmp6_ = self->bool_type; |
| 17440 | _tmp7_ = bala_get_ccode_name ((BalaCodeNode*) _tmp6_); |
| 17441 | _tmp8_ = _tmp7_; |
| 17442 | _tmp9_ = bala_ccode_function_new (_tmp5_, _tmp8_); |
| 17443 | _tmp10_ = _tmp9_; |
| 17444 | _g_free0 (_tmp8_)(_tmp8_ = (g_free (_tmp8_), ((void*)0))); |
| 17445 | function = _tmp10_; |
| 17446 | _tmp11_ = function; |
| 17447 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp11_, BALA_CCODE_MODIFIERS_STATIC); |
| 17448 | _tmp12_ = function; |
| 17449 | _tmp13_ = bala_get_ccode_name ((BalaCodeNode*) sym); |
| 17450 | _tmp14_ = _tmp13_; |
| 17451 | _tmp15_ = g_strdup_printf ("const %s *", _tmp14_); |
| 17452 | _tmp16_ = _tmp15_; |
| 17453 | _tmp17_ = bala_ccode_parameter_new ("s1", _tmp16_); |
| 17454 | _tmp18_ = _tmp17_; |
| 17455 | bala_ccode_function_add_parameter (_tmp12_, _tmp18_); |
| 17456 | _bala_ccode_node_unref0 (_tmp18_)((_tmp18_ == ((void*)0)) ? ((void*)0) : (_tmp18_ = (bala_ccode_node_unref (_tmp18_), ((void*)0)))); |
| 17457 | _g_free0 (_tmp16_)(_tmp16_ = (g_free (_tmp16_), ((void*)0))); |
| 17458 | _g_free0 (_tmp14_)(_tmp14_ = (g_free (_tmp14_), ((void*)0))); |
| 17459 | _tmp19_ = function; |
| 17460 | _tmp20_ = bala_get_ccode_name ((BalaCodeNode*) sym); |
| 17461 | _tmp21_ = _tmp20_; |
| 17462 | _tmp22_ = g_strdup_printf ("const %s *", _tmp21_); |
| 17463 | _tmp23_ = _tmp22_; |
| 17464 | _tmp24_ = bala_ccode_parameter_new ("s2", _tmp23_); |
| 17465 | _tmp25_ = _tmp24_; |
| 17466 | bala_ccode_function_add_parameter (_tmp19_, _tmp25_); |
| 17467 | _bala_ccode_node_unref0 (_tmp25_)((_tmp25_ == ((void*)0)) ? ((void*)0) : (_tmp25_ = (bala_ccode_node_unref (_tmp25_), ((void*)0)))); |
| 17468 | _g_free0 (_tmp23_)(_tmp23_ = (g_free (_tmp23_), ((void*)0))); |
| 17469 | _g_free0 (_tmp21_)(_tmp21_ = (g_free (_tmp21_), ((void*)0))); |
| 17470 | _tmp26_ = function; |
| 17471 | bala_ccode_base_module_push_function (self, _tmp26_); |
| 17472 | { |
| 17473 | BalaCCodeBinaryExpression* cexp = NULL((void*)0); |
| 17474 | BalaCCodeIdentifier* _tmp27_; |
| 17475 | BalaCCodeIdentifier* _tmp28_; |
| 17476 | BalaCCodeIdentifier* _tmp29_; |
| 17477 | BalaCCodeIdentifier* _tmp30_; |
| 17478 | BalaCCodeBinaryExpression* _tmp31_; |
| 17479 | BalaCCodeBinaryExpression* _tmp32_; |
| 17480 | BalaCCodeFunction* _tmp33_; |
| 17481 | BalaCCodeFunction* _tmp34_; |
| 17482 | BalaCCodeBinaryExpression* _tmp35_; |
| 17483 | BalaCCodeFunction* _tmp36_; |
| 17484 | BalaCCodeFunction* _tmp37_; |
| 17485 | BalaCCodeExpression* _tmp38_; |
| 17486 | BalaCCodeExpression* _tmp39_; |
| 17487 | BalaCCodeFunction* _tmp40_; |
| 17488 | BalaCCodeFunction* _tmp41_; |
| 17489 | _tmp27_ = bala_ccode_identifier_new ("s1"); |
| 17490 | _tmp28_ = _tmp27_; |
| 17491 | _tmp29_ = bala_ccode_identifier_new ("s2"); |
| 17492 | _tmp30_ = _tmp29_; |
| 17493 | _tmp31_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp28_, (BalaCCodeExpression*) _tmp30_); |
| 17494 | _tmp32_ = _tmp31_; |
| 17495 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 17496 | _bala_ccode_node_unref0 (_tmp28_)((_tmp28_ == ((void*)0)) ? ((void*)0) : (_tmp28_ = (bala_ccode_node_unref (_tmp28_), ((void*)0)))); |
| 17497 | cexp = _tmp32_; |
| 17498 | _tmp33_ = bala_ccode_base_module_get_ccode (self); |
| 17499 | _tmp34_ = _tmp33_; |
| 17500 | _tmp35_ = cexp; |
| 17501 | bala_ccode_function_open_if (_tmp34_, (BalaCCodeExpression*) _tmp35_); |
| 17502 | _tmp36_ = bala_ccode_base_module_get_ccode (self); |
| 17503 | _tmp37_ = _tmp36_; |
| 17504 | _tmp38_ = bala_ccode_base_module_get_boolean_cconstant (self, TRUE(!(0))); |
| 17505 | _tmp39_ = _tmp38_; |
| 17506 | bala_ccode_function_add_return (_tmp37_, _tmp39_); |
| 17507 | _bala_ccode_node_unref0 (_tmp39_)((_tmp39_ == ((void*)0)) ? ((void*)0) : (_tmp39_ = (bala_ccode_node_unref (_tmp39_), ((void*)0)))); |
| 17508 | _tmp40_ = bala_ccode_base_module_get_ccode (self); |
| 17509 | _tmp41_ = _tmp40_; |
| 17510 | bala_ccode_function_close (_tmp41_); |
| 17511 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 17512 | } |
| 17513 | { |
| 17514 | BalaCCodeBinaryExpression* cexp = NULL((void*)0); |
| 17515 | BalaCCodeIdentifier* _tmp42_; |
| 17516 | BalaCCodeIdentifier* _tmp43_; |
| 17517 | BalaCCodeConstant* _tmp44_; |
| 17518 | BalaCCodeConstant* _tmp45_; |
| 17519 | BalaCCodeBinaryExpression* _tmp46_; |
| 17520 | BalaCCodeBinaryExpression* _tmp47_; |
| 17521 | BalaCCodeFunction* _tmp48_; |
| 17522 | BalaCCodeFunction* _tmp49_; |
| 17523 | BalaCCodeBinaryExpression* _tmp50_; |
| 17524 | BalaCCodeFunction* _tmp51_; |
| 17525 | BalaCCodeFunction* _tmp52_; |
| 17526 | BalaCCodeExpression* _tmp53_; |
| 17527 | BalaCCodeExpression* _tmp54_; |
| 17528 | BalaCCodeFunction* _tmp55_; |
| 17529 | BalaCCodeFunction* _tmp56_; |
| 17530 | BalaCCodeIdentifier* _tmp57_; |
| 17531 | BalaCCodeIdentifier* _tmp58_; |
| 17532 | BalaCCodeConstant* _tmp59_; |
| 17533 | BalaCCodeConstant* _tmp60_; |
| 17534 | BalaCCodeBinaryExpression* _tmp61_; |
| 17535 | BalaCCodeFunction* _tmp62_; |
| 17536 | BalaCCodeFunction* _tmp63_; |
| 17537 | BalaCCodeBinaryExpression* _tmp64_; |
| 17538 | BalaCCodeFunction* _tmp65_; |
| 17539 | BalaCCodeFunction* _tmp66_; |
| 17540 | BalaCCodeExpression* _tmp67_; |
| 17541 | BalaCCodeExpression* _tmp68_; |
| 17542 | BalaCCodeFunction* _tmp69_; |
| 17543 | BalaCCodeFunction* _tmp70_; |
| 17544 | _tmp42_ = bala_ccode_identifier_new ("s1"); |
| 17545 | _tmp43_ = _tmp42_; |
| 17546 | _tmp44_ = bala_ccode_constant_new ("NULL"); |
| 17547 | _tmp45_ = _tmp44_; |
| 17548 | _tmp46_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp43_, (BalaCCodeExpression*) _tmp45_); |
| 17549 | _tmp47_ = _tmp46_; |
| 17550 | _bala_ccode_node_unref0 (_tmp45_)((_tmp45_ == ((void*)0)) ? ((void*)0) : (_tmp45_ = (bala_ccode_node_unref (_tmp45_), ((void*)0)))); |
| 17551 | _bala_ccode_node_unref0 (_tmp43_)((_tmp43_ == ((void*)0)) ? ((void*)0) : (_tmp43_ = (bala_ccode_node_unref (_tmp43_), ((void*)0)))); |
| 17552 | cexp = _tmp47_; |
| 17553 | _tmp48_ = bala_ccode_base_module_get_ccode (self); |
| 17554 | _tmp49_ = _tmp48_; |
| 17555 | _tmp50_ = cexp; |
| 17556 | bala_ccode_function_open_if (_tmp49_, (BalaCCodeExpression*) _tmp50_); |
| 17557 | _tmp51_ = bala_ccode_base_module_get_ccode (self); |
| 17558 | _tmp52_ = _tmp51_; |
| 17559 | _tmp53_ = bala_ccode_base_module_get_boolean_cconstant (self, FALSE(0)); |
| 17560 | _tmp54_ = _tmp53_; |
| 17561 | bala_ccode_function_add_return (_tmp52_, _tmp54_); |
| 17562 | _bala_ccode_node_unref0 (_tmp54_)((_tmp54_ == ((void*)0)) ? ((void*)0) : (_tmp54_ = (bala_ccode_node_unref (_tmp54_), ((void*)0)))); |
| 17563 | _tmp55_ = bala_ccode_base_module_get_ccode (self); |
| 17564 | _tmp56_ = _tmp55_; |
| 17565 | bala_ccode_function_close (_tmp56_); |
| 17566 | _tmp57_ = bala_ccode_identifier_new ("s2"); |
| 17567 | _tmp58_ = _tmp57_; |
| 17568 | _tmp59_ = bala_ccode_constant_new ("NULL"); |
| 17569 | _tmp60_ = _tmp59_; |
| 17570 | _tmp61_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp58_, (BalaCCodeExpression*) _tmp60_); |
| 17571 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 17572 | cexp = _tmp61_; |
| 17573 | _bala_ccode_node_unref0 (_tmp60_)((_tmp60_ == ((void*)0)) ? ((void*)0) : (_tmp60_ = (bala_ccode_node_unref (_tmp60_), ((void*)0)))); |
| 17574 | _bala_ccode_node_unref0 (_tmp58_)((_tmp58_ == ((void*)0)) ? ((void*)0) : (_tmp58_ = (bala_ccode_node_unref (_tmp58_), ((void*)0)))); |
| 17575 | _tmp62_ = bala_ccode_base_module_get_ccode (self); |
| 17576 | _tmp63_ = _tmp62_; |
| 17577 | _tmp64_ = cexp; |
| 17578 | bala_ccode_function_open_if (_tmp63_, (BalaCCodeExpression*) _tmp64_); |
| 17579 | _tmp65_ = bala_ccode_base_module_get_ccode (self); |
| 17580 | _tmp66_ = _tmp65_; |
| 17581 | _tmp67_ = bala_ccode_base_module_get_boolean_cconstant (self, FALSE(0)); |
| 17582 | _tmp68_ = _tmp67_; |
| 17583 | bala_ccode_function_add_return (_tmp66_, _tmp68_); |
| 17584 | _bala_ccode_node_unref0 (_tmp68_)((_tmp68_ == ((void*)0)) ? ((void*)0) : (_tmp68_ = (bala_ccode_node_unref (_tmp68_), ((void*)0)))); |
| 17585 | _tmp69_ = bala_ccode_base_module_get_ccode (self); |
| 17586 | _tmp70_ = _tmp69_; |
| 17587 | bala_ccode_function_close (_tmp70_); |
| 17588 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 17589 | } |
| 17590 | { |
| 17591 | BalaCCodeBinaryExpression* cexp = NULL((void*)0); |
| 17592 | BalaCCodeIdentifier* _tmp71_; |
| 17593 | BalaCCodeIdentifier* _tmp72_; |
| 17594 | BalaCCodeUnaryExpression* _tmp73_; |
| 17595 | BalaCCodeUnaryExpression* _tmp74_; |
| 17596 | BalaCCodeIdentifier* _tmp75_; |
| 17597 | BalaCCodeIdentifier* _tmp76_; |
| 17598 | BalaCCodeUnaryExpression* _tmp77_; |
| 17599 | BalaCCodeUnaryExpression* _tmp78_; |
| 17600 | BalaCCodeBinaryExpression* _tmp79_; |
| 17601 | BalaCCodeBinaryExpression* _tmp80_; |
| 17602 | BalaCCodeFunction* _tmp81_; |
| 17603 | BalaCCodeFunction* _tmp82_; |
| 17604 | BalaCCodeBinaryExpression* _tmp83_; |
| 17605 | _tmp71_ = bala_ccode_identifier_new ("s1"); |
| 17606 | _tmp72_ = _tmp71_; |
| 17607 | _tmp73_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, (BalaCCodeExpression*) _tmp72_); |
| 17608 | _tmp74_ = _tmp73_; |
| 17609 | _tmp75_ = bala_ccode_identifier_new ("s2"); |
| 17610 | _tmp76_ = _tmp75_; |
| 17611 | _tmp77_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, (BalaCCodeExpression*) _tmp76_); |
| 17612 | _tmp78_ = _tmp77_; |
| 17613 | _tmp79_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp74_, (BalaCCodeExpression*) _tmp78_); |
| 17614 | _tmp80_ = _tmp79_; |
| 17615 | _bala_ccode_node_unref0 (_tmp78_)((_tmp78_ == ((void*)0)) ? ((void*)0) : (_tmp78_ = (bala_ccode_node_unref (_tmp78_), ((void*)0)))); |
| 17616 | _bala_ccode_node_unref0 (_tmp76_)((_tmp76_ == ((void*)0)) ? ((void*)0) : (_tmp76_ = (bala_ccode_node_unref (_tmp76_), ((void*)0)))); |
| 17617 | _bala_ccode_node_unref0 (_tmp74_)((_tmp74_ == ((void*)0)) ? ((void*)0) : (_tmp74_ = (bala_ccode_node_unref (_tmp74_), ((void*)0)))); |
| 17618 | _bala_ccode_node_unref0 (_tmp72_)((_tmp72_ == ((void*)0)) ? ((void*)0) : (_tmp72_ = (bala_ccode_node_unref (_tmp72_), ((void*)0)))); |
| 17619 | cexp = _tmp80_; |
| 17620 | _tmp81_ = bala_ccode_base_module_get_ccode (self); |
| 17621 | _tmp82_ = _tmp81_; |
| 17622 | _tmp83_ = cexp; |
| 17623 | bala_ccode_function_add_return (_tmp82_, (BalaCCodeExpression*) _tmp83_); |
| 17624 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 17625 | } |
| 17626 | bala_ccode_base_module_pop_function (self); |
| 17627 | _tmp84_ = self->cfile; |
| 17628 | _tmp85_ = function; |
| 17629 | bala_ccode_file_add_function_declaration (_tmp84_, _tmp85_); |
| 17630 | _tmp86_ = self->cfile; |
| 17631 | _tmp87_ = function; |
| 17632 | bala_ccode_file_add_function (_tmp86_, _tmp87_); |
| 17633 | result = equal_func; |
| 17634 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 17635 | return result; |
| 17636 | } |
| 17637 | |
| 17638 | static gchar* |
| 17639 | bala_ccode_base_module_generate_struct_dup_wrapper (BalaCCodeBaseModule* self, |
| 17640 | BalaValueType* value_type) |
| 17641 | { |
| 17642 | gchar* dup_func = NULL((void*)0); |
| 17643 | BalaTypeSymbol* _tmp0_; |
| 17644 | BalaTypeSymbol* _tmp1_; |
| 17645 | gchar* _tmp2_; |
| 17646 | gchar* _tmp3_; |
| 17647 | gchar* _tmp4_; |
| 17648 | gchar* _tmp5_; |
| 17649 | const gchar* _tmp6_; |
| 17650 | BalaCCodeFunction* function = NULL((void*)0); |
| 17651 | const gchar* _tmp7_; |
| 17652 | gchar* _tmp8_; |
| 17653 | gchar* _tmp9_; |
| 17654 | BalaCCodeFunction* _tmp10_; |
| 17655 | BalaCCodeFunction* _tmp11_; |
| 17656 | BalaCCodeFunction* _tmp12_; |
| 17657 | BalaCCodeFunction* _tmp13_; |
| 17658 | gchar* _tmp14_; |
| 17659 | gchar* _tmp15_; |
| 17660 | BalaCCodeParameter* _tmp16_; |
| 17661 | BalaCCodeParameter* _tmp17_; |
| 17662 | BalaCCodeFunction* _tmp18_; |
| 17663 | BalaTypeSymbol* _tmp19_; |
| 17664 | BalaTypeSymbol* _tmp20_; |
| 17665 | BalaStruct* _tmp21_; |
| 17666 | BalaCCodeFile* _tmp138_; |
| 17667 | BalaCCodeFunction* _tmp139_; |
| 17668 | BalaCCodeFile* _tmp140_; |
| 17669 | BalaCCodeFunction* _tmp141_; |
| 17670 | gchar* result = NULL((void*)0); |
| 17671 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 17672 | g_return_val_if_fail (value_type != NULL, NULL)do { if ((value_type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "value_type != NULL" ); return (((void*)0)); } } while (0); |
| 17673 | _tmp0_ = bala_data_type_get_type_symbol ((BalaDataType*) value_type); |
| 17674 | _tmp1_ = _tmp0_; |
| 17675 | _tmp2_ = bala_get_ccode_lower_case_prefix ((BalaSymbol*) _tmp1_); |
| 17676 | _tmp3_ = _tmp2_; |
| 17677 | _tmp4_ = g_strdup_printf ("_%sdup", _tmp3_); |
| 17678 | _tmp5_ = _tmp4_; |
| 17679 | _g_free0 (_tmp3_)(_tmp3_ = (g_free (_tmp3_), ((void*)0))); |
| 17680 | dup_func = _tmp5_; |
| 17681 | _tmp6_ = dup_func; |
| 17682 | if (!bala_ccode_base_module_add_wrapper (self, _tmp6_)) { |
| 17683 | result = dup_func; |
| 17684 | return result; |
| 17685 | } |
| 17686 | _tmp7_ = dup_func; |
| 17687 | _tmp8_ = bala_get_ccode_name ((BalaCodeNode*) value_type); |
| 17688 | _tmp9_ = _tmp8_; |
| 17689 | _tmp10_ = bala_ccode_function_new (_tmp7_, _tmp9_); |
| 17690 | _tmp11_ = _tmp10_; |
| 17691 | _g_free0 (_tmp9_)(_tmp9_ = (g_free (_tmp9_), ((void*)0))); |
| 17692 | function = _tmp11_; |
| 17693 | _tmp12_ = function; |
| 17694 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp12_, BALA_CCODE_MODIFIERS_STATIC); |
| 17695 | _tmp13_ = function; |
| 17696 | _tmp14_ = bala_get_ccode_name ((BalaCodeNode*) value_type); |
| 17697 | _tmp15_ = _tmp14_; |
| 17698 | _tmp16_ = bala_ccode_parameter_new ("self", _tmp15_); |
| 17699 | _tmp17_ = _tmp16_; |
| 17700 | bala_ccode_function_add_parameter (_tmp13_, _tmp17_); |
| 17701 | _bala_ccode_node_unref0 (_tmp17_)((_tmp17_ == ((void*)0)) ? ((void*)0) : (_tmp17_ = (bala_ccode_node_unref (_tmp17_), ((void*)0)))); |
| 17702 | _g_free0 (_tmp15_)(_tmp15_ = (g_free (_tmp15_), ((void*)0))); |
| 17703 | _tmp18_ = function; |
| 17704 | bala_ccode_base_module_push_function (self, _tmp18_); |
| 17705 | _tmp19_ = bala_data_type_get_type_symbol ((BalaDataType*) value_type); |
| 17706 | _tmp20_ = _tmp19_; |
| 17707 | _tmp21_ = self->gvalue_type; |
| 17708 | if (_tmp20_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp21_), ((bala_typesymbol_get_type ())))))) { |
| 17709 | BalaCCodeFunctionCall* dup_call = NULL((void*)0); |
| 17710 | BalaCCodeIdentifier* _tmp22_; |
| 17711 | BalaCCodeIdentifier* _tmp23_; |
| 17712 | BalaCCodeFunctionCall* _tmp24_; |
| 17713 | BalaCCodeFunctionCall* _tmp25_; |
| 17714 | BalaCCodeFunctionCall* _tmp26_; |
| 17715 | BalaCCodeIdentifier* _tmp27_; |
| 17716 | BalaCCodeIdentifier* _tmp28_; |
| 17717 | BalaCCodeFunctionCall* _tmp29_; |
| 17718 | BalaCCodeIdentifier* _tmp30_; |
| 17719 | BalaCCodeIdentifier* _tmp31_; |
| 17720 | BalaCCodeFunction* _tmp32_; |
| 17721 | BalaCCodeFunction* _tmp33_; |
| 17722 | BalaCCodeFunctionCall* _tmp34_; |
| 17723 | _tmp22_ = bala_ccode_identifier_new ("g_boxed_copy"); |
| 17724 | _tmp23_ = _tmp22_; |
| 17725 | _tmp24_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp23_); |
| 17726 | _tmp25_ = _tmp24_; |
| 17727 | _bala_ccode_node_unref0 (_tmp23_)((_tmp23_ == ((void*)0)) ? ((void*)0) : (_tmp23_ = (bala_ccode_node_unref (_tmp23_), ((void*)0)))); |
| 17728 | dup_call = _tmp25_; |
| 17729 | _tmp26_ = dup_call; |
| 17730 | _tmp27_ = bala_ccode_identifier_new ("G_TYPE_VALUE"); |
| 17731 | _tmp28_ = _tmp27_; |
| 17732 | bala_ccode_function_call_add_argument (_tmp26_, (BalaCCodeExpression*) _tmp28_); |
| 17733 | _bala_ccode_node_unref0 (_tmp28_)((_tmp28_ == ((void*)0)) ? ((void*)0) : (_tmp28_ = (bala_ccode_node_unref (_tmp28_), ((void*)0)))); |
| 17734 | _tmp29_ = dup_call; |
| 17735 | _tmp30_ = bala_ccode_identifier_new ("self"); |
| 17736 | _tmp31_ = _tmp30_; |
| 17737 | bala_ccode_function_call_add_argument (_tmp29_, (BalaCCodeExpression*) _tmp31_); |
| 17738 | _bala_ccode_node_unref0 (_tmp31_)((_tmp31_ == ((void*)0)) ? ((void*)0) : (_tmp31_ = (bala_ccode_node_unref (_tmp31_), ((void*)0)))); |
| 17739 | _tmp32_ = bala_ccode_base_module_get_ccode (self); |
| 17740 | _tmp33_ = _tmp32_; |
| 17741 | _tmp34_ = dup_call; |
| 17742 | bala_ccode_function_add_return (_tmp33_, (BalaCCodeExpression*) _tmp34_); |
| 17743 | _bala_ccode_node_unref0 (dup_call)((dup_call == ((void*)0)) ? ((void*)0) : (dup_call = (bala_ccode_node_unref (dup_call), ((void*)0)))); |
| 17744 | } else { |
| 17745 | BalaCCodeFunction* _tmp35_; |
| 17746 | BalaCCodeFunction* _tmp36_; |
| 17747 | gchar* _tmp37_; |
| 17748 | gchar* _tmp38_; |
| 17749 | BalaCCodeVariableDeclarator* _tmp39_; |
| 17750 | BalaCCodeVariableDeclarator* _tmp40_; |
| 17751 | BalaCCodeFunctionCall* creation_call = NULL((void*)0); |
| 17752 | BalaCodeContext* _tmp41_; |
| 17753 | BalaProfile _tmp42_; |
| 17754 | BalaProfile _tmp43_; |
| 17755 | BalaCCodeFunction* _tmp78_; |
| 17756 | BalaCCodeFunction* _tmp79_; |
| 17757 | BalaCCodeIdentifier* _tmp80_; |
| 17758 | BalaCCodeIdentifier* _tmp81_; |
| 17759 | BalaCCodeFunctionCall* _tmp82_; |
| 17760 | BalaStruct* st = NULL((void*)0); |
| 17761 | BalaTypeSymbol* _tmp83_; |
| 17762 | BalaTypeSymbol* _tmp84_; |
| 17763 | BalaStruct* _tmp85_; |
| 17764 | gboolean _tmp86_ = FALSE(0); |
| 17765 | BalaStruct* _tmp87_; |
| 17766 | BalaCCodeFunction* _tmp134_; |
| 17767 | BalaCCodeFunction* _tmp135_; |
| 17768 | BalaCCodeIdentifier* _tmp136_; |
| 17769 | BalaCCodeIdentifier* _tmp137_; |
| 17770 | _tmp35_ = bala_ccode_base_module_get_ccode (self); |
| 17771 | _tmp36_ = _tmp35_; |
| 17772 | _tmp37_ = bala_get_ccode_name ((BalaCodeNode*) value_type); |
| 17773 | _tmp38_ = _tmp37_; |
| 17774 | _tmp39_ = bala_ccode_variable_declarator_new ("dup", NULL((void*)0), NULL((void*)0)); |
| 17775 | _tmp40_ = _tmp39_; |
| 17776 | bala_ccode_function_add_declaration (_tmp36_, _tmp38_, (BalaCCodeDeclarator*) _tmp40_, 0); |
| 17777 | _bala_ccode_node_unref0 (_tmp40_)((_tmp40_ == ((void*)0)) ? ((void*)0) : (_tmp40_ = (bala_ccode_node_unref (_tmp40_), ((void*)0)))); |
| 17778 | _g_free0 (_tmp38_)(_tmp38_ = (g_free (_tmp38_), ((void*)0))); |
| 17779 | _tmp41_ = self->priv->_context; |
| 17780 | _tmp42_ = bala_code_context_get_profile (_tmp41_); |
| 17781 | _tmp43_ = _tmp42_; |
| 17782 | if (_tmp43_ == BALA_PROFILE_POSIX) { |
| 17783 | BalaCCodeFile* _tmp44_; |
| 17784 | BalaCCodeIdentifier* _tmp45_; |
| 17785 | BalaCCodeIdentifier* _tmp46_; |
| 17786 | BalaCCodeFunctionCall* _tmp47_; |
| 17787 | BalaCCodeFunctionCall* _tmp48_; |
| 17788 | BalaCCodeConstant* _tmp49_; |
| 17789 | BalaCCodeConstant* _tmp50_; |
| 17790 | BalaCCodeFunctionCall* csizeof = NULL((void*)0); |
| 17791 | BalaCCodeIdentifier* _tmp51_; |
| 17792 | BalaCCodeIdentifier* _tmp52_; |
| 17793 | BalaCCodeFunctionCall* _tmp53_; |
| 17794 | BalaCCodeFunctionCall* _tmp54_; |
| 17795 | BalaCCodeFunctionCall* _tmp55_; |
| 17796 | BalaTypeSymbol* _tmp56_; |
| 17797 | BalaTypeSymbol* _tmp57_; |
| 17798 | gchar* _tmp58_; |
| 17799 | gchar* _tmp59_; |
| 17800 | BalaCCodeIdentifier* _tmp60_; |
| 17801 | BalaCCodeIdentifier* _tmp61_; |
| 17802 | BalaCCodeFunctionCall* _tmp62_; |
| 17803 | BalaCCodeFunctionCall* _tmp63_; |
| 17804 | _tmp44_ = self->cfile; |
| 17805 | bala_ccode_file_add_include (_tmp44_, "stdlib.h", FALSE(0)); |
| 17806 | _tmp45_ = bala_ccode_identifier_new ("calloc"); |
| 17807 | _tmp46_ = _tmp45_; |
| 17808 | _tmp47_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp46_); |
| 17809 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 17810 | creation_call = _tmp47_; |
| 17811 | _bala_ccode_node_unref0 (_tmp46_)((_tmp46_ == ((void*)0)) ? ((void*)0) : (_tmp46_ = (bala_ccode_node_unref (_tmp46_), ((void*)0)))); |
| 17812 | _tmp48_ = creation_call; |
| 17813 | _tmp49_ = bala_ccode_constant_new ("1"); |
| 17814 | _tmp50_ = _tmp49_; |
| 17815 | bala_ccode_function_call_add_argument (_tmp48_, (BalaCCodeExpression*) _tmp50_); |
| 17816 | _bala_ccode_node_unref0 (_tmp50_)((_tmp50_ == ((void*)0)) ? ((void*)0) : (_tmp50_ = (bala_ccode_node_unref (_tmp50_), ((void*)0)))); |
| 17817 | _tmp51_ = bala_ccode_identifier_new ("sizeof"); |
| 17818 | _tmp52_ = _tmp51_; |
| 17819 | _tmp53_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp52_); |
| 17820 | _tmp54_ = _tmp53_; |
| 17821 | _bala_ccode_node_unref0 (_tmp52_)((_tmp52_ == ((void*)0)) ? ((void*)0) : (_tmp52_ = (bala_ccode_node_unref (_tmp52_), ((void*)0)))); |
| 17822 | csizeof = _tmp54_; |
| 17823 | _tmp55_ = csizeof; |
| 17824 | _tmp56_ = bala_data_type_get_type_symbol ((BalaDataType*) value_type); |
| 17825 | _tmp57_ = _tmp56_; |
| 17826 | _tmp58_ = bala_get_ccode_name ((BalaCodeNode*) _tmp57_); |
| 17827 | _tmp59_ = _tmp58_; |
| 17828 | _tmp60_ = bala_ccode_identifier_new (_tmp59_); |
| 17829 | _tmp61_ = _tmp60_; |
| 17830 | bala_ccode_function_call_add_argument (_tmp55_, (BalaCCodeExpression*) _tmp61_); |
| 17831 | _bala_ccode_node_unref0 (_tmp61_)((_tmp61_ == ((void*)0)) ? ((void*)0) : (_tmp61_ = (bala_ccode_node_unref (_tmp61_), ((void*)0)))); |
| 17832 | _g_free0 (_tmp59_)(_tmp59_ = (g_free (_tmp59_), ((void*)0))); |
| 17833 | _tmp62_ = creation_call; |
| 17834 | _tmp63_ = csizeof; |
| 17835 | bala_ccode_function_call_add_argument (_tmp62_, (BalaCCodeExpression*) _tmp63_); |
| 17836 | _bala_ccode_node_unref0 (csizeof)((csizeof == ((void*)0)) ? ((void*)0) : (csizeof = (bala_ccode_node_unref (csizeof), ((void*)0)))); |
| 17837 | } else { |
| 17838 | BalaCCodeFile* _tmp64_; |
| 17839 | BalaCCodeIdentifier* _tmp65_; |
| 17840 | BalaCCodeIdentifier* _tmp66_; |
| 17841 | BalaCCodeFunctionCall* _tmp67_; |
| 17842 | BalaCCodeFunctionCall* _tmp68_; |
| 17843 | BalaTypeSymbol* _tmp69_; |
| 17844 | BalaTypeSymbol* _tmp70_; |
| 17845 | gchar* _tmp71_; |
| 17846 | gchar* _tmp72_; |
| 17847 | BalaCCodeIdentifier* _tmp73_; |
| 17848 | BalaCCodeIdentifier* _tmp74_; |
| 17849 | BalaCCodeFunctionCall* _tmp75_; |
| 17850 | BalaCCodeConstant* _tmp76_; |
| 17851 | BalaCCodeConstant* _tmp77_; |
| 17852 | _tmp64_ = self->cfile; |
| 17853 | bala_ccode_file_add_include (_tmp64_, "glib.h", FALSE(0)); |
| 17854 | _tmp65_ = bala_ccode_identifier_new ("g_new0"); |
| 17855 | _tmp66_ = _tmp65_; |
| 17856 | _tmp67_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp66_); |
| 17857 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 17858 | creation_call = _tmp67_; |
| 17859 | _bala_ccode_node_unref0 (_tmp66_)((_tmp66_ == ((void*)0)) ? ((void*)0) : (_tmp66_ = (bala_ccode_node_unref (_tmp66_), ((void*)0)))); |
| 17860 | _tmp68_ = creation_call; |
| 17861 | _tmp69_ = bala_data_type_get_type_symbol ((BalaDataType*) value_type); |
| 17862 | _tmp70_ = _tmp69_; |
| 17863 | _tmp71_ = bala_get_ccode_name ((BalaCodeNode*) _tmp70_); |
| 17864 | _tmp72_ = _tmp71_; |
| 17865 | _tmp73_ = bala_ccode_identifier_new (_tmp72_); |
| 17866 | _tmp74_ = _tmp73_; |
| 17867 | bala_ccode_function_call_add_argument (_tmp68_, (BalaCCodeExpression*) _tmp74_); |
| 17868 | _bala_ccode_node_unref0 (_tmp74_)((_tmp74_ == ((void*)0)) ? ((void*)0) : (_tmp74_ = (bala_ccode_node_unref (_tmp74_), ((void*)0)))); |
| 17869 | _g_free0 (_tmp72_)(_tmp72_ = (g_free (_tmp72_), ((void*)0))); |
| 17870 | _tmp75_ = creation_call; |
| 17871 | _tmp76_ = bala_ccode_constant_new ("1"); |
| 17872 | _tmp77_ = _tmp76_; |
| 17873 | bala_ccode_function_call_add_argument (_tmp75_, (BalaCCodeExpression*) _tmp77_); |
| 17874 | _bala_ccode_node_unref0 (_tmp77_)((_tmp77_ == ((void*)0)) ? ((void*)0) : (_tmp77_ = (bala_ccode_node_unref (_tmp77_), ((void*)0)))); |
| 17875 | } |
| 17876 | _tmp78_ = bala_ccode_base_module_get_ccode (self); |
| 17877 | _tmp79_ = _tmp78_; |
| 17878 | _tmp80_ = bala_ccode_identifier_new ("dup"); |
| 17879 | _tmp81_ = _tmp80_; |
| 17880 | _tmp82_ = creation_call; |
| 17881 | bala_ccode_function_add_assignment (_tmp79_, (BalaCCodeExpression*) _tmp81_, (BalaCCodeExpression*) _tmp82_); |
| 17882 | _bala_ccode_node_unref0 (_tmp81_)((_tmp81_ == ((void*)0)) ? ((void*)0) : (_tmp81_ = (bala_ccode_node_unref (_tmp81_), ((void*)0)))); |
| 17883 | _tmp83_ = bala_data_type_get_type_symbol ((BalaDataType*) value_type); |
| 17884 | _tmp84_ = _tmp83_; |
| 17885 | _tmp85_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp84_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp84_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp84_) : NULL((void*)0)); |
| 17886 | st = _tmp85_; |
| 17887 | _tmp87_ = st; |
| 17888 | if (_tmp87_ != NULL((void*)0)) { |
| 17889 | BalaStruct* _tmp88_; |
| 17890 | _tmp88_ = st; |
| 17891 | _tmp86_ = bala_struct_is_disposable (_tmp88_); |
| 17892 | } else { |
| 17893 | _tmp86_ = FALSE(0); |
| 17894 | } |
| 17895 | if (_tmp86_) { |
| 17896 | BalaStruct* _tmp89_; |
| 17897 | BalaCCodeFunctionCall* copy_call = NULL((void*)0); |
| 17898 | BalaStruct* _tmp91_; |
| 17899 | gchar* _tmp92_; |
| 17900 | gchar* _tmp93_; |
| 17901 | BalaCCodeIdentifier* _tmp94_; |
| 17902 | BalaCCodeIdentifier* _tmp95_; |
| 17903 | BalaCCodeFunctionCall* _tmp96_; |
| 17904 | BalaCCodeFunctionCall* _tmp97_; |
| 17905 | BalaCCodeFunctionCall* _tmp98_; |
| 17906 | BalaCCodeIdentifier* _tmp99_; |
| 17907 | BalaCCodeIdentifier* _tmp100_; |
| 17908 | BalaCCodeFunctionCall* _tmp101_; |
| 17909 | BalaCCodeIdentifier* _tmp102_; |
| 17910 | BalaCCodeIdentifier* _tmp103_; |
| 17911 | BalaCCodeFunction* _tmp104_; |
| 17912 | BalaCCodeFunction* _tmp105_; |
| 17913 | BalaCCodeFunctionCall* _tmp106_; |
| 17914 | _tmp89_ = st; |
| 17915 | if (!bala_get_ccode_has_copy_function (_tmp89_)) { |
| 17916 | BalaStruct* _tmp90_; |
| 17917 | _tmp90_ = st; |
| 17918 | bala_ccode_base_module_generate_struct_copy_function (self, _tmp90_); |
| 17919 | } |
| 17920 | _tmp91_ = st; |
| 17921 | _tmp92_ = bala_get_ccode_copy_function ((BalaTypeSymbol*) _tmp91_); |
| 17922 | _tmp93_ = _tmp92_; |
| 17923 | _tmp94_ = bala_ccode_identifier_new (_tmp93_); |
| 17924 | _tmp95_ = _tmp94_; |
| 17925 | _tmp96_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp95_); |
| 17926 | _tmp97_ = _tmp96_; |
| 17927 | _bala_ccode_node_unref0 (_tmp95_)((_tmp95_ == ((void*)0)) ? ((void*)0) : (_tmp95_ = (bala_ccode_node_unref (_tmp95_), ((void*)0)))); |
| 17928 | _g_free0 (_tmp93_)(_tmp93_ = (g_free (_tmp93_), ((void*)0))); |
| 17929 | copy_call = _tmp97_; |
| 17930 | _tmp98_ = copy_call; |
| 17931 | _tmp99_ = bala_ccode_identifier_new ("self"); |
| 17932 | _tmp100_ = _tmp99_; |
| 17933 | bala_ccode_function_call_add_argument (_tmp98_, (BalaCCodeExpression*) _tmp100_); |
| 17934 | _bala_ccode_node_unref0 (_tmp100_)((_tmp100_ == ((void*)0)) ? ((void*)0) : (_tmp100_ = (bala_ccode_node_unref (_tmp100_), ((void*)0)))); |
| 17935 | _tmp101_ = copy_call; |
| 17936 | _tmp102_ = bala_ccode_identifier_new ("dup"); |
| 17937 | _tmp103_ = _tmp102_; |
| 17938 | bala_ccode_function_call_add_argument (_tmp101_, (BalaCCodeExpression*) _tmp103_); |
| 17939 | _bala_ccode_node_unref0 (_tmp103_)((_tmp103_ == ((void*)0)) ? ((void*)0) : (_tmp103_ = (bala_ccode_node_unref (_tmp103_), ((void*)0)))); |
| 17940 | _tmp104_ = bala_ccode_base_module_get_ccode (self); |
| 17941 | _tmp105_ = _tmp104_; |
| 17942 | _tmp106_ = copy_call; |
| 17943 | bala_ccode_function_add_expression (_tmp105_, (BalaCCodeExpression*) _tmp106_); |
| 17944 | _bala_ccode_node_unref0 (copy_call)((copy_call == ((void*)0)) ? ((void*)0) : (copy_call = (bala_ccode_node_unref (copy_call), ((void*)0)))); |
| 17945 | } else { |
| 17946 | BalaCCodeFile* _tmp107_; |
| 17947 | BalaCCodeFunctionCall* sizeof_call = NULL((void*)0); |
| 17948 | BalaCCodeIdentifier* _tmp108_; |
| 17949 | BalaCCodeIdentifier* _tmp109_; |
| 17950 | BalaCCodeFunctionCall* _tmp110_; |
| 17951 | BalaCCodeFunctionCall* _tmp111_; |
| 17952 | BalaCCodeFunctionCall* _tmp112_; |
| 17953 | BalaTypeSymbol* _tmp113_; |
| 17954 | BalaTypeSymbol* _tmp114_; |
| 17955 | gchar* _tmp115_; |
| 17956 | gchar* _tmp116_; |
| 17957 | BalaCCodeConstant* _tmp117_; |
| 17958 | BalaCCodeConstant* _tmp118_; |
| 17959 | BalaCCodeFunctionCall* copy_call = NULL((void*)0); |
| 17960 | BalaCCodeIdentifier* _tmp119_; |
| 17961 | BalaCCodeIdentifier* _tmp120_; |
| 17962 | BalaCCodeFunctionCall* _tmp121_; |
| 17963 | BalaCCodeFunctionCall* _tmp122_; |
| 17964 | BalaCCodeFunctionCall* _tmp123_; |
| 17965 | BalaCCodeIdentifier* _tmp124_; |
| 17966 | BalaCCodeIdentifier* _tmp125_; |
| 17967 | BalaCCodeFunctionCall* _tmp126_; |
| 17968 | BalaCCodeIdentifier* _tmp127_; |
| 17969 | BalaCCodeIdentifier* _tmp128_; |
| 17970 | BalaCCodeFunctionCall* _tmp129_; |
| 17971 | BalaCCodeFunctionCall* _tmp130_; |
| 17972 | BalaCCodeFunction* _tmp131_; |
| 17973 | BalaCCodeFunction* _tmp132_; |
| 17974 | BalaCCodeFunctionCall* _tmp133_; |
| 17975 | _tmp107_ = self->cfile; |
| 17976 | bala_ccode_file_add_include (_tmp107_, "string.h", FALSE(0)); |
| 17977 | _tmp108_ = bala_ccode_identifier_new ("sizeof"); |
| 17978 | _tmp109_ = _tmp108_; |
| 17979 | _tmp110_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp109_); |
| 17980 | _tmp111_ = _tmp110_; |
| 17981 | _bala_ccode_node_unref0 (_tmp109_)((_tmp109_ == ((void*)0)) ? ((void*)0) : (_tmp109_ = (bala_ccode_node_unref (_tmp109_), ((void*)0)))); |
| 17982 | sizeof_call = _tmp111_; |
| 17983 | _tmp112_ = sizeof_call; |
| 17984 | _tmp113_ = bala_data_type_get_type_symbol ((BalaDataType*) value_type); |
| 17985 | _tmp114_ = _tmp113_; |
| 17986 | _tmp115_ = bala_get_ccode_name ((BalaCodeNode*) _tmp114_); |
| 17987 | _tmp116_ = _tmp115_; |
| 17988 | _tmp117_ = bala_ccode_constant_new (_tmp116_); |
| 17989 | _tmp118_ = _tmp117_; |
| 17990 | bala_ccode_function_call_add_argument (_tmp112_, (BalaCCodeExpression*) _tmp118_); |
| 17991 | _bala_ccode_node_unref0 (_tmp118_)((_tmp118_ == ((void*)0)) ? ((void*)0) : (_tmp118_ = (bala_ccode_node_unref (_tmp118_), ((void*)0)))); |
| 17992 | _g_free0 (_tmp116_)(_tmp116_ = (g_free (_tmp116_), ((void*)0))); |
| 17993 | _tmp119_ = bala_ccode_identifier_new ("memcpy"); |
| 17994 | _tmp120_ = _tmp119_; |
| 17995 | _tmp121_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp120_); |
| 17996 | _tmp122_ = _tmp121_; |
| 17997 | _bala_ccode_node_unref0 (_tmp120_)((_tmp120_ == ((void*)0)) ? ((void*)0) : (_tmp120_ = (bala_ccode_node_unref (_tmp120_), ((void*)0)))); |
| 17998 | copy_call = _tmp122_; |
| 17999 | _tmp123_ = copy_call; |
| 18000 | _tmp124_ = bala_ccode_identifier_new ("dup"); |
| 18001 | _tmp125_ = _tmp124_; |
| 18002 | bala_ccode_function_call_add_argument (_tmp123_, (BalaCCodeExpression*) _tmp125_); |
| 18003 | _bala_ccode_node_unref0 (_tmp125_)((_tmp125_ == ((void*)0)) ? ((void*)0) : (_tmp125_ = (bala_ccode_node_unref (_tmp125_), ((void*)0)))); |
| 18004 | _tmp126_ = copy_call; |
| 18005 | _tmp127_ = bala_ccode_identifier_new ("self"); |
| 18006 | _tmp128_ = _tmp127_; |
| 18007 | bala_ccode_function_call_add_argument (_tmp126_, (BalaCCodeExpression*) _tmp128_); |
| 18008 | _bala_ccode_node_unref0 (_tmp128_)((_tmp128_ == ((void*)0)) ? ((void*)0) : (_tmp128_ = (bala_ccode_node_unref (_tmp128_), ((void*)0)))); |
| 18009 | _tmp129_ = copy_call; |
| 18010 | _tmp130_ = sizeof_call; |
| 18011 | bala_ccode_function_call_add_argument (_tmp129_, (BalaCCodeExpression*) _tmp130_); |
| 18012 | _tmp131_ = bala_ccode_base_module_get_ccode (self); |
| 18013 | _tmp132_ = _tmp131_; |
| 18014 | _tmp133_ = copy_call; |
| 18015 | bala_ccode_function_add_expression (_tmp132_, (BalaCCodeExpression*) _tmp133_); |
| 18016 | _bala_ccode_node_unref0 (copy_call)((copy_call == ((void*)0)) ? ((void*)0) : (copy_call = (bala_ccode_node_unref (copy_call), ((void*)0)))); |
| 18017 | _bala_ccode_node_unref0 (sizeof_call)((sizeof_call == ((void*)0)) ? ((void*)0) : (sizeof_call = (bala_ccode_node_unref (sizeof_call), ((void*)0)))); |
| 18018 | } |
| 18019 | _tmp134_ = bala_ccode_base_module_get_ccode (self); |
| 18020 | _tmp135_ = _tmp134_; |
| 18021 | _tmp136_ = bala_ccode_identifier_new ("dup"); |
| 18022 | _tmp137_ = _tmp136_; |
| 18023 | bala_ccode_function_add_return (_tmp135_, (BalaCCodeExpression*) _tmp137_); |
| 18024 | _bala_ccode_node_unref0 (_tmp137_)((_tmp137_ == ((void*)0)) ? ((void*)0) : (_tmp137_ = (bala_ccode_node_unref (_tmp137_), ((void*)0)))); |
| 18025 | _bala_code_node_unref0 (st)((st == ((void*)0)) ? ((void*)0) : (st = (bala_code_node_unref (st), ((void*)0)))); |
| 18026 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 18027 | } |
| 18028 | bala_ccode_base_module_pop_function (self); |
| 18029 | _tmp138_ = self->cfile; |
| 18030 | _tmp139_ = function; |
| 18031 | bala_ccode_file_add_function_declaration (_tmp138_, _tmp139_); |
| 18032 | _tmp140_ = self->cfile; |
| 18033 | _tmp141_ = function; |
| 18034 | bala_ccode_file_add_function (_tmp140_, _tmp141_); |
| 18035 | result = dup_func; |
| 18036 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 18037 | return result; |
| 18038 | } |
| 18039 | |
| 18040 | gchar* |
| 18041 | bala_ccode_base_module_generate_dup_func_wrapper (BalaCCodeBaseModule* self, |
| 18042 | BalaDataType* type) |
| 18043 | { |
| 18044 | gchar* destroy_func = NULL((void*)0); |
| 18045 | BalaTypeSymbol* _tmp0_; |
| 18046 | BalaTypeSymbol* _tmp1_; |
| 18047 | gchar* _tmp2_; |
| 18048 | gchar* _tmp3_; |
| 18049 | gchar* _tmp4_; |
| 18050 | gchar* _tmp5_; |
| 18051 | const gchar* _tmp6_; |
| 18052 | BalaCCodeFunction* function = NULL((void*)0); |
| 18053 | const gchar* _tmp7_; |
| 18054 | gchar* _tmp8_; |
| 18055 | gchar* _tmp9_; |
| 18056 | BalaCCodeFunction* _tmp10_; |
| 18057 | BalaCCodeFunction* _tmp11_; |
| 18058 | BalaCCodeFunction* _tmp12_; |
| 18059 | BalaCCodeFunction* _tmp13_; |
| 18060 | gchar* _tmp14_; |
| 18061 | gchar* _tmp15_; |
| 18062 | BalaCCodeParameter* _tmp16_; |
| 18063 | BalaCCodeParameter* _tmp17_; |
| 18064 | BalaCCodeFunction* _tmp18_; |
| 18065 | BalaCCodeFunctionCall* free_call = NULL((void*)0); |
| 18066 | BalaCCodeIdentifier* _tmp19_; |
| 18067 | BalaCCodeIdentifier* _tmp20_; |
| 18068 | BalaCCodeFunctionCall* _tmp21_; |
| 18069 | BalaCCodeFunctionCall* _tmp22_; |
| 18070 | BalaCCodeFunctionCall* _tmp23_; |
| 18071 | BalaTypeSymbol* _tmp24_; |
| 18072 | BalaTypeSymbol* _tmp25_; |
| 18073 | gchar* _tmp26_; |
| 18074 | gchar* _tmp27_; |
| 18075 | BalaCCodeIdentifier* _tmp28_; |
| 18076 | BalaCCodeIdentifier* _tmp29_; |
| 18077 | BalaCCodeFunctionCall* _tmp30_; |
| 18078 | BalaCCodeIdentifier* _tmp31_; |
| 18079 | BalaCCodeIdentifier* _tmp32_; |
| 18080 | BalaCCodeFunction* _tmp33_; |
| 18081 | BalaCCodeFunction* _tmp34_; |
| 18082 | BalaCCodeFunctionCall* _tmp35_; |
| 18083 | BalaCCodeFile* _tmp36_; |
| 18084 | BalaCCodeFunction* _tmp37_; |
| 18085 | BalaCCodeFile* _tmp38_; |
| 18086 | BalaCCodeFunction* _tmp39_; |
| 18087 | gchar* result = NULL((void*)0); |
| 18088 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 18089 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 18090 | _tmp0_ = bala_data_type_get_type_symbol (type); |
| 18091 | _tmp1_ = _tmp0_; |
| 18092 | _tmp2_ = bala_get_ccode_name ((BalaCodeNode*) _tmp1_); |
| 18093 | _tmp3_ = _tmp2_; |
| 18094 | _tmp4_ = g_strdup_printf ("_bala_%s_copy", _tmp3_); |
| 18095 | _tmp5_ = _tmp4_; |
| 18096 | _g_free0 (_tmp3_)(_tmp3_ = (g_free (_tmp3_), ((void*)0))); |
| 18097 | destroy_func = _tmp5_; |
| 18098 | _tmp6_ = destroy_func; |
| 18099 | if (!bala_ccode_base_module_add_wrapper (self, _tmp6_)) { |
| 18100 | result = destroy_func; |
| 18101 | return result; |
| 18102 | } |
| 18103 | _tmp7_ = destroy_func; |
| 18104 | _tmp8_ = bala_get_ccode_name ((BalaCodeNode*) type); |
| 18105 | _tmp9_ = _tmp8_; |
| 18106 | _tmp10_ = bala_ccode_function_new (_tmp7_, _tmp9_); |
| 18107 | _tmp11_ = _tmp10_; |
| 18108 | _g_free0 (_tmp9_)(_tmp9_ = (g_free (_tmp9_), ((void*)0))); |
| 18109 | function = _tmp11_; |
| 18110 | _tmp12_ = function; |
| 18111 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp12_, BALA_CCODE_MODIFIERS_STATIC); |
| 18112 | _tmp13_ = function; |
| 18113 | _tmp14_ = bala_get_ccode_name ((BalaCodeNode*) type); |
| 18114 | _tmp15_ = _tmp14_; |
| 18115 | _tmp16_ = bala_ccode_parameter_new ("self", _tmp15_); |
| 18116 | _tmp17_ = _tmp16_; |
| 18117 | bala_ccode_function_add_parameter (_tmp13_, _tmp17_); |
| 18118 | _bala_ccode_node_unref0 (_tmp17_)((_tmp17_ == ((void*)0)) ? ((void*)0) : (_tmp17_ = (bala_ccode_node_unref (_tmp17_), ((void*)0)))); |
| 18119 | _g_free0 (_tmp15_)(_tmp15_ = (g_free (_tmp15_), ((void*)0))); |
| 18120 | _tmp18_ = function; |
| 18121 | bala_ccode_base_module_push_function (self, _tmp18_); |
| 18122 | _tmp19_ = bala_ccode_identifier_new ("g_boxed_copy"); |
| 18123 | _tmp20_ = _tmp19_; |
| 18124 | _tmp21_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp20_); |
| 18125 | _tmp22_ = _tmp21_; |
| 18126 | _bala_ccode_node_unref0 (_tmp20_)((_tmp20_ == ((void*)0)) ? ((void*)0) : (_tmp20_ = (bala_ccode_node_unref (_tmp20_), ((void*)0)))); |
| 18127 | free_call = _tmp22_; |
| 18128 | _tmp23_ = free_call; |
| 18129 | _tmp24_ = bala_data_type_get_type_symbol (type); |
| 18130 | _tmp25_ = _tmp24_; |
| 18131 | _tmp26_ = bala_get_ccode_type_id ((BalaCodeNode*) _tmp25_); |
| 18132 | _tmp27_ = _tmp26_; |
| 18133 | _tmp28_ = bala_ccode_identifier_new (_tmp27_); |
| 18134 | _tmp29_ = _tmp28_; |
| 18135 | bala_ccode_function_call_add_argument (_tmp23_, (BalaCCodeExpression*) _tmp29_); |
| 18136 | _bala_ccode_node_unref0 (_tmp29_)((_tmp29_ == ((void*)0)) ? ((void*)0) : (_tmp29_ = (bala_ccode_node_unref (_tmp29_), ((void*)0)))); |
| 18137 | _g_free0 (_tmp27_)(_tmp27_ = (g_free (_tmp27_), ((void*)0))); |
| 18138 | _tmp30_ = free_call; |
| 18139 | _tmp31_ = bala_ccode_identifier_new ("self"); |
| 18140 | _tmp32_ = _tmp31_; |
| 18141 | bala_ccode_function_call_add_argument (_tmp30_, (BalaCCodeExpression*) _tmp32_); |
| 18142 | _bala_ccode_node_unref0 (_tmp32_)((_tmp32_ == ((void*)0)) ? ((void*)0) : (_tmp32_ = (bala_ccode_node_unref (_tmp32_), ((void*)0)))); |
| 18143 | _tmp33_ = bala_ccode_base_module_get_ccode (self); |
| 18144 | _tmp34_ = _tmp33_; |
| 18145 | _tmp35_ = free_call; |
| 18146 | bala_ccode_function_add_return (_tmp34_, (BalaCCodeExpression*) _tmp35_); |
| 18147 | bala_ccode_base_module_pop_function (self); |
| 18148 | _tmp36_ = self->cfile; |
| 18149 | _tmp37_ = function; |
| 18150 | bala_ccode_file_add_function_declaration (_tmp36_, _tmp37_); |
| 18151 | _tmp38_ = self->cfile; |
| 18152 | _tmp39_ = function; |
| 18153 | bala_ccode_file_add_function (_tmp38_, _tmp39_); |
| 18154 | result = destroy_func; |
| 18155 | _bala_ccode_node_unref0 (free_call)((free_call == ((void*)0)) ? ((void*)0) : (free_call = (bala_ccode_node_unref (free_call), ((void*)0)))); |
| 18156 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 18157 | return result; |
| 18158 | } |
| 18159 | |
| 18160 | gchar* |
| 18161 | bala_ccode_base_module_generate_free_function_address_of_wrapper (BalaCCodeBaseModule* self, |
| 18162 | BalaDataType* type) |
| 18163 | { |
| 18164 | gchar* destroy_func = NULL((void*)0); |
| 18165 | BalaTypeSymbol* _tmp0_; |
| 18166 | BalaTypeSymbol* _tmp1_; |
| 18167 | gchar* _tmp2_; |
| 18168 | gchar* _tmp3_; |
| 18169 | gchar* _tmp4_; |
| 18170 | gchar* _tmp5_; |
| 18171 | const gchar* _tmp6_; |
| 18172 | BalaCCodeFunction* function = NULL((void*)0); |
| 18173 | const gchar* _tmp7_; |
| 18174 | BalaCCodeFunction* _tmp8_; |
| 18175 | BalaCCodeFunction* _tmp9_; |
| 18176 | BalaCCodeFunction* _tmp10_; |
| 18177 | gchar* _tmp11_; |
| 18178 | gchar* _tmp12_; |
| 18179 | BalaCCodeParameter* _tmp13_; |
| 18180 | BalaCCodeParameter* _tmp14_; |
| 18181 | BalaCCodeFunction* _tmp15_; |
| 18182 | BalaClass* cl = NULL((void*)0); |
| 18183 | BalaTypeSymbol* _tmp16_; |
| 18184 | BalaTypeSymbol* _tmp17_; |
| 18185 | BalaClass* _tmp18_; |
| 18186 | BalaCCodeFunctionCall* free_call = NULL((void*)0); |
| 18187 | BalaClass* _tmp19_; |
| 18188 | gchar* _tmp20_; |
| 18189 | gchar* _tmp21_; |
| 18190 | BalaCCodeIdentifier* _tmp22_; |
| 18191 | BalaCCodeIdentifier* _tmp23_; |
| 18192 | BalaCCodeFunctionCall* _tmp24_; |
| 18193 | BalaCCodeFunctionCall* _tmp25_; |
| 18194 | BalaCCodeFunctionCall* _tmp26_; |
| 18195 | BalaCCodeIdentifier* _tmp27_; |
| 18196 | BalaCCodeIdentifier* _tmp28_; |
| 18197 | BalaCCodeUnaryExpression* _tmp29_; |
| 18198 | BalaCCodeUnaryExpression* _tmp30_; |
| 18199 | BalaCCodeFunction* _tmp31_; |
| 18200 | BalaCCodeFunction* _tmp32_; |
| 18201 | BalaCCodeFunctionCall* _tmp33_; |
| 18202 | BalaCCodeFile* _tmp34_; |
| 18203 | BalaCCodeFunction* _tmp35_; |
| 18204 | BalaCCodeFile* _tmp36_; |
| 18205 | BalaCCodeFunction* _tmp37_; |
| 18206 | gchar* result = NULL((void*)0); |
| 18207 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 18208 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 18209 | _tmp0_ = bala_data_type_get_type_symbol (type); |
| 18210 | _tmp1_ = _tmp0_; |
| 18211 | _tmp2_ = bala_get_ccode_name ((BalaCodeNode*) _tmp1_); |
| 18212 | _tmp3_ = _tmp2_; |
| 18213 | _tmp4_ = g_strdup_printf ("_bala_%s_free_function_address_of", _tmp3_); |
| 18214 | _tmp5_ = _tmp4_; |
| 18215 | _g_free0 (_tmp3_)(_tmp3_ = (g_free (_tmp3_), ((void*)0))); |
| 18216 | destroy_func = _tmp5_; |
| 18217 | _tmp6_ = destroy_func; |
| 18218 | if (!bala_ccode_base_module_add_wrapper (self, _tmp6_)) { |
| 18219 | result = destroy_func; |
| 18220 | return result; |
| 18221 | } |
| 18222 | _tmp7_ = destroy_func; |
| 18223 | _tmp8_ = bala_ccode_function_new (_tmp7_, "void"); |
| 18224 | function = _tmp8_; |
| 18225 | _tmp9_ = function; |
| 18226 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp9_, BALA_CCODE_MODIFIERS_STATIC); |
| 18227 | _tmp10_ = function; |
| 18228 | _tmp11_ = bala_get_ccode_name ((BalaCodeNode*) type); |
| 18229 | _tmp12_ = _tmp11_; |
| 18230 | _tmp13_ = bala_ccode_parameter_new ("self", _tmp12_); |
| 18231 | _tmp14_ = _tmp13_; |
| 18232 | bala_ccode_function_add_parameter (_tmp10_, _tmp14_); |
| 18233 | _bala_ccode_node_unref0 (_tmp14_)((_tmp14_ == ((void*)0)) ? ((void*)0) : (_tmp14_ = (bala_ccode_node_unref (_tmp14_), ((void*)0)))); |
| 18234 | _g_free0 (_tmp12_)(_tmp12_ = (g_free (_tmp12_), ((void*)0))); |
| 18235 | _tmp15_ = function; |
| 18236 | bala_ccode_base_module_push_function (self, _tmp15_); |
| 18237 | _tmp16_ = bala_data_type_get_type_symbol (type); |
| 18238 | _tmp17_ = _tmp16_; |
| 18239 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp17_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp17_) : NULL((void*)0); |
| 18240 | _tmp18_ = cl; |
| 18241 | _bala_assert (_tmp18_ != NULL, "cl != null")if (_tmp18_ != ((void*)0)) ; else g_assertion_message_expr ("bala-ccodegen" , "balaccodebasemodule.c", 18241, ((const char*) (__func__)), "cl != null");; |
| 18242 | _tmp19_ = cl; |
| 18243 | _tmp20_ = bala_get_ccode_free_function ((BalaTypeSymbol*) _tmp19_); |
| 18244 | _tmp21_ = _tmp20_; |
| 18245 | _tmp22_ = bala_ccode_identifier_new (_tmp21_); |
| 18246 | _tmp23_ = _tmp22_; |
| 18247 | _tmp24_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp23_); |
| 18248 | _tmp25_ = _tmp24_; |
| 18249 | _bala_ccode_node_unref0 (_tmp23_)((_tmp23_ == ((void*)0)) ? ((void*)0) : (_tmp23_ = (bala_ccode_node_unref (_tmp23_), ((void*)0)))); |
| 18250 | _g_free0 (_tmp21_)(_tmp21_ = (g_free (_tmp21_), ((void*)0))); |
| 18251 | free_call = _tmp25_; |
| 18252 | _tmp26_ = free_call; |
| 18253 | _tmp27_ = bala_ccode_identifier_new ("self"); |
| 18254 | _tmp28_ = _tmp27_; |
| 18255 | _tmp29_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, (BalaCCodeExpression*) _tmp28_); |
| 18256 | _tmp30_ = _tmp29_; |
| 18257 | bala_ccode_function_call_add_argument (_tmp26_, (BalaCCodeExpression*) _tmp30_); |
| 18258 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 18259 | _bala_ccode_node_unref0 (_tmp28_)((_tmp28_ == ((void*)0)) ? ((void*)0) : (_tmp28_ = (bala_ccode_node_unref (_tmp28_), ((void*)0)))); |
| 18260 | _tmp31_ = bala_ccode_base_module_get_ccode (self); |
| 18261 | _tmp32_ = _tmp31_; |
| 18262 | _tmp33_ = free_call; |
| 18263 | bala_ccode_function_add_expression (_tmp32_, (BalaCCodeExpression*) _tmp33_); |
| 18264 | bala_ccode_base_module_pop_function (self); |
| 18265 | _tmp34_ = self->cfile; |
| 18266 | _tmp35_ = function; |
| 18267 | bala_ccode_file_add_function_declaration (_tmp34_, _tmp35_); |
| 18268 | _tmp36_ = self->cfile; |
| 18269 | _tmp37_ = function; |
| 18270 | bala_ccode_file_add_function (_tmp36_, _tmp37_); |
| 18271 | result = destroy_func; |
| 18272 | _bala_ccode_node_unref0 (free_call)((free_call == ((void*)0)) ? ((void*)0) : (free_call = (bala_ccode_node_unref (free_call), ((void*)0)))); |
| 18273 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 18274 | return result; |
| 18275 | } |
| 18276 | |
| 18277 | gchar* |
| 18278 | bala_ccode_base_module_generate_destroy_function_content_of_wrapper (BalaCCodeBaseModule* self, |
| 18279 | BalaDataType* type) |
| 18280 | { |
| 18281 | gchar* destroy_func = NULL((void*)0); |
| 18282 | BalaTypeSymbol* _tmp0_; |
| 18283 | BalaTypeSymbol* _tmp1_; |
| 18284 | gchar* _tmp2_; |
| 18285 | gchar* _tmp3_; |
| 18286 | gchar* _tmp4_; |
| 18287 | gchar* _tmp5_; |
| 18288 | const gchar* _tmp6_; |
| 18289 | BalaCCodeFunction* function = NULL((void*)0); |
| 18290 | const gchar* _tmp7_; |
| 18291 | BalaCCodeFunction* _tmp8_; |
| 18292 | BalaCCodeFunction* _tmp9_; |
| 18293 | BalaCCodeFunction* _tmp10_; |
| 18294 | BalaDataType* _tmp11_; |
| 18295 | gchar* _tmp12_; |
| 18296 | gchar* _tmp13_; |
| 18297 | BalaCCodeParameter* _tmp14_; |
| 18298 | BalaCCodeParameter* _tmp15_; |
| 18299 | BalaCCodeFunction* _tmp16_; |
| 18300 | BalaCCodeFunction* _tmp17_; |
| 18301 | BalaCCodeFunction* _tmp18_; |
| 18302 | gchar* _tmp19_; |
| 18303 | gchar* _tmp20_; |
| 18304 | BalaCCodeVariableDeclarator* _tmp21_; |
| 18305 | BalaCCodeVariableDeclarator* _tmp22_; |
| 18306 | BalaCCodeUnaryExpression* cast = NULL((void*)0); |
| 18307 | BalaCCodeIdentifier* _tmp23_; |
| 18308 | BalaCCodeIdentifier* _tmp24_; |
| 18309 | gchar* _tmp25_; |
| 18310 | gchar* _tmp26_; |
| 18311 | gchar* _tmp27_; |
| 18312 | gchar* _tmp28_; |
| 18313 | BalaCCodeCastExpression* _tmp29_; |
| 18314 | BalaCCodeCastExpression* _tmp30_; |
| 18315 | BalaCCodeUnaryExpression* _tmp31_; |
| 18316 | BalaCCodeUnaryExpression* _tmp32_; |
| 18317 | BalaCCodeFunction* _tmp33_; |
| 18318 | BalaCCodeFunction* _tmp34_; |
| 18319 | BalaCCodeIdentifier* _tmp35_; |
| 18320 | BalaCCodeIdentifier* _tmp36_; |
| 18321 | BalaCCodeUnaryExpression* _tmp37_; |
| 18322 | BalaCCodeFunctionCall* free_call = NULL((void*)0); |
| 18323 | BalaCCodeExpression* _tmp38_; |
| 18324 | BalaCCodeExpression* _tmp39_; |
| 18325 | BalaCCodeFunctionCall* _tmp40_; |
| 18326 | BalaCCodeFunctionCall* _tmp41_; |
| 18327 | BalaCCodeFunctionCall* _tmp42_; |
| 18328 | BalaCCodeIdentifier* _tmp43_; |
| 18329 | BalaCCodeIdentifier* _tmp44_; |
| 18330 | BalaCCodeFunction* _tmp45_; |
| 18331 | BalaCCodeFunction* _tmp46_; |
| 18332 | BalaCCodeFunctionCall* _tmp47_; |
| 18333 | BalaCCodeFile* _tmp48_; |
| 18334 | BalaCCodeFunction* _tmp49_; |
| 18335 | BalaCCodeFile* _tmp50_; |
| 18336 | BalaCCodeFunction* _tmp51_; |
| 18337 | gchar* result = NULL((void*)0); |
| 18338 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 18339 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 18340 | _tmp0_ = bala_data_type_get_type_symbol (type); |
| 18341 | _tmp1_ = _tmp0_; |
| 18342 | _tmp2_ = bala_get_ccode_name ((BalaCodeNode*) _tmp1_); |
| 18343 | _tmp3_ = _tmp2_; |
| 18344 | _tmp4_ = g_strdup_printf ("_bala_%s_free_function_content_of", _tmp3_); |
| 18345 | _tmp5_ = _tmp4_; |
| 18346 | _g_free0 (_tmp3_)(_tmp3_ = (g_free (_tmp3_), ((void*)0))); |
| 18347 | destroy_func = _tmp5_; |
| 18348 | _tmp6_ = destroy_func; |
| 18349 | if (!bala_ccode_base_module_add_wrapper (self, _tmp6_)) { |
| 18350 | result = destroy_func; |
| 18351 | return result; |
| 18352 | } |
| 18353 | _tmp7_ = destroy_func; |
| 18354 | _tmp8_ = bala_ccode_function_new (_tmp7_, "void"); |
| 18355 | function = _tmp8_; |
| 18356 | _tmp9_ = function; |
| 18357 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp9_, BALA_CCODE_MODIFIERS_STATIC); |
| 18358 | _tmp10_ = function; |
| 18359 | _tmp11_ = self->pointer_type; |
| 18360 | _tmp12_ = bala_get_ccode_name ((BalaCodeNode*) _tmp11_); |
| 18361 | _tmp13_ = _tmp12_; |
| 18362 | _tmp14_ = bala_ccode_parameter_new ("data", _tmp13_); |
| 18363 | _tmp15_ = _tmp14_; |
| 18364 | bala_ccode_function_add_parameter (_tmp10_, _tmp15_); |
| 18365 | _bala_ccode_node_unref0 (_tmp15_)((_tmp15_ == ((void*)0)) ? ((void*)0) : (_tmp15_ = (bala_ccode_node_unref (_tmp15_), ((void*)0)))); |
| 18366 | _g_free0 (_tmp13_)(_tmp13_ = (g_free (_tmp13_), ((void*)0))); |
| 18367 | _tmp16_ = function; |
| 18368 | bala_ccode_base_module_push_function (self, _tmp16_); |
| 18369 | _tmp17_ = bala_ccode_base_module_get_ccode (self); |
| 18370 | _tmp18_ = _tmp17_; |
| 18371 | _tmp19_ = bala_get_ccode_name ((BalaCodeNode*) type); |
| 18372 | _tmp20_ = _tmp19_; |
| 18373 | _tmp21_ = bala_ccode_variable_declarator_new ("self", NULL((void*)0), NULL((void*)0)); |
| 18374 | _tmp22_ = _tmp21_; |
| 18375 | bala_ccode_function_add_declaration (_tmp18_, _tmp20_, (BalaCCodeDeclarator*) _tmp22_, 0); |
| 18376 | _bala_ccode_node_unref0 (_tmp22_)((_tmp22_ == ((void*)0)) ? ((void*)0) : (_tmp22_ = (bala_ccode_node_unref (_tmp22_), ((void*)0)))); |
| 18377 | _g_free0 (_tmp20_)(_tmp20_ = (g_free (_tmp20_), ((void*)0))); |
| 18378 | _tmp23_ = bala_ccode_identifier_new ("data"); |
| 18379 | _tmp24_ = _tmp23_; |
| 18380 | _tmp25_ = bala_get_ccode_name ((BalaCodeNode*) type); |
| 18381 | _tmp26_ = _tmp25_; |
| 18382 | _tmp27_ = g_strconcat (_tmp26_, "*", NULL((void*)0)); |
| 18383 | _tmp28_ = _tmp27_; |
| 18384 | _tmp29_ = bala_ccode_cast_expression_new ((BalaCCodeExpression*) _tmp24_, _tmp28_); |
| 18385 | _tmp30_ = _tmp29_; |
| 18386 | _tmp31_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, (BalaCCodeExpression*) _tmp30_); |
| 18387 | _tmp32_ = _tmp31_; |
| 18388 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 18389 | _g_free0 (_tmp28_)(_tmp28_ = (g_free (_tmp28_), ((void*)0))); |
| 18390 | _g_free0 (_tmp26_)(_tmp26_ = (g_free (_tmp26_), ((void*)0))); |
| 18391 | _bala_ccode_node_unref0 (_tmp24_)((_tmp24_ == ((void*)0)) ? ((void*)0) : (_tmp24_ = (bala_ccode_node_unref (_tmp24_), ((void*)0)))); |
| 18392 | cast = _tmp32_; |
| 18393 | _tmp33_ = bala_ccode_base_module_get_ccode (self); |
| 18394 | _tmp34_ = _tmp33_; |
| 18395 | _tmp35_ = bala_ccode_identifier_new ("self"); |
| 18396 | _tmp36_ = _tmp35_; |
| 18397 | _tmp37_ = cast; |
| 18398 | bala_ccode_function_add_assignment (_tmp34_, (BalaCCodeExpression*) _tmp36_, (BalaCCodeExpression*) _tmp37_); |
| 18399 | _bala_ccode_node_unref0 (_tmp36_)((_tmp36_ == ((void*)0)) ? ((void*)0) : (_tmp36_ = (bala_ccode_node_unref (_tmp36_), ((void*)0)))); |
| 18400 | _tmp38_ = bala_ccode_base_module_get_destroy0_func_expression (self, type, FALSE(0)); |
| 18401 | _tmp39_ = _tmp38_; |
| 18402 | _tmp40_ = bala_ccode_function_call_new (_tmp39_); |
| 18403 | _tmp41_ = _tmp40_; |
| 18404 | _bala_ccode_node_unref0 (_tmp39_)((_tmp39_ == ((void*)0)) ? ((void*)0) : (_tmp39_ = (bala_ccode_node_unref (_tmp39_), ((void*)0)))); |
| 18405 | free_call = _tmp41_; |
| 18406 | _tmp42_ = free_call; |
| 18407 | _tmp43_ = bala_ccode_identifier_new ("self"); |
| 18408 | _tmp44_ = _tmp43_; |
| 18409 | bala_ccode_function_call_add_argument (_tmp42_, (BalaCCodeExpression*) _tmp44_); |
| 18410 | _bala_ccode_node_unref0 (_tmp44_)((_tmp44_ == ((void*)0)) ? ((void*)0) : (_tmp44_ = (bala_ccode_node_unref (_tmp44_), ((void*)0)))); |
| 18411 | _tmp45_ = bala_ccode_base_module_get_ccode (self); |
| 18412 | _tmp46_ = _tmp45_; |
| 18413 | _tmp47_ = free_call; |
| 18414 | bala_ccode_function_add_expression (_tmp46_, (BalaCCodeExpression*) _tmp47_); |
| 18415 | bala_ccode_base_module_pop_function (self); |
| 18416 | _tmp48_ = self->cfile; |
| 18417 | _tmp49_ = function; |
| 18418 | bala_ccode_file_add_function_declaration (_tmp48_, _tmp49_); |
| 18419 | _tmp50_ = self->cfile; |
| 18420 | _tmp51_ = function; |
| 18421 | bala_ccode_file_add_function (_tmp50_, _tmp51_); |
| 18422 | result = destroy_func; |
| 18423 | _bala_ccode_node_unref0 (free_call)((free_call == ((void*)0)) ? ((void*)0) : (free_call = (bala_ccode_node_unref (free_call), ((void*)0)))); |
| 18424 | _bala_ccode_node_unref0 (cast)((cast == ((void*)0)) ? ((void*)0) : (cast = (bala_ccode_node_unref (cast), ((void*)0)))); |
| 18425 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 18426 | return result; |
| 18427 | } |
| 18428 | |
| 18429 | gchar* |
| 18430 | bala_ccode_base_module_generate_free_func_wrapper (BalaCCodeBaseModule* self, |
| 18431 | BalaDataType* type) |
| 18432 | { |
| 18433 | gchar* destroy_func = NULL((void*)0); |
| 18434 | BalaTypeSymbol* _tmp0_; |
| 18435 | BalaTypeSymbol* _tmp1_; |
| 18436 | gchar* _tmp2_; |
| 18437 | gchar* _tmp3_; |
| 18438 | gchar* _tmp4_; |
| 18439 | gchar* _tmp5_; |
| 18440 | const gchar* _tmp6_; |
| 18441 | BalaCCodeFunction* function = NULL((void*)0); |
| 18442 | const gchar* _tmp7_; |
| 18443 | BalaCCodeFunction* _tmp8_; |
| 18444 | BalaCCodeFunction* _tmp9_; |
| 18445 | BalaCCodeFunction* _tmp10_; |
| 18446 | gchar* _tmp11_; |
| 18447 | gchar* _tmp12_; |
| 18448 | BalaCCodeParameter* _tmp13_; |
| 18449 | BalaCCodeParameter* _tmp14_; |
| 18450 | BalaCCodeFunction* _tmp15_; |
| 18451 | gboolean _tmp16_ = FALSE(0); |
| 18452 | BalaTypeSymbol* _tmp17_; |
| 18453 | BalaTypeSymbol* _tmp18_; |
| 18454 | BalaCCodeFile* _tmp78_; |
| 18455 | BalaCCodeFunction* _tmp79_; |
| 18456 | BalaCCodeFile* _tmp80_; |
| 18457 | BalaCCodeFunction* _tmp81_; |
| 18458 | gchar* result = NULL((void*)0); |
| 18459 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 18460 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 18461 | _tmp0_ = bala_data_type_get_type_symbol (type); |
| 18462 | _tmp1_ = _tmp0_; |
| 18463 | _tmp2_ = bala_get_ccode_name ((BalaCodeNode*) _tmp1_); |
| 18464 | _tmp3_ = _tmp2_; |
| 18465 | _tmp4_ = g_strdup_printf ("_bala_%s_free", _tmp3_); |
| 18466 | _tmp5_ = _tmp4_; |
| 18467 | _g_free0 (_tmp3_)(_tmp3_ = (g_free (_tmp3_), ((void*)0))); |
| 18468 | destroy_func = _tmp5_; |
| 18469 | _tmp6_ = destroy_func; |
| 18470 | if (!bala_ccode_base_module_add_wrapper (self, _tmp6_)) { |
| 18471 | result = destroy_func; |
| 18472 | return result; |
| 18473 | } |
| 18474 | _tmp7_ = destroy_func; |
| 18475 | _tmp8_ = bala_ccode_function_new (_tmp7_, "void"); |
| 18476 | function = _tmp8_; |
| 18477 | _tmp9_ = function; |
| 18478 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp9_, BALA_CCODE_MODIFIERS_STATIC); |
| 18479 | _tmp10_ = function; |
| 18480 | _tmp11_ = bala_get_ccode_name ((BalaCodeNode*) type); |
| 18481 | _tmp12_ = _tmp11_; |
| 18482 | _tmp13_ = bala_ccode_parameter_new ("self", _tmp12_); |
| 18483 | _tmp14_ = _tmp13_; |
| 18484 | bala_ccode_function_add_parameter (_tmp10_, _tmp14_); |
| 18485 | _bala_ccode_node_unref0 (_tmp14_)((_tmp14_ == ((void*)0)) ? ((void*)0) : (_tmp14_ = (bala_ccode_node_unref (_tmp14_), ((void*)0)))); |
| 18486 | _g_free0 (_tmp12_)(_tmp12_ = (g_free (_tmp12_), ((void*)0))); |
| 18487 | _tmp15_ = function; |
| 18488 | bala_ccode_base_module_push_function (self, _tmp15_); |
| 18489 | _tmp17_ = bala_data_type_get_type_symbol (type); |
| 18490 | _tmp18_ = _tmp17_; |
| 18491 | if (bala_get_ccode_is_gboxed (_tmp18_)) { |
| 18492 | _tmp16_ = TRUE(!(0)); |
| 18493 | } else { |
| 18494 | gboolean _tmp19_ = FALSE(0); |
| 18495 | BalaStruct* _tmp20_; |
| 18496 | _tmp20_ = self->gvalue_type; |
| 18497 | if (_tmp20_ != NULL((void*)0)) { |
| 18498 | BalaTypeSymbol* _tmp21_; |
| 18499 | BalaTypeSymbol* _tmp22_; |
| 18500 | BalaStruct* _tmp23_; |
| 18501 | _tmp21_ = bala_data_type_get_type_symbol (type); |
| 18502 | _tmp22_ = _tmp21_; |
| 18503 | _tmp23_ = self->gvalue_type; |
| 18504 | _tmp19_ = _tmp22_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp23_), ((bala_typesymbol_get_type ()))))); |
| 18505 | } else { |
| 18506 | _tmp19_ = FALSE(0); |
| 18507 | } |
| 18508 | _tmp16_ = _tmp19_; |
| 18509 | } |
| 18510 | if (_tmp16_) { |
| 18511 | BalaCCodeFunctionCall* free_call = NULL((void*)0); |
| 18512 | BalaCCodeIdentifier* _tmp24_; |
| 18513 | BalaCCodeIdentifier* _tmp25_; |
| 18514 | BalaCCodeFunctionCall* _tmp26_; |
| 18515 | BalaCCodeFunctionCall* _tmp27_; |
| 18516 | BalaCCodeFunctionCall* _tmp28_; |
| 18517 | BalaTypeSymbol* _tmp29_; |
| 18518 | BalaTypeSymbol* _tmp30_; |
| 18519 | gchar* _tmp31_; |
| 18520 | gchar* _tmp32_; |
| 18521 | BalaCCodeIdentifier* _tmp33_; |
| 18522 | BalaCCodeIdentifier* _tmp34_; |
| 18523 | BalaCCodeFunctionCall* _tmp35_; |
| 18524 | BalaCCodeIdentifier* _tmp36_; |
| 18525 | BalaCCodeIdentifier* _tmp37_; |
| 18526 | BalaCCodeFunction* _tmp38_; |
| 18527 | BalaCCodeFunction* _tmp39_; |
| 18528 | BalaCCodeFunctionCall* _tmp40_; |
| 18529 | _tmp24_ = bala_ccode_identifier_new ("g_boxed_free"); |
| 18530 | _tmp25_ = _tmp24_; |
| 18531 | _tmp26_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp25_); |
| 18532 | _tmp27_ = _tmp26_; |
| 18533 | _bala_ccode_node_unref0 (_tmp25_)((_tmp25_ == ((void*)0)) ? ((void*)0) : (_tmp25_ = (bala_ccode_node_unref (_tmp25_), ((void*)0)))); |
| 18534 | free_call = _tmp27_; |
| 18535 | _tmp28_ = free_call; |
| 18536 | _tmp29_ = bala_data_type_get_type_symbol (type); |
| 18537 | _tmp30_ = _tmp29_; |
| 18538 | _tmp31_ = bala_get_ccode_type_id ((BalaCodeNode*) _tmp30_); |
| 18539 | _tmp32_ = _tmp31_; |
| 18540 | _tmp33_ = bala_ccode_identifier_new (_tmp32_); |
| 18541 | _tmp34_ = _tmp33_; |
| 18542 | bala_ccode_function_call_add_argument (_tmp28_, (BalaCCodeExpression*) _tmp34_); |
| 18543 | _bala_ccode_node_unref0 (_tmp34_)((_tmp34_ == ((void*)0)) ? ((void*)0) : (_tmp34_ = (bala_ccode_node_unref (_tmp34_), ((void*)0)))); |
| 18544 | _g_free0 (_tmp32_)(_tmp32_ = (g_free (_tmp32_), ((void*)0))); |
| 18545 | _tmp35_ = free_call; |
| 18546 | _tmp36_ = bala_ccode_identifier_new ("self"); |
| 18547 | _tmp37_ = _tmp36_; |
| 18548 | bala_ccode_function_call_add_argument (_tmp35_, (BalaCCodeExpression*) _tmp37_); |
| 18549 | _bala_ccode_node_unref0 (_tmp37_)((_tmp37_ == ((void*)0)) ? ((void*)0) : (_tmp37_ = (bala_ccode_node_unref (_tmp37_), ((void*)0)))); |
| 18550 | _tmp38_ = bala_ccode_base_module_get_ccode (self); |
| 18551 | _tmp39_ = _tmp38_; |
| 18552 | _tmp40_ = free_call; |
| 18553 | bala_ccode_function_add_expression (_tmp39_, (BalaCCodeExpression*) _tmp40_); |
| 18554 | _bala_ccode_node_unref0 (free_call)((free_call == ((void*)0)) ? ((void*)0) : (free_call = (bala_ccode_node_unref (free_call), ((void*)0)))); |
| 18555 | } else { |
| 18556 | BalaStruct* st = NULL((void*)0); |
| 18557 | BalaTypeSymbol* _tmp41_; |
| 18558 | BalaTypeSymbol* _tmp42_; |
| 18559 | gboolean _tmp43_ = FALSE(0); |
| 18560 | BalaStruct* _tmp44_; |
| 18561 | BalaCCodeFunctionCall* free_call = NULL((void*)0); |
| 18562 | BalaCodeContext* _tmp61_; |
| 18563 | BalaProfile _tmp62_; |
| 18564 | BalaProfile _tmp63_; |
| 18565 | BalaCCodeFunctionCall* _tmp72_; |
| 18566 | BalaCCodeIdentifier* _tmp73_; |
| 18567 | BalaCCodeIdentifier* _tmp74_; |
| 18568 | BalaCCodeFunction* _tmp75_; |
| 18569 | BalaCCodeFunction* _tmp76_; |
| 18570 | BalaCCodeFunctionCall* _tmp77_; |
| 18571 | _tmp41_ = bala_data_type_get_type_symbol (type); |
| 18572 | _tmp42_ = _tmp41_; |
| 18573 | st = G_TYPE_CHECK_INSTANCE_TYPE (_tmp42_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp42_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp42_) : NULL((void*)0); |
| 18574 | _tmp44_ = st; |
| 18575 | if (_tmp44_ != NULL((void*)0)) { |
| 18576 | BalaStruct* _tmp45_; |
| 18577 | _tmp45_ = st; |
| 18578 | _tmp43_ = bala_struct_is_disposable (_tmp45_); |
| 18579 | } else { |
| 18580 | _tmp43_ = FALSE(0); |
| 18581 | } |
| 18582 | if (_tmp43_) { |
| 18583 | BalaStruct* _tmp46_; |
| 18584 | BalaCCodeFunctionCall* destroy_call = NULL((void*)0); |
| 18585 | BalaStruct* _tmp48_; |
| 18586 | gchar* _tmp49_; |
| 18587 | gchar* _tmp50_; |
| 18588 | BalaCCodeIdentifier* _tmp51_; |
| 18589 | BalaCCodeIdentifier* _tmp52_; |
| 18590 | BalaCCodeFunctionCall* _tmp53_; |
| 18591 | BalaCCodeFunctionCall* _tmp54_; |
| 18592 | BalaCCodeFunctionCall* _tmp55_; |
| 18593 | BalaCCodeIdentifier* _tmp56_; |
| 18594 | BalaCCodeIdentifier* _tmp57_; |
| 18595 | BalaCCodeFunction* _tmp58_; |
| 18596 | BalaCCodeFunction* _tmp59_; |
| 18597 | BalaCCodeFunctionCall* _tmp60_; |
| 18598 | _tmp46_ = st; |
| 18599 | if (!bala_get_ccode_has_destroy_function (_tmp46_)) { |
| 18600 | BalaStruct* _tmp47_; |
| 18601 | _tmp47_ = st; |
| 18602 | bala_ccode_base_module_generate_struct_destroy_function (self, _tmp47_); |
| 18603 | } |
| 18604 | _tmp48_ = st; |
| 18605 | _tmp49_ = bala_get_ccode_destroy_function ((BalaTypeSymbol*) _tmp48_); |
| 18606 | _tmp50_ = _tmp49_; |
| 18607 | _tmp51_ = bala_ccode_identifier_new (_tmp50_); |
| 18608 | _tmp52_ = _tmp51_; |
| 18609 | _tmp53_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp52_); |
| 18610 | _tmp54_ = _tmp53_; |
| 18611 | _bala_ccode_node_unref0 (_tmp52_)((_tmp52_ == ((void*)0)) ? ((void*)0) : (_tmp52_ = (bala_ccode_node_unref (_tmp52_), ((void*)0)))); |
| 18612 | _g_free0 (_tmp50_)(_tmp50_ = (g_free (_tmp50_), ((void*)0))); |
| 18613 | destroy_call = _tmp54_; |
| 18614 | _tmp55_ = destroy_call; |
| 18615 | _tmp56_ = bala_ccode_identifier_new ("self"); |
| 18616 | _tmp57_ = _tmp56_; |
| 18617 | bala_ccode_function_call_add_argument (_tmp55_, (BalaCCodeExpression*) _tmp57_); |
| 18618 | _bala_ccode_node_unref0 (_tmp57_)((_tmp57_ == ((void*)0)) ? ((void*)0) : (_tmp57_ = (bala_ccode_node_unref (_tmp57_), ((void*)0)))); |
| 18619 | _tmp58_ = bala_ccode_base_module_get_ccode (self); |
| 18620 | _tmp59_ = _tmp58_; |
| 18621 | _tmp60_ = destroy_call; |
| 18622 | bala_ccode_function_add_expression (_tmp59_, (BalaCCodeExpression*) _tmp60_); |
| 18623 | _bala_ccode_node_unref0 (destroy_call)((destroy_call == ((void*)0)) ? ((void*)0) : (destroy_call = ( bala_ccode_node_unref (destroy_call), ((void*)0)))); |
| 18624 | } |
| 18625 | _tmp61_ = self->priv->_context; |
| 18626 | _tmp62_ = bala_code_context_get_profile (_tmp61_); |
| 18627 | _tmp63_ = _tmp62_; |
| 18628 | if (_tmp63_ == BALA_PROFILE_POSIX) { |
| 18629 | BalaCCodeFile* _tmp64_; |
| 18630 | BalaCCodeIdentifier* _tmp65_; |
| 18631 | BalaCCodeIdentifier* _tmp66_; |
| 18632 | BalaCCodeFunctionCall* _tmp67_; |
| 18633 | _tmp64_ = self->cfile; |
| 18634 | bala_ccode_file_add_include (_tmp64_, "stdlib.h", FALSE(0)); |
| 18635 | _tmp65_ = bala_ccode_identifier_new ("free"); |
| 18636 | _tmp66_ = _tmp65_; |
| 18637 | _tmp67_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp66_); |
| 18638 | _bala_ccode_node_unref0 (free_call)((free_call == ((void*)0)) ? ((void*)0) : (free_call = (bala_ccode_node_unref (free_call), ((void*)0)))); |
| 18639 | free_call = _tmp67_; |
| 18640 | _bala_ccode_node_unref0 (_tmp66_)((_tmp66_ == ((void*)0)) ? ((void*)0) : (_tmp66_ = (bala_ccode_node_unref (_tmp66_), ((void*)0)))); |
| 18641 | } else { |
| 18642 | BalaCCodeFile* _tmp68_; |
| 18643 | BalaCCodeIdentifier* _tmp69_; |
| 18644 | BalaCCodeIdentifier* _tmp70_; |
| 18645 | BalaCCodeFunctionCall* _tmp71_; |
| 18646 | _tmp68_ = self->cfile; |
| 18647 | bala_ccode_file_add_include (_tmp68_, "glib.h", FALSE(0)); |
| 18648 | _tmp69_ = bala_ccode_identifier_new ("g_free"); |
| 18649 | _tmp70_ = _tmp69_; |
| 18650 | _tmp71_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp70_); |
| 18651 | _bala_ccode_node_unref0 (free_call)((free_call == ((void*)0)) ? ((void*)0) : (free_call = (bala_ccode_node_unref (free_call), ((void*)0)))); |
| 18652 | free_call = _tmp71_; |
| 18653 | _bala_ccode_node_unref0 (_tmp70_)((_tmp70_ == ((void*)0)) ? ((void*)0) : (_tmp70_ = (bala_ccode_node_unref (_tmp70_), ((void*)0)))); |
| 18654 | } |
| 18655 | _tmp72_ = free_call; |
| 18656 | _tmp73_ = bala_ccode_identifier_new ("self"); |
| 18657 | _tmp74_ = _tmp73_; |
| 18658 | bala_ccode_function_call_add_argument (_tmp72_, (BalaCCodeExpression*) _tmp74_); |
| 18659 | _bala_ccode_node_unref0 (_tmp74_)((_tmp74_ == ((void*)0)) ? ((void*)0) : (_tmp74_ = (bala_ccode_node_unref (_tmp74_), ((void*)0)))); |
| 18660 | _tmp75_ = bala_ccode_base_module_get_ccode (self); |
| 18661 | _tmp76_ = _tmp75_; |
| 18662 | _tmp77_ = free_call; |
| 18663 | bala_ccode_function_add_expression (_tmp76_, (BalaCCodeExpression*) _tmp77_); |
| 18664 | _bala_ccode_node_unref0 (free_call)((free_call == ((void*)0)) ? ((void*)0) : (free_call = (bala_ccode_node_unref (free_call), ((void*)0)))); |
| 18665 | } |
| 18666 | bala_ccode_base_module_pop_function (self); |
| 18667 | _tmp78_ = self->cfile; |
| 18668 | _tmp79_ = function; |
| 18669 | bala_ccode_file_add_function_declaration (_tmp78_, _tmp79_); |
| 18670 | _tmp80_ = self->cfile; |
| 18671 | _tmp81_ = function; |
| 18672 | bala_ccode_file_add_function (_tmp80_, _tmp81_); |
| 18673 | result = destroy_func; |
| 18674 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 18675 | return result; |
| 18676 | } |
| 18677 | |
| 18678 | BalaCCodeExpression* |
| 18679 | bala_ccode_base_module_get_destroy0_func_expression (BalaCCodeBaseModule* self, |
| 18680 | BalaDataType* type, |
| 18681 | gboolean is_chainup) |
| 18682 | { |
| 18683 | BalaCCodeExpression* element_destroy_func_expression = NULL((void*)0); |
| 18684 | BalaCCodeExpression* _tmp0_; |
| 18685 | gboolean _tmp1_ = FALSE(0); |
| 18686 | BalaCCodeExpression* result = NULL((void*)0); |
| 18687 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 18688 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 18689 | _tmp0_ = bala_ccode_base_module_get_destroy_func_expression (self, type, is_chainup); |
| 18690 | element_destroy_func_expression = _tmp0_; |
| 18691 | if (!G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 18692 | BalaCCodeExpression* _tmp2_; |
| 18693 | _tmp2_ = element_destroy_func_expression; |
| 18694 | _tmp1_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, BALA_TYPE_CCODE_IDENTIFIER)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp2_); GType __t = ((bala_ccode_identifier_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 18695 | } else { |
| 18696 | _tmp1_ = FALSE(0); |
| 18697 | } |
| 18698 | if (_tmp1_) { |
| 18699 | BalaCCodeIdentifier* freeid = NULL((void*)0); |
| 18700 | BalaCCodeExpression* _tmp3_; |
| 18701 | BalaCCodeIdentifier* _tmp4_; |
| 18702 | gchar* free0_func = NULL((void*)0); |
| 18703 | BalaCCodeIdentifier* _tmp5_; |
| 18704 | const gchar* _tmp6_; |
| 18705 | const gchar* _tmp7_; |
| 18706 | gchar* _tmp8_; |
| 18707 | const gchar* _tmp9_; |
| 18708 | const gchar* _tmp32_; |
| 18709 | BalaCCodeIdentifier* _tmp33_; |
| 18710 | _tmp3_ = element_destroy_func_expression; |
| 18711 | _tmp4_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, BALA_TYPE_CCODE_IDENTIFIER, BalaCCodeIdentifier)(((BalaCCodeIdentifier*) g_type_check_instance_cast ((GTypeInstance *) (_tmp3_), ((bala_ccode_identifier_get_type ())))))); |
| 18712 | freeid = _tmp4_; |
| 18713 | _tmp5_ = freeid; |
| 18714 | _tmp6_ = bala_ccode_identifier_get_name (_tmp5_); |
| 18715 | _tmp7_ = _tmp6_; |
| 18716 | _tmp8_ = g_strdup_printf ("_%s0_", _tmp7_); |
| 18717 | free0_func = _tmp8_; |
| 18718 | _tmp9_ = free0_func; |
| 18719 | if (bala_ccode_base_module_add_wrapper (self, _tmp9_)) { |
| 18720 | BalaCCodeFunction* function = NULL((void*)0); |
| 18721 | const gchar* _tmp10_; |
| 18722 | BalaCCodeFunction* _tmp11_; |
| 18723 | BalaCCodeFunction* _tmp12_; |
| 18724 | BalaCCodeFunction* _tmp13_; |
| 18725 | BalaDataType* _tmp14_; |
| 18726 | gchar* _tmp15_; |
| 18727 | gchar* _tmp16_; |
| 18728 | BalaCCodeParameter* _tmp17_; |
| 18729 | BalaCCodeParameter* _tmp18_; |
| 18730 | BalaCCodeFunction* _tmp19_; |
| 18731 | BalaCCodeFunction* _tmp20_; |
| 18732 | BalaCCodeFunction* _tmp21_; |
| 18733 | BalaCCodeIdentifier* _tmp22_; |
| 18734 | BalaCCodeIdentifier* _tmp23_; |
| 18735 | BalaGLibValue* _tmp24_; |
| 18736 | BalaGLibValue* _tmp25_; |
| 18737 | BalaCCodeExpression* _tmp26_; |
| 18738 | BalaCCodeExpression* _tmp27_; |
| 18739 | BalaCCodeFile* _tmp28_; |
| 18740 | BalaCCodeFunction* _tmp29_; |
| 18741 | BalaCCodeFile* _tmp30_; |
| 18742 | BalaCCodeFunction* _tmp31_; |
| 18743 | _tmp10_ = free0_func; |
| 18744 | _tmp11_ = bala_ccode_function_new (_tmp10_, "void"); |
| 18745 | function = _tmp11_; |
| 18746 | _tmp12_ = function; |
| 18747 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp12_, BALA_CCODE_MODIFIERS_STATIC); |
| 18748 | _tmp13_ = function; |
| 18749 | _tmp14_ = self->pointer_type; |
| 18750 | _tmp15_ = bala_get_ccode_name ((BalaCodeNode*) _tmp14_); |
| 18751 | _tmp16_ = _tmp15_; |
| 18752 | _tmp17_ = bala_ccode_parameter_new ("var", _tmp16_); |
| 18753 | _tmp18_ = _tmp17_; |
| 18754 | bala_ccode_function_add_parameter (_tmp13_, _tmp18_); |
| 18755 | _bala_ccode_node_unref0 (_tmp18_)((_tmp18_ == ((void*)0)) ? ((void*)0) : (_tmp18_ = (bala_ccode_node_unref (_tmp18_), ((void*)0)))); |
| 18756 | _g_free0 (_tmp16_)(_tmp16_ = (g_free (_tmp16_), ((void*)0))); |
| 18757 | _tmp19_ = function; |
| 18758 | bala_ccode_base_module_push_function (self, _tmp19_); |
| 18759 | _tmp20_ = bala_ccode_base_module_get_ccode (self); |
| 18760 | _tmp21_ = _tmp20_; |
| 18761 | _tmp22_ = bala_ccode_identifier_new ("var"); |
| 18762 | _tmp23_ = _tmp22_; |
| 18763 | _tmp24_ = bala_glib_value_new (type, (BalaCCodeExpression*) _tmp23_, TRUE(!(0))); |
| 18764 | _tmp25_ = _tmp24_; |
| 18765 | _tmp26_ = bala_ccode_base_module_destroy_value (self, (BalaTargetValue*) _tmp25_, TRUE(!(0))); |
| 18766 | _tmp27_ = _tmp26_; |
| 18767 | bala_ccode_function_add_expression (_tmp21_, _tmp27_); |
| 18768 | _bala_ccode_node_unref0 (_tmp27_)((_tmp27_ == ((void*)0)) ? ((void*)0) : (_tmp27_ = (bala_ccode_node_unref (_tmp27_), ((void*)0)))); |
| 18769 | _bala_target_value_unref0 (_tmp25_)((_tmp25_ == ((void*)0)) ? ((void*)0) : (_tmp25_ = (bala_target_value_unref (_tmp25_), ((void*)0)))); |
| 18770 | _bala_ccode_node_unref0 (_tmp23_)((_tmp23_ == ((void*)0)) ? ((void*)0) : (_tmp23_ = (bala_ccode_node_unref (_tmp23_), ((void*)0)))); |
| 18771 | bala_ccode_base_module_pop_function (self); |
| 18772 | _tmp28_ = self->cfile; |
| 18773 | _tmp29_ = function; |
| 18774 | bala_ccode_file_add_function_declaration (_tmp28_, _tmp29_); |
| 18775 | _tmp30_ = self->cfile; |
| 18776 | _tmp31_ = function; |
| 18777 | bala_ccode_file_add_function (_tmp30_, _tmp31_); |
| 18778 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 18779 | } |
| 18780 | _tmp32_ = free0_func; |
| 18781 | _tmp33_ = bala_ccode_identifier_new (_tmp32_); |
| 18782 | _bala_ccode_node_unref0 (element_destroy_func_expression)((element_destroy_func_expression == ((void*)0)) ? ((void*)0) : (element_destroy_func_expression = (bala_ccode_node_unref ( element_destroy_func_expression), ((void*)0)))); |
| 18783 | element_destroy_func_expression = (BalaCCodeExpression*) _tmp33_; |
| 18784 | _g_free0 (free0_func)(free0_func = (g_free (free0_func), ((void*)0))); |
| 18785 | _bala_ccode_node_unref0 (freeid)((freeid == ((void*)0)) ? ((void*)0) : (freeid = (bala_ccode_node_unref (freeid), ((void*)0)))); |
| 18786 | } |
| 18787 | result = element_destroy_func_expression; |
| 18788 | return result; |
| 18789 | } |
| 18790 | |
| 18791 | BalaCCodeExpression* |
| 18792 | bala_ccode_base_module_get_destroy_func_expression (BalaCCodeBaseModule* self, |
| 18793 | BalaDataType* type, |
| 18794 | gboolean is_chainup) |
| 18795 | { |
| 18796 | gboolean _tmp0_ = FALSE(0); |
| 18797 | BalaCodeContext* _tmp1_; |
| 18798 | BalaProfile _tmp2_; |
| 18799 | BalaProfile _tmp3_; |
| 18800 | BalaCCodeExpression* result = NULL((void*)0); |
| 18801 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 18802 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 18803 | _tmp1_ = self->priv->_context; |
| 18804 | _tmp2_ = bala_code_context_get_profile (_tmp1_); |
| 18805 | _tmp3_ = _tmp2_; |
| 18806 | if (_tmp3_ == BALA_PROFILE_GOBJECT) { |
| 18807 | gboolean _tmp4_ = FALSE(0); |
| 18808 | gboolean _tmp5_ = FALSE(0); |
| 18809 | gboolean _tmp6_ = FALSE(0); |
| 18810 | BalaTypeSymbol* _tmp7_; |
| 18811 | BalaTypeSymbol* _tmp8_; |
| 18812 | BalaClass* _tmp9_; |
| 18813 | _tmp7_ = bala_data_type_get_type_symbol (type); |
| 18814 | _tmp8_ = _tmp7_; |
| 18815 | _tmp9_ = self->glist_type; |
| 18816 | if (_tmp8_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp9_), ((bala_typesymbol_get_type ())))))) { |
| 18817 | _tmp6_ = TRUE(!(0)); |
| 18818 | } else { |
| 18819 | BalaTypeSymbol* _tmp10_; |
| 18820 | BalaTypeSymbol* _tmp11_; |
| 18821 | BalaClass* _tmp12_; |
| 18822 | _tmp10_ = bala_data_type_get_type_symbol (type); |
| 18823 | _tmp11_ = _tmp10_; |
| 18824 | _tmp12_ = self->gslist_type; |
| 18825 | _tmp6_ = _tmp11_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp12_), ((bala_typesymbol_get_type ()))))); |
| 18826 | } |
| 18827 | if (_tmp6_) { |
| 18828 | _tmp5_ = TRUE(!(0)); |
| 18829 | } else { |
| 18830 | BalaTypeSymbol* _tmp13_; |
| 18831 | BalaTypeSymbol* _tmp14_; |
| 18832 | BalaClass* _tmp15_; |
| 18833 | _tmp13_ = bala_data_type_get_type_symbol (type); |
| 18834 | _tmp14_ = _tmp13_; |
| 18835 | _tmp15_ = self->gnode_type; |
| 18836 | _tmp5_ = _tmp14_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp15_), ((bala_typesymbol_get_type ()))))); |
| 18837 | } |
| 18838 | if (_tmp5_) { |
| 18839 | _tmp4_ = TRUE(!(0)); |
| 18840 | } else { |
| 18841 | BalaTypeSymbol* _tmp16_; |
| 18842 | BalaTypeSymbol* _tmp17_; |
| 18843 | BalaClass* _tmp18_; |
| 18844 | _tmp16_ = bala_data_type_get_type_symbol (type); |
| 18845 | _tmp17_ = _tmp16_; |
| 18846 | _tmp18_ = self->gqueue_type; |
| 18847 | _tmp4_ = _tmp17_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp18_), ((bala_typesymbol_get_type ()))))); |
| 18848 | } |
| 18849 | _tmp0_ = _tmp4_; |
| 18850 | } else { |
| 18851 | _tmp0_ = FALSE(0); |
| 18852 | } |
| 18853 | if (_tmp0_) { |
| 18854 | gboolean elements_require_free = FALSE(0); |
| 18855 | gboolean generic_elements = FALSE(0); |
| 18856 | BalaCCodeExpression* element_destroy_func_expression = NULL((void*)0); |
| 18857 | elements_require_free = FALSE(0); |
| 18858 | generic_elements = FALSE(0); |
| 18859 | element_destroy_func_expression = NULL((void*)0); |
| 18860 | { |
| 18861 | BalaList* _type_arg_list = NULL((void*)0); |
| 18862 | BalaList* _tmp19_; |
| 18863 | BalaList* _tmp20_; |
| 18864 | gint _type_arg_size = 0; |
| 18865 | BalaList* _tmp21_; |
| 18866 | gint _tmp22_; |
| 18867 | gint _tmp23_; |
| 18868 | gint _type_arg_index = 0; |
| 18869 | _tmp19_ = bala_data_type_get_type_arguments (type); |
| 18870 | _tmp20_ = _bala_iterable_ref0 (_tmp19_); |
| 18871 | _type_arg_list = _tmp20_; |
| 18872 | _tmp21_ = _type_arg_list; |
| 18873 | _tmp22_ = bala_collection_get_size ((BalaCollection*) _tmp21_); |
| 18874 | _tmp23_ = _tmp22_; |
| 18875 | _type_arg_size = _tmp23_; |
| 18876 | _type_arg_index = -1; |
| 18877 | while (TRUE(!(0))) { |
| 18878 | gint _tmp24_; |
| 18879 | gint _tmp25_; |
| 18880 | BalaDataType* type_arg = NULL((void*)0); |
| 18881 | BalaList* _tmp26_; |
| 18882 | gpointer _tmp27_; |
| 18883 | BalaDataType* _tmp28_; |
| 18884 | _type_arg_index = _type_arg_index + 1; |
| 18885 | _tmp24_ = _type_arg_index; |
| 18886 | _tmp25_ = _type_arg_size; |
| 18887 | if (!(_tmp24_ < _tmp25_)) { |
| 18888 | break; |
| 18889 | } |
| 18890 | _tmp26_ = _type_arg_list; |
| 18891 | _tmp27_ = bala_list_get (_tmp26_, _type_arg_index); |
| 18892 | type_arg = (BalaDataType*) _tmp27_; |
| 18893 | _tmp28_ = type_arg; |
| 18894 | elements_require_free = bala_ccode_base_module_requires_destroy (_tmp28_); |
| 18895 | if (elements_require_free) { |
| 18896 | BalaDataType* _tmp29_; |
| 18897 | BalaCCodeExpression* _tmp30_; |
| 18898 | BalaDataType* _tmp31_; |
| 18899 | _tmp29_ = type_arg; |
| 18900 | _tmp30_ = bala_ccode_base_module_get_destroy0_func_expression (self, _tmp29_, FALSE(0)); |
| 18901 | _bala_ccode_node_unref0 (element_destroy_func_expression)((element_destroy_func_expression == ((void*)0)) ? ((void*)0) : (element_destroy_func_expression = (bala_ccode_node_unref ( element_destroy_func_expression), ((void*)0)))); |
| 18902 | element_destroy_func_expression = _tmp30_; |
| 18903 | _tmp31_ = type_arg; |
| 18904 | generic_elements = G_TYPE_CHECK_INSTANCE_TYPE (_tmp31_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp31_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 18905 | } |
| 18906 | _bala_code_node_unref0 (type_arg)((type_arg == ((void*)0)) ? ((void*)0) : (type_arg = (bala_code_node_unref (type_arg), ((void*)0)))); |
| 18907 | } |
| 18908 | _bala_iterable_unref0 (_type_arg_list)((_type_arg_list == ((void*)0)) ? ((void*)0) : (_type_arg_list = (bala_iterable_unref (_type_arg_list), ((void*)0)))); |
| 18909 | } |
| 18910 | if (elements_require_free) { |
| 18911 | BalaCCodeExpression* cexpr = NULL((void*)0); |
| 18912 | gboolean _tmp32_ = FALSE(0); |
| 18913 | BalaCCodeExpression* _tmp33_; |
| 18914 | cexpr = NULL((void*)0); |
| 18915 | _tmp33_ = element_destroy_func_expression; |
| 18916 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp33_, BALA_TYPE_CCODE_IDENTIFIER)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp33_); GType __t = ((bala_ccode_identifier_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 18917 | _tmp32_ = TRUE(!(0)); |
| 18918 | } else { |
| 18919 | BalaCCodeExpression* _tmp34_; |
| 18920 | _tmp34_ = element_destroy_func_expression; |
| 18921 | _tmp32_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp34_, BALA_TYPE_CCODE_MEMBER_ACCESS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp34_); GType __t = ((bala_ccode_member_access_get_type ()) ); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 18922 | } |
| 18923 | if (_tmp32_) { |
| 18924 | BalaCCodeIdentifier* _tmp35_ = NULL((void*)0); |
| 18925 | gchar* _tmp37_; |
| 18926 | gchar* _tmp38_; |
| 18927 | BalaCCodeIdentifier* _tmp39_; |
| 18928 | if (generic_elements) { |
| 18929 | _tmp35_ = NULL((void*)0); |
| 18930 | } else { |
| 18931 | BalaCCodeExpression* _tmp36_; |
| 18932 | _tmp36_ = element_destroy_func_expression; |
| 18933 | _tmp35_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp36_, BALA_TYPE_CCODE_IDENTIFIER)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp36_); GType __t = ((bala_ccode_identifier_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaCCodeIdentifier*) _tmp36_) : NULL((void*)0); |
| 18934 | } |
| 18935 | _tmp37_ = bala_ccode_base_module_generate_collection_free_wrapper (self, type, _tmp35_); |
| 18936 | _tmp38_ = _tmp37_; |
| 18937 | _tmp39_ = bala_ccode_identifier_new (_tmp38_); |
| 18938 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 18939 | cexpr = (BalaCCodeExpression*) _tmp39_; |
| 18940 | _g_free0 (_tmp38_)(_tmp38_ = (g_free (_tmp38_), ((void*)0))); |
| 18941 | if (generic_elements) { |
| 18942 | BalaCCodeExpression* _tmp40_; |
| 18943 | BalaCCodeFunctionCall* _tmp41_; |
| 18944 | BalaCCodeExpression* _tmp42_; |
| 18945 | BalaCCodeExpression* _tmp43_; |
| 18946 | _tmp40_ = cexpr; |
| 18947 | _tmp41_ = bala_ccode_function_call_new (_tmp40_); |
| 18948 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 18949 | cexpr = (BalaCCodeExpression*) _tmp41_; |
| 18950 | _tmp42_ = cexpr; |
| 18951 | _tmp43_ = element_destroy_func_expression; |
| 18952 | bala_ccode_function_call_add_argument (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, BALA_TYPE_CCODE_FUNCTION_CALL, BalaCCodeFunctionCall)(((BalaCCodeFunctionCall*) g_type_check_instance_cast ((GTypeInstance *) (_tmp42_), ((bala_ccode_function_call_get_type ()))))), _tmp43_); |
| 18953 | } |
| 18954 | } else { |
| 18955 | bala_report_error (NULL((void*)0), "internal error: No useable element_destroy_function found"); |
| 18956 | } |
| 18957 | result = cexpr; |
| 18958 | _bala_ccode_node_unref0 (element_destroy_func_expression)((element_destroy_func_expression == ((void*)0)) ? ((void*)0) : (element_destroy_func_expression = (bala_ccode_node_unref ( element_destroy_func_expression), ((void*)0)))); |
| 18959 | return result; |
| 18960 | } else { |
| 18961 | BalaTypeSymbol* _tmp44_; |
| 18962 | BalaTypeSymbol* _tmp45_; |
| 18963 | gchar* _tmp46_; |
| 18964 | gchar* _tmp47_; |
| 18965 | BalaCCodeIdentifier* _tmp48_; |
| 18966 | BalaCCodeExpression* _tmp49_; |
| 18967 | _tmp44_ = bala_data_type_get_type_symbol (type); |
| 18968 | _tmp45_ = _tmp44_; |
| 18969 | _tmp46_ = bala_get_ccode_free_function (_tmp45_); |
| 18970 | _tmp47_ = _tmp46_; |
| 18971 | _tmp48_ = bala_ccode_identifier_new (_tmp47_); |
| 18972 | _tmp49_ = (BalaCCodeExpression*) _tmp48_; |
| 18973 | _g_free0 (_tmp47_)(_tmp47_ = (g_free (_tmp47_), ((void*)0))); |
| 18974 | result = _tmp49_; |
| 18975 | _bala_ccode_node_unref0 (element_destroy_func_expression)((element_destroy_func_expression == ((void*)0)) ? ((void*)0) : (element_destroy_func_expression = (bala_ccode_node_unref ( element_destroy_func_expression), ((void*)0)))); |
| 18976 | return result; |
| 18977 | } |
| 18978 | _bala_ccode_node_unref0 (element_destroy_func_expression)((element_destroy_func_expression == ((void*)0)) ? ((void*)0) : (element_destroy_func_expression = (bala_ccode_node_unref ( element_destroy_func_expression), ((void*)0)))); |
| 18979 | } else { |
| 18980 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ERROR_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_error_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 18981 | BalaCCodeFile* _tmp50_; |
| 18982 | BalaCCodeIdentifier* _tmp51_; |
| 18983 | _tmp50_ = self->cfile; |
| 18984 | bala_ccode_file_add_include (_tmp50_, "glib.h", FALSE(0)); |
| 18985 | _tmp51_ = bala_ccode_identifier_new ("g_error_free"); |
| 18986 | result = (BalaCCodeExpression*) _tmp51_; |
| 18987 | return result; |
| 18988 | } else { |
| 18989 | BalaTypeSymbol* _tmp52_; |
| 18990 | BalaTypeSymbol* _tmp53_; |
| 18991 | _tmp52_ = bala_data_type_get_type_symbol (type); |
| 18992 | _tmp53_ = _tmp52_; |
| 18993 | if (_tmp53_ != NULL((void*)0)) { |
| 18994 | gchar* unref_function = NULL((void*)0); |
| 18995 | const gchar* _tmp109_; |
| 18996 | const gchar* _tmp111_; |
| 18997 | BalaCCodeIdentifier* _tmp112_; |
| 18998 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_REFERENCE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_reference_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 18999 | BalaTypeSymbol* _tmp54_; |
| 19000 | BalaTypeSymbol* _tmp55_; |
| 19001 | _tmp54_ = bala_data_type_get_type_symbol (type); |
| 19002 | _tmp55_ = _tmp54_; |
| 19003 | if (bala_is_reference_counting (_tmp55_)) { |
| 19004 | BalaTypeSymbol* _tmp56_; |
| 19005 | BalaTypeSymbol* _tmp57_; |
| 19006 | gchar* _tmp58_; |
| 19007 | gboolean _tmp59_ = FALSE(0); |
| 19008 | BalaTypeSymbol* _tmp60_; |
| 19009 | BalaTypeSymbol* _tmp61_; |
| 19010 | _tmp56_ = bala_data_type_get_type_symbol (type); |
| 19011 | _tmp57_ = _tmp56_; |
| 19012 | _tmp58_ = bala_get_ccode_unref_function (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, BALA_TYPE_OBJECT_TYPE_SYMBOL, BalaObjectTypeSymbol)(((BalaObjectTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp57_), ((bala_object_type_symbol_get_type ())))))); |
| 19013 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19014 | unref_function = _tmp58_; |
| 19015 | _tmp60_ = bala_data_type_get_type_symbol (type); |
| 19016 | _tmp61_ = _tmp60_; |
| 19017 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp61_, BALA_TYPE_INTERFACE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp61_); GType __t = ((bala_interface_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 19018 | const gchar* _tmp62_; |
| 19019 | _tmp62_ = unref_function; |
| 19020 | _tmp59_ = _tmp62_ == NULL((void*)0); |
| 19021 | } else { |
| 19022 | _tmp59_ = FALSE(0); |
| 19023 | } |
| 19024 | if (_tmp59_) { |
| 19025 | BalaSourceReference* _tmp63_; |
| 19026 | BalaSourceReference* _tmp64_; |
| 19027 | BalaTypeSymbol* _tmp65_; |
| 19028 | BalaTypeSymbol* _tmp66_; |
| 19029 | gchar* _tmp67_; |
| 19030 | gchar* _tmp68_; |
| 19031 | gchar* _tmp69_; |
| 19032 | gchar* _tmp70_; |
| 19033 | _tmp63_ = bala_code_node_get_source_reference ((BalaCodeNode*) type); |
| 19034 | _tmp64_ = _tmp63_; |
| 19035 | _tmp65_ = bala_data_type_get_type_symbol (type); |
| 19036 | _tmp66_ = _tmp65_; |
| 19037 | _tmp67_ = bala_symbol_get_full_name ((BalaSymbol*) _tmp66_); |
| 19038 | _tmp68_ = _tmp67_; |
| 19039 | _tmp69_ = g_strdup_printf ("missing class prerequisite for interface `%s', add GLib.Object to inte" \ |
| 19040 | "rface declaration if unsure", _tmp68_); |
| 19041 | _tmp70_ = _tmp69_; |
| 19042 | bala_report_error (_tmp64_, _tmp70_); |
| 19043 | _g_free0 (_tmp70_)(_tmp70_ = (g_free (_tmp70_), ((void*)0))); |
| 19044 | _g_free0 (_tmp68_)(_tmp68_ = (g_free (_tmp68_), ((void*)0))); |
| 19045 | result = NULL((void*)0); |
| 19046 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19047 | return result; |
| 19048 | } |
| 19049 | } else { |
| 19050 | BalaTypeSymbol* _tmp71_; |
| 19051 | BalaTypeSymbol* _tmp72_; |
| 19052 | _tmp71_ = bala_data_type_get_type_symbol (type); |
| 19053 | _tmp72_ = _tmp71_; |
| 19054 | if (bala_get_ccode_is_gboxed (_tmp72_)) { |
| 19055 | gchar* _tmp73_; |
| 19056 | _tmp73_ = bala_ccode_base_module_generate_free_func_wrapper (self, type); |
| 19057 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19058 | unref_function = _tmp73_; |
| 19059 | } else { |
| 19060 | if (bala_is_free_function_address_of (type)) { |
| 19061 | gchar* _tmp74_; |
| 19062 | _tmp74_ = bala_ccode_base_module_generate_free_function_address_of_wrapper (self, type); |
| 19063 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19064 | unref_function = _tmp74_; |
| 19065 | } else { |
| 19066 | BalaTypeSymbol* _tmp75_; |
| 19067 | BalaTypeSymbol* _tmp76_; |
| 19068 | gchar* _tmp77_; |
| 19069 | _tmp75_ = bala_data_type_get_type_symbol (type); |
| 19070 | _tmp76_ = _tmp75_; |
| 19071 | _tmp77_ = bala_get_ccode_free_function (_tmp76_); |
| 19072 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19073 | unref_function = _tmp77_; |
| 19074 | } |
| 19075 | } |
| 19076 | } |
| 19077 | } else { |
| 19078 | gboolean _tmp78_; |
| 19079 | gboolean _tmp79_; |
| 19080 | _tmp78_ = bala_data_type_get_nullable (type); |
| 19081 | _tmp79_ = _tmp78_; |
| 19082 | if (_tmp79_) { |
| 19083 | BalaTypeSymbol* _tmp80_; |
| 19084 | BalaTypeSymbol* _tmp81_; |
| 19085 | const gchar* _tmp86_; |
| 19086 | _tmp80_ = bala_data_type_get_type_symbol (type); |
| 19087 | _tmp81_ = _tmp80_; |
| 19088 | if (bala_get_ccode_is_gboxed (_tmp81_)) { |
| 19089 | gchar* _tmp82_; |
| 19090 | _tmp82_ = bala_ccode_base_module_generate_free_func_wrapper (self, type); |
| 19091 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19092 | unref_function = _tmp82_; |
| 19093 | } else { |
| 19094 | BalaTypeSymbol* _tmp83_; |
| 19095 | BalaTypeSymbol* _tmp84_; |
| 19096 | gchar* _tmp85_; |
| 19097 | _tmp83_ = bala_data_type_get_type_symbol (type); |
| 19098 | _tmp84_ = _tmp83_; |
| 19099 | _tmp85_ = bala_get_ccode_free_function (_tmp84_); |
| 19100 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19101 | unref_function = _tmp85_; |
| 19102 | } |
| 19103 | _tmp86_ = unref_function; |
| 19104 | if (_tmp86_ == NULL((void*)0)) { |
| 19105 | gboolean _tmp87_ = FALSE(0); |
| 19106 | BalaTypeSymbol* _tmp88_; |
| 19107 | BalaTypeSymbol* _tmp89_; |
| 19108 | _tmp88_ = bala_data_type_get_type_symbol (type); |
| 19109 | _tmp89_ = _tmp88_; |
| 19110 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp89_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp89_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 19111 | BalaTypeSymbol* _tmp90_; |
| 19112 | BalaTypeSymbol* _tmp91_; |
| 19113 | _tmp90_ = bala_data_type_get_type_symbol (type); |
| 19114 | _tmp91_ = _tmp90_; |
| 19115 | _tmp87_ = bala_struct_is_disposable (G_TYPE_CHECK_INSTANCE_CAST (_tmp91_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp91_), ((bala_struct_get_type ())))))); |
| 19116 | } else { |
| 19117 | _tmp87_ = FALSE(0); |
| 19118 | } |
| 19119 | if (_tmp87_) { |
| 19120 | gchar* _tmp92_; |
| 19121 | _tmp92_ = bala_ccode_base_module_generate_free_func_wrapper (self, type); |
| 19122 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19123 | unref_function = _tmp92_; |
| 19124 | } else { |
| 19125 | BalaCodeContext* _tmp93_; |
| 19126 | BalaProfile _tmp94_; |
| 19127 | BalaProfile _tmp95_; |
| 19128 | _tmp93_ = self->priv->_context; |
| 19129 | _tmp94_ = bala_code_context_get_profile (_tmp93_); |
| 19130 | _tmp95_ = _tmp94_; |
| 19131 | if (_tmp95_ == BALA_PROFILE_POSIX) { |
| 19132 | BalaCCodeFile* _tmp96_; |
| 19133 | gchar* _tmp97_; |
| 19134 | _tmp96_ = self->cfile; |
| 19135 | bala_ccode_file_add_include (_tmp96_, "stdlib.h", FALSE(0)); |
| 19136 | _tmp97_ = g_strdup ("free"); |
| 19137 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19138 | unref_function = _tmp97_; |
| 19139 | } else { |
| 19140 | BalaCCodeFile* _tmp98_; |
| 19141 | gchar* _tmp99_; |
| 19142 | _tmp98_ = self->cfile; |
| 19143 | bala_ccode_file_add_include (_tmp98_, "glib.h", FALSE(0)); |
| 19144 | _tmp99_ = g_strdup ("g_free"); |
| 19145 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19146 | unref_function = _tmp99_; |
| 19147 | } |
| 19148 | } |
| 19149 | } |
| 19150 | } else { |
| 19151 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ENUM_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_enum_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 19152 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19153 | unref_function = NULL((void*)0); |
| 19154 | } else { |
| 19155 | BalaStruct* st = NULL((void*)0); |
| 19156 | BalaTypeSymbol* _tmp100_; |
| 19157 | BalaTypeSymbol* _tmp101_; |
| 19158 | gboolean _tmp102_ = FALSE(0); |
| 19159 | BalaStruct* _tmp103_; |
| 19160 | _tmp100_ = bala_data_type_get_type_symbol (type); |
| 19161 | _tmp101_ = _tmp100_; |
| 19162 | st = G_TYPE_CHECK_INSTANCE_TYPE (_tmp101_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp101_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp101_) : NULL((void*)0); |
| 19163 | _tmp103_ = st; |
| 19164 | if (_tmp103_ != NULL((void*)0)) { |
| 19165 | BalaStruct* _tmp104_; |
| 19166 | _tmp104_ = st; |
| 19167 | _tmp102_ = bala_struct_is_disposable (_tmp104_); |
| 19168 | } else { |
| 19169 | _tmp102_ = FALSE(0); |
| 19170 | } |
| 19171 | if (_tmp102_) { |
| 19172 | BalaStruct* _tmp105_; |
| 19173 | BalaStruct* _tmp107_; |
| 19174 | gchar* _tmp108_; |
| 19175 | _tmp105_ = st; |
| 19176 | if (!bala_get_ccode_has_destroy_function (_tmp105_)) { |
| 19177 | BalaStruct* _tmp106_; |
| 19178 | _tmp106_ = st; |
| 19179 | bala_ccode_base_module_generate_struct_destroy_function (self, _tmp106_); |
| 19180 | } |
| 19181 | _tmp107_ = st; |
| 19182 | _tmp108_ = bala_get_ccode_destroy_function ((BalaTypeSymbol*) _tmp107_); |
| 19183 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19184 | unref_function = _tmp108_; |
| 19185 | } else { |
| 19186 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19187 | unref_function = NULL((void*)0); |
| 19188 | } |
| 19189 | } |
| 19190 | } |
| 19191 | } |
| 19192 | _tmp109_ = unref_function; |
| 19193 | if (_tmp109_ == NULL((void*)0)) { |
| 19194 | BalaCCodeConstant* _tmp110_; |
| 19195 | _tmp110_ = bala_ccode_constant_new ("NULL"); |
| 19196 | result = (BalaCCodeExpression*) _tmp110_; |
| 19197 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19198 | return result; |
| 19199 | } |
| 19200 | _tmp111_ = unref_function; |
| 19201 | _tmp112_ = bala_ccode_identifier_new (_tmp111_); |
| 19202 | result = (BalaCCodeExpression*) _tmp112_; |
| 19203 | _g_free0 (unref_function)(unref_function = (g_free (unref_function), ((void*)0))); |
| 19204 | return result; |
| 19205 | } else { |
| 19206 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 19207 | BalaTypeParameter* type_parameter = NULL((void*)0); |
| 19208 | BalaTypeParameter* _tmp113_; |
| 19209 | BalaTypeParameter* _tmp114_; |
| 19210 | BalaTypeParameter* _tmp115_; |
| 19211 | gchar* func_name = NULL((void*)0); |
| 19212 | BalaTypeParameter* _tmp116_; |
| 19213 | const gchar* _tmp117_; |
| 19214 | const gchar* _tmp118_; |
| 19215 | gchar* _tmp119_; |
| 19216 | gchar* _tmp120_; |
| 19217 | gchar* _tmp121_; |
| 19218 | gchar* _tmp122_; |
| 19219 | BalaTypeParameter* _tmp123_; |
| 19220 | BalaSymbol* _tmp124_; |
| 19221 | BalaSymbol* _tmp125_; |
| 19222 | gboolean _tmp157_ = FALSE(0); |
| 19223 | gboolean _tmp158_ = FALSE(0); |
| 19224 | _tmp113_ = bala_generic_type_get_type_parameter (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_GENERIC_TYPE, BalaGenericType)(((BalaGenericType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_generic_type_get_type ())))))); |
| 19225 | _tmp114_ = _tmp113_; |
| 19226 | _tmp115_ = _bala_code_node_ref0 (_tmp114_); |
| 19227 | type_parameter = _tmp115_; |
| 19228 | _tmp116_ = type_parameter; |
| 19229 | _tmp117_ = bala_symbol_get_name ((BalaSymbol*) _tmp116_); |
| 19230 | _tmp118_ = _tmp117_; |
| 19231 | _tmp119_ = g_ascii_strdown (_tmp118_, (gssize) -1); |
| 19232 | _tmp120_ = _tmp119_; |
| 19233 | _tmp121_ = g_strdup_printf ("%s_destroy_func", _tmp120_); |
| 19234 | _tmp122_ = _tmp121_; |
| 19235 | _g_free0 (_tmp120_)(_tmp120_ = (g_free (_tmp120_), ((void*)0))); |
| 19236 | func_name = _tmp122_; |
| 19237 | _tmp123_ = type_parameter; |
| 19238 | _tmp124_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp123_); |
| 19239 | _tmp125_ = _tmp124_; |
| 19240 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp125_, BALA_TYPE_INTERFACE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp125_); GType __t = ((bala_interface_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 19241 | BalaInterface* iface = NULL((void*)0); |
| 19242 | BalaTypeParameter* _tmp126_; |
| 19243 | BalaSymbol* _tmp127_; |
| 19244 | BalaSymbol* _tmp128_; |
| 19245 | BalaInterface* _tmp129_; |
| 19246 | BalaInterface* _tmp130_; |
| 19247 | gchar* method_name = NULL((void*)0); |
| 19248 | BalaTypeParameter* _tmp131_; |
| 19249 | const gchar* _tmp132_; |
| 19250 | const gchar* _tmp133_; |
| 19251 | gchar* _tmp134_; |
| 19252 | gchar* _tmp135_; |
| 19253 | gchar* _tmp136_; |
| 19254 | gchar* _tmp137_; |
| 19255 | BalaCCodeFunctionCall* cast_self = NULL((void*)0); |
| 19256 | BalaInterface* _tmp138_; |
| 19257 | gchar* _tmp139_; |
| 19258 | gchar* _tmp140_; |
| 19259 | BalaCCodeIdentifier* _tmp141_; |
| 19260 | BalaCCodeIdentifier* _tmp142_; |
| 19261 | BalaCCodeFunctionCall* _tmp143_; |
| 19262 | BalaCCodeFunctionCall* _tmp144_; |
| 19263 | BalaCCodeFunctionCall* _tmp145_; |
| 19264 | BalaCCodeExpression* _tmp146_; |
| 19265 | BalaCCodeExpression* _tmp147_; |
| 19266 | BalaCCodeFunctionCall* function_call = NULL((void*)0); |
| 19267 | BalaCCodeFunctionCall* _tmp148_; |
| 19268 | const gchar* _tmp149_; |
| 19269 | BalaCCodeMemberAccess* _tmp150_; |
| 19270 | BalaCCodeMemberAccess* _tmp151_; |
| 19271 | BalaCCodeFunctionCall* _tmp152_; |
| 19272 | BalaCCodeFunctionCall* _tmp153_; |
| 19273 | BalaCCodeFunctionCall* _tmp154_; |
| 19274 | BalaCCodeExpression* _tmp155_; |
| 19275 | BalaCCodeExpression* _tmp156_; |
| 19276 | _tmp126_ = type_parameter; |
| 19277 | _tmp127_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp126_); |
| 19278 | _tmp128_ = _tmp127_; |
| 19279 | _tmp129_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp128_, BALA_TYPE_INTERFACE, BalaInterface)(((BalaInterface*) g_type_check_instance_cast ((GTypeInstance *) (_tmp128_), ((bala_interface_get_type ())))))); |
| 19280 | iface = _tmp129_; |
| 19281 | _tmp130_ = iface; |
| 19282 | bala_ccode_base_module_require_generic_accessors (self, _tmp130_); |
| 19283 | _tmp131_ = type_parameter; |
| 19284 | _tmp132_ = bala_symbol_get_name ((BalaSymbol*) _tmp131_); |
| 19285 | _tmp133_ = _tmp132_; |
| 19286 | _tmp134_ = g_ascii_strdown (_tmp133_, (gssize) -1); |
| 19287 | _tmp135_ = _tmp134_; |
| 19288 | _tmp136_ = g_strdup_printf ("get_%s_destroy_func", _tmp135_); |
| 19289 | _tmp137_ = _tmp136_; |
| 19290 | _g_free0 (_tmp135_)(_tmp135_ = (g_free (_tmp135_), ((void*)0))); |
| 19291 | method_name = _tmp137_; |
| 19292 | _tmp138_ = iface; |
| 19293 | _tmp139_ = bala_get_ccode_type_get_function ((BalaObjectTypeSymbol*) _tmp138_); |
| 19294 | _tmp140_ = _tmp139_; |
| 19295 | _tmp141_ = bala_ccode_identifier_new (_tmp140_); |
| 19296 | _tmp142_ = _tmp141_; |
| 19297 | _tmp143_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp142_); |
| 19298 | _tmp144_ = _tmp143_; |
| 19299 | _bala_ccode_node_unref0 (_tmp142_)((_tmp142_ == ((void*)0)) ? ((void*)0) : (_tmp142_ = (bala_ccode_node_unref (_tmp142_), ((void*)0)))); |
| 19300 | _g_free0 (_tmp140_)(_tmp140_ = (g_free (_tmp140_), ((void*)0))); |
| 19301 | cast_self = _tmp144_; |
| 19302 | _tmp145_ = cast_self; |
| 19303 | _tmp146_ = bala_ccode_base_module_get_this_cexpression (self); |
| 19304 | _tmp147_ = _tmp146_; |
| 19305 | bala_ccode_function_call_add_argument (_tmp145_, _tmp147_); |
| 19306 | _bala_ccode_node_unref0 (_tmp147_)((_tmp147_ == ((void*)0)) ? ((void*)0) : (_tmp147_ = (bala_ccode_node_unref (_tmp147_), ((void*)0)))); |
| 19307 | _tmp148_ = cast_self; |
| 19308 | _tmp149_ = method_name; |
| 19309 | _tmp150_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp148_, _tmp149_); |
| 19310 | _tmp151_ = _tmp150_; |
| 19311 | _tmp152_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp151_); |
| 19312 | _tmp153_ = _tmp152_; |
| 19313 | _bala_ccode_node_unref0 (_tmp151_)((_tmp151_ == ((void*)0)) ? ((void*)0) : (_tmp151_ = (bala_ccode_node_unref (_tmp151_), ((void*)0)))); |
| 19314 | function_call = _tmp153_; |
| 19315 | _tmp154_ = function_call; |
| 19316 | _tmp155_ = bala_ccode_base_module_get_this_cexpression (self); |
| 19317 | _tmp156_ = _tmp155_; |
| 19318 | bala_ccode_function_call_add_argument (_tmp154_, _tmp156_); |
| 19319 | _bala_ccode_node_unref0 (_tmp156_)((_tmp156_ == ((void*)0)) ? ((void*)0) : (_tmp156_ = (bala_ccode_node_unref (_tmp156_), ((void*)0)))); |
| 19320 | result = (BalaCCodeExpression*) function_call; |
| 19321 | _bala_ccode_node_unref0 (cast_self)((cast_self == ((void*)0)) ? ((void*)0) : (cast_self = (bala_ccode_node_unref (cast_self), ((void*)0)))); |
| 19322 | _g_free0 (method_name)(method_name = (g_free (method_name), ((void*)0))); |
| 19323 | _bala_code_node_unref0 (iface)((iface == ((void*)0)) ? ((void*)0) : (iface = (bala_code_node_unref (iface), ((void*)0)))); |
| 19324 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 19325 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 19326 | return result; |
| 19327 | } |
| 19328 | if (bala_ccode_base_module_is_in_generic_type (self, G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_GENERIC_TYPE, BalaGenericType)(((BalaGenericType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_generic_type_get_type ()))))))) { |
| 19329 | _tmp158_ = !is_chainup; |
| 19330 | } else { |
| 19331 | _tmp158_ = FALSE(0); |
| 19332 | } |
| 19333 | if (_tmp158_) { |
| 19334 | gboolean _tmp159_; |
| 19335 | gboolean _tmp160_; |
| 19336 | _tmp159_ = bala_ccode_base_module_get_in_creation_method (self); |
| 19337 | _tmp160_ = _tmp159_; |
| 19338 | _tmp157_ = !_tmp160_; |
| 19339 | } else { |
| 19340 | _tmp157_ = FALSE(0); |
| 19341 | } |
| 19342 | if (_tmp157_) { |
| 19343 | BalaCCodeExpression* _tmp161_; |
| 19344 | BalaCCodeExpression* _tmp162_; |
| 19345 | BalaCCodeMemberAccess* _tmp163_; |
| 19346 | BalaCCodeMemberAccess* _tmp164_; |
| 19347 | const gchar* _tmp165_; |
| 19348 | BalaCCodeMemberAccess* _tmp166_; |
| 19349 | BalaCCodeExpression* _tmp167_; |
| 19350 | _tmp161_ = bala_ccode_base_module_get_this_cexpression (self); |
| 19351 | _tmp162_ = _tmp161_; |
| 19352 | _tmp163_ = bala_ccode_member_access_new_pointer (_tmp162_, "priv"); |
| 19353 | _tmp164_ = _tmp163_; |
| 19354 | _tmp165_ = func_name; |
| 19355 | _tmp166_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp164_, _tmp165_); |
| 19356 | _tmp167_ = (BalaCCodeExpression*) _tmp166_; |
| 19357 | _bala_ccode_node_unref0 (_tmp164_)((_tmp164_ == ((void*)0)) ? ((void*)0) : (_tmp164_ = (bala_ccode_node_unref (_tmp164_), ((void*)0)))); |
| 19358 | _bala_ccode_node_unref0 (_tmp162_)((_tmp162_ == ((void*)0)) ? ((void*)0) : (_tmp162_ = (bala_ccode_node_unref (_tmp162_), ((void*)0)))); |
| 19359 | result = _tmp167_; |
| 19360 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 19361 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 19362 | return result; |
| 19363 | } else { |
| 19364 | const gchar* _tmp168_; |
| 19365 | BalaCCodeExpression* _tmp169_; |
| 19366 | _tmp168_ = func_name; |
| 19367 | _tmp169_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp168_); |
| 19368 | result = _tmp169_; |
| 19369 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 19370 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 19371 | return result; |
| 19372 | } |
| 19373 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 19374 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 19375 | } else { |
| 19376 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_array_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 19377 | BalaCodeContext* _tmp170_; |
| 19378 | BalaProfile _tmp171_; |
| 19379 | BalaProfile _tmp172_; |
| 19380 | _tmp170_ = self->priv->_context; |
| 19381 | _tmp171_ = bala_code_context_get_profile (_tmp170_); |
| 19382 | _tmp172_ = _tmp171_; |
| 19383 | if (_tmp172_ == BALA_PROFILE_POSIX) { |
| 19384 | BalaCCodeFile* _tmp173_; |
| 19385 | BalaCCodeIdentifier* _tmp174_; |
| 19386 | _tmp173_ = self->cfile; |
| 19387 | bala_ccode_file_add_include (_tmp173_, "stdlib.h", FALSE(0)); |
| 19388 | _tmp174_ = bala_ccode_identifier_new ("free"); |
| 19389 | result = (BalaCCodeExpression*) _tmp174_; |
| 19390 | return result; |
| 19391 | } else { |
| 19392 | BalaCCodeFile* _tmp175_; |
| 19393 | BalaCCodeIdentifier* _tmp176_; |
| 19394 | _tmp175_ = self->cfile; |
| 19395 | bala_ccode_file_add_include (_tmp175_, "glib.h", FALSE(0)); |
| 19396 | _tmp176_ = bala_ccode_identifier_new ("g_free"); |
| 19397 | result = (BalaCCodeExpression*) _tmp176_; |
| 19398 | return result; |
| 19399 | } |
| 19400 | } else { |
| 19401 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_POINTER_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_pointer_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 19402 | BalaCodeContext* _tmp177_; |
| 19403 | BalaProfile _tmp178_; |
| 19404 | BalaProfile _tmp179_; |
| 19405 | _tmp177_ = self->priv->_context; |
| 19406 | _tmp178_ = bala_code_context_get_profile (_tmp177_); |
| 19407 | _tmp179_ = _tmp178_; |
| 19408 | if (_tmp179_ == BALA_PROFILE_POSIX) { |
| 19409 | BalaCCodeFile* _tmp180_; |
| 19410 | BalaCCodeIdentifier* _tmp181_; |
| 19411 | _tmp180_ = self->cfile; |
| 19412 | bala_ccode_file_add_include (_tmp180_, "stdlib.h", FALSE(0)); |
| 19413 | _tmp181_ = bala_ccode_identifier_new ("free"); |
| 19414 | result = (BalaCCodeExpression*) _tmp181_; |
| 19415 | return result; |
| 19416 | } else { |
| 19417 | BalaCCodeFile* _tmp182_; |
| 19418 | BalaCCodeIdentifier* _tmp183_; |
| 19419 | _tmp182_ = self->cfile; |
| 19420 | bala_ccode_file_add_include (_tmp182_, "glib.h", FALSE(0)); |
| 19421 | _tmp183_ = bala_ccode_identifier_new ("g_free"); |
| 19422 | result = (BalaCCodeExpression*) _tmp183_; |
| 19423 | return result; |
| 19424 | } |
| 19425 | } else { |
| 19426 | BalaCCodeConstant* _tmp184_; |
| 19427 | _tmp184_ = bala_ccode_constant_new ("NULL"); |
| 19428 | result = (BalaCCodeExpression*) _tmp184_; |
| 19429 | return result; |
| 19430 | } |
| 19431 | } |
| 19432 | } |
| 19433 | } |
| 19434 | } |
| 19435 | } |
| 19436 | } |
| 19437 | |
| 19438 | static gchar* |
| 19439 | bala_ccode_base_module_generate_collection_free_wrapper (BalaCCodeBaseModule* self, |
| 19440 | BalaDataType* collection_type, |
| 19441 | BalaCCodeIdentifier* element_destroy_func_expression) |
| 19442 | { |
| 19443 | gchar* destroy_func = NULL((void*)0); |
| 19444 | gchar* destroy_func_wrapper = NULL((void*)0); |
| 19445 | BalaTypeSymbol* _tmp8_; |
| 19446 | BalaTypeSymbol* _tmp9_; |
| 19447 | BalaClass* _tmp10_; |
| 19448 | gchar* result = NULL((void*)0); |
| 19449 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 19450 | g_return_val_if_fail (collection_type != NULL, NULL)do { if ((collection_type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "collection_type != NULL" ); return (((void*)0)); } } while (0); |
| 19451 | destroy_func_wrapper = NULL((void*)0); |
| 19452 | if (element_destroy_func_expression != NULL((void*)0)) { |
| 19453 | BalaTypeSymbol* _tmp0_; |
| 19454 | BalaTypeSymbol* _tmp1_; |
| 19455 | gchar* _tmp2_; |
| 19456 | gchar* _tmp3_; |
| 19457 | const gchar* _tmp4_; |
| 19458 | const gchar* _tmp5_; |
| 19459 | gchar* _tmp6_; |
| 19460 | const gchar* _tmp7_; |
| 19461 | _tmp0_ = bala_data_type_get_type_symbol (collection_type); |
| 19462 | _tmp1_ = _tmp0_; |
| 19463 | _tmp2_ = bala_get_ccode_free_function (_tmp1_); |
| 19464 | _tmp3_ = _tmp2_; |
| 19465 | _tmp4_ = bala_ccode_identifier_get_name (element_destroy_func_expression); |
| 19466 | _tmp5_ = _tmp4_; |
| 19467 | _tmp6_ = g_strdup_printf ("_%s_%s", _tmp3_, _tmp5_); |
| 19468 | _g_free0 (destroy_func_wrapper)(destroy_func_wrapper = (g_free (destroy_func_wrapper), ((void *)0))); |
| 19469 | destroy_func_wrapper = _tmp6_; |
| 19470 | _g_free0 (_tmp3_)(_tmp3_ = (g_free (_tmp3_), ((void*)0))); |
| 19471 | _tmp7_ = destroy_func_wrapper; |
| 19472 | if (!bala_ccode_base_module_add_wrapper (self, _tmp7_)) { |
| 19473 | result = destroy_func_wrapper; |
| 19474 | _g_free0 (destroy_func)(destroy_func = (g_free (destroy_func), ((void*)0))); |
| 19475 | return result; |
| 19476 | } |
| 19477 | } |
| 19478 | _tmp8_ = bala_data_type_get_type_symbol (collection_type); |
| 19479 | _tmp9_ = _tmp8_; |
| 19480 | _tmp10_ = self->gnode_type; |
| 19481 | if (_tmp9_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp10_), ((bala_typesymbol_get_type ())))))) { |
| 19482 | gchar* _tmp11_; |
| 19483 | const gchar* _tmp12_; |
| 19484 | BalaCCodeFunction* function = NULL((void*)0); |
| 19485 | const gchar* _tmp13_; |
| 19486 | BalaCCodeFunction* _tmp14_; |
| 19487 | BalaCCodeFunction* _tmp15_; |
| 19488 | gchar* _tmp16_; |
| 19489 | gchar* _tmp17_; |
| 19490 | BalaCCodeParameter* _tmp18_; |
| 19491 | BalaCCodeParameter* _tmp19_; |
| 19492 | BalaCCodeFunction* _tmp20_; |
| 19493 | BalaCCodeParameter* _tmp21_; |
| 19494 | BalaCCodeParameter* _tmp22_; |
| 19495 | BalaCCodeFunction* _tmp23_; |
| 19496 | BalaCCodeFunctionCall* element_free_call = NULL((void*)0); |
| 19497 | gchar* destroy_node_func = NULL((void*)0); |
| 19498 | const gchar* _tmp24_; |
| 19499 | gchar* _tmp25_; |
| 19500 | BalaCCodeFunction* wrapper = NULL((void*)0); |
| 19501 | const gchar* _tmp26_; |
| 19502 | BalaDataType* _tmp27_; |
| 19503 | gchar* _tmp28_; |
| 19504 | gchar* _tmp29_; |
| 19505 | BalaCCodeFunction* _tmp30_; |
| 19506 | BalaCCodeFunction* _tmp31_; |
| 19507 | BalaCCodeFunction* _tmp32_; |
| 19508 | BalaCCodeFunction* _tmp33_; |
| 19509 | gchar* _tmp34_; |
| 19510 | gchar* _tmp35_; |
| 19511 | BalaCCodeParameter* _tmp36_; |
| 19512 | BalaCCodeParameter* _tmp37_; |
| 19513 | BalaCCodeFunction* _tmp38_; |
| 19514 | BalaCCodeParameter* _tmp39_; |
| 19515 | BalaCCodeParameter* _tmp40_; |
| 19516 | BalaCCodeFunction* _tmp41_; |
| 19517 | BalaCCodeFunctionCall* free_call = NULL((void*)0); |
| 19518 | BalaCCodeIdentifier* _tmp42_; |
| 19519 | BalaCCodeIdentifier* _tmp43_; |
| 19520 | BalaCCodeFunctionCall* _tmp44_; |
| 19521 | BalaCCodeFunctionCall* _tmp45_; |
| 19522 | BalaCCodeFunctionCall* _tmp46_; |
| 19523 | BalaCCodeIdentifier* _tmp47_; |
| 19524 | BalaCCodeIdentifier* _tmp48_; |
| 19525 | BalaCCodeMemberAccess* _tmp49_; |
| 19526 | BalaCCodeMemberAccess* _tmp50_; |
| 19527 | BalaCCodeBinaryExpression* data_isnull = NULL((void*)0); |
| 19528 | BalaCCodeIdentifier* _tmp51_; |
| 19529 | BalaCCodeIdentifier* _tmp52_; |
| 19530 | BalaCCodeMemberAccess* _tmp53_; |
| 19531 | BalaCCodeMemberAccess* _tmp54_; |
| 19532 | BalaCCodeConstant* _tmp55_; |
| 19533 | BalaCCodeConstant* _tmp56_; |
| 19534 | BalaCCodeBinaryExpression* _tmp57_; |
| 19535 | BalaCCodeBinaryExpression* _tmp58_; |
| 19536 | BalaCCodeCommaExpression* ccomma_data = NULL((void*)0); |
| 19537 | BalaCCodeCommaExpression* _tmp59_; |
| 19538 | BalaCCodeCommaExpression* _tmp60_; |
| 19539 | BalaCCodeBinaryExpression* _tmp61_; |
| 19540 | BalaCCodeConstant* _tmp62_; |
| 19541 | BalaCCodeConstant* _tmp63_; |
| 19542 | BalaCCodeFunctionCall* _tmp64_; |
| 19543 | BalaCCodeConditionalExpression* _tmp65_; |
| 19544 | BalaCCodeConditionalExpression* _tmp66_; |
| 19545 | BalaCCodeFunction* _tmp67_; |
| 19546 | BalaCCodeFunction* _tmp68_; |
| 19547 | BalaCCodeCommaExpression* _tmp69_; |
| 19548 | BalaCCodeFunction* _tmp70_; |
| 19549 | BalaCCodeFunction* _tmp71_; |
| 19550 | BalaCCodeConstant* _tmp72_; |
| 19551 | BalaCCodeConstant* _tmp73_; |
| 19552 | BalaCCodeFile* _tmp74_; |
| 19553 | BalaCCodeFunction* _tmp75_; |
| 19554 | BalaCCodeFile* _tmp76_; |
| 19555 | BalaCCodeFunction* _tmp77_; |
| 19556 | BalaCCodeIdentifier* _tmp78_; |
| 19557 | BalaCCodeIdentifier* _tmp79_; |
| 19558 | BalaCCodeFunctionCall* _tmp80_; |
| 19559 | BalaCCodeFunctionCall* _tmp81_; |
| 19560 | BalaCCodeIdentifier* _tmp82_; |
| 19561 | BalaCCodeIdentifier* _tmp83_; |
| 19562 | BalaCCodeFunctionCall* _tmp84_; |
| 19563 | BalaCCodeConstant* _tmp85_; |
| 19564 | BalaCCodeConstant* _tmp86_; |
| 19565 | BalaCCodeFunctionCall* _tmp87_; |
| 19566 | BalaCCodeConstant* _tmp88_; |
| 19567 | BalaCCodeConstant* _tmp89_; |
| 19568 | BalaCCodeFunctionCall* _tmp90_; |
| 19569 | BalaCCodeConstant* _tmp91_; |
| 19570 | BalaCCodeConstant* _tmp92_; |
| 19571 | BalaCCodeFunctionCall* _tmp93_; |
| 19572 | const gchar* _tmp94_; |
| 19573 | BalaCCodeIdentifier* _tmp95_; |
| 19574 | BalaCCodeIdentifier* _tmp96_; |
| 19575 | BalaCCodeCastExpression* _tmp97_; |
| 19576 | BalaCCodeCastExpression* _tmp98_; |
| 19577 | BalaCCodeFunctionCall* _tmp99_; |
| 19578 | BalaCCodeIdentifier* _tmp100_; |
| 19579 | BalaCCodeIdentifier* _tmp101_; |
| 19580 | BalaCCodeBinaryExpression* free_func_isnull = NULL((void*)0); |
| 19581 | BalaCCodeIdentifier* _tmp102_; |
| 19582 | BalaCCodeIdentifier* _tmp103_; |
| 19583 | BalaCCodeConstant* _tmp104_; |
| 19584 | BalaCCodeConstant* _tmp105_; |
| 19585 | BalaCCodeBinaryExpression* _tmp106_; |
| 19586 | BalaCCodeBinaryExpression* _tmp107_; |
| 19587 | BalaCCodeCommaExpression* ccomma = NULL((void*)0); |
| 19588 | BalaCCodeCommaExpression* _tmp108_; |
| 19589 | BalaCCodeCommaExpression* _tmp109_; |
| 19590 | BalaCCodeBinaryExpression* _tmp110_; |
| 19591 | BalaCCodeConstant* _tmp111_; |
| 19592 | BalaCCodeConstant* _tmp112_; |
| 19593 | BalaCCodeFunctionCall* _tmp113_; |
| 19594 | BalaCCodeConditionalExpression* _tmp114_; |
| 19595 | BalaCCodeConditionalExpression* _tmp115_; |
| 19596 | BalaCCodeFunction* _tmp116_; |
| 19597 | BalaCCodeFunction* _tmp117_; |
| 19598 | BalaCCodeCommaExpression* _tmp118_; |
| 19599 | BalaCCodeFunctionCall* cfreecall = NULL((void*)0); |
| 19600 | BalaClass* _tmp119_; |
| 19601 | gchar* _tmp120_; |
| 19602 | gchar* _tmp121_; |
| 19603 | BalaCCodeIdentifier* _tmp122_; |
| 19604 | BalaCCodeIdentifier* _tmp123_; |
| 19605 | BalaCCodeFunctionCall* _tmp124_; |
| 19606 | BalaCCodeFunctionCall* _tmp125_; |
| 19607 | BalaCCodeFunctionCall* _tmp126_; |
| 19608 | BalaCCodeIdentifier* _tmp127_; |
| 19609 | BalaCCodeIdentifier* _tmp128_; |
| 19610 | BalaCCodeFunction* _tmp129_; |
| 19611 | BalaCCodeFunction* _tmp130_; |
| 19612 | BalaCCodeFunctionCall* _tmp131_; |
| 19613 | BalaCCodeFunction* _tmp132_; |
| 19614 | BalaCCodeFile* _tmp133_; |
| 19615 | BalaCCodeFunction* _tmp134_; |
| 19616 | BalaCCodeFile* _tmp135_; |
| 19617 | BalaCCodeFunction* _tmp136_; |
| 19618 | _tmp11_ = g_strdup ("_g_node_free_all"); |
| 19619 | _g_free0 (destroy_func)(destroy_func = (g_free (destroy_func), ((void*)0))); |
| 19620 | destroy_func = _tmp11_; |
| 19621 | _tmp12_ = destroy_func; |
| 19622 | if (!bala_ccode_base_module_add_wrapper (self, _tmp12_)) { |
| 19623 | result = destroy_func; |
| 19624 | _g_free0 (destroy_func_wrapper)(destroy_func_wrapper = (g_free (destroy_func_wrapper), ((void *)0))); |
| 19625 | return result; |
| 19626 | } |
| 19627 | _tmp13_ = destroy_func; |
| 19628 | _tmp14_ = bala_ccode_function_new (_tmp13_, "void"); |
| 19629 | function = _tmp14_; |
| 19630 | _tmp15_ = function; |
| 19631 | _tmp16_ = bala_get_ccode_name ((BalaCodeNode*) collection_type); |
| 19632 | _tmp17_ = _tmp16_; |
| 19633 | _tmp18_ = bala_ccode_parameter_new ("self", _tmp17_); |
| 19634 | _tmp19_ = _tmp18_; |
| 19635 | bala_ccode_function_add_parameter (_tmp15_, _tmp19_); |
| 19636 | _bala_ccode_node_unref0 (_tmp19_)((_tmp19_ == ((void*)0)) ? ((void*)0) : (_tmp19_ = (bala_ccode_node_unref (_tmp19_), ((void*)0)))); |
| 19637 | _g_free0 (_tmp17_)(_tmp17_ = (g_free (_tmp17_), ((void*)0))); |
| 19638 | _tmp20_ = function; |
| 19639 | _tmp21_ = bala_ccode_parameter_new ("free_func", "GDestroyNotify"); |
| 19640 | _tmp22_ = _tmp21_; |
| 19641 | bala_ccode_function_add_parameter (_tmp20_, _tmp22_); |
| 19642 | _bala_ccode_node_unref0 (_tmp22_)((_tmp22_ == ((void*)0)) ? ((void*)0) : (_tmp22_ = (bala_ccode_node_unref (_tmp22_), ((void*)0)))); |
| 19643 | _tmp23_ = function; |
| 19644 | bala_ccode_base_module_push_function (self, _tmp23_); |
| 19645 | _tmp24_ = destroy_func; |
| 19646 | _tmp25_ = g_strdup_printf ("%s_node", _tmp24_); |
| 19647 | destroy_node_func = _tmp25_; |
| 19648 | _tmp26_ = destroy_node_func; |
| 19649 | _tmp27_ = self->bool_type; |
| 19650 | _tmp28_ = bala_get_ccode_name ((BalaCodeNode*) _tmp27_); |
| 19651 | _tmp29_ = _tmp28_; |
| 19652 | _tmp30_ = bala_ccode_function_new (_tmp26_, _tmp29_); |
| 19653 | _tmp31_ = _tmp30_; |
| 19654 | _g_free0 (_tmp29_)(_tmp29_ = (g_free (_tmp29_), ((void*)0))); |
| 19655 | wrapper = _tmp31_; |
| 19656 | _tmp32_ = wrapper; |
| 19657 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp32_, BALA_CCODE_MODIFIERS_STATIC); |
| 19658 | _tmp33_ = wrapper; |
| 19659 | _tmp34_ = bala_get_ccode_name ((BalaCodeNode*) collection_type); |
| 19660 | _tmp35_ = _tmp34_; |
| 19661 | _tmp36_ = bala_ccode_parameter_new ("node", _tmp35_); |
| 19662 | _tmp37_ = _tmp36_; |
| 19663 | bala_ccode_function_add_parameter (_tmp33_, _tmp37_); |
| 19664 | _bala_ccode_node_unref0 (_tmp37_)((_tmp37_ == ((void*)0)) ? ((void*)0) : (_tmp37_ = (bala_ccode_node_unref (_tmp37_), ((void*)0)))); |
| 19665 | _g_free0 (_tmp35_)(_tmp35_ = (g_free (_tmp35_), ((void*)0))); |
| 19666 | _tmp38_ = wrapper; |
| 19667 | _tmp39_ = bala_ccode_parameter_new ("free_func", "GDestroyNotify"); |
| 19668 | _tmp40_ = _tmp39_; |
| 19669 | bala_ccode_function_add_parameter (_tmp38_, _tmp40_); |
| 19670 | _bala_ccode_node_unref0 (_tmp40_)((_tmp40_ == ((void*)0)) ? ((void*)0) : (_tmp40_ = (bala_ccode_node_unref (_tmp40_), ((void*)0)))); |
| 19671 | _tmp41_ = wrapper; |
| 19672 | bala_ccode_base_module_push_function (self, _tmp41_); |
| 19673 | _tmp42_ = bala_ccode_identifier_new ("free_func"); |
| 19674 | _tmp43_ = _tmp42_; |
| 19675 | _tmp44_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp43_); |
| 19676 | _tmp45_ = _tmp44_; |
| 19677 | _bala_ccode_node_unref0 (_tmp43_)((_tmp43_ == ((void*)0)) ? ((void*)0) : (_tmp43_ = (bala_ccode_node_unref (_tmp43_), ((void*)0)))); |
| 19678 | free_call = _tmp45_; |
| 19679 | _tmp46_ = free_call; |
| 19680 | _tmp47_ = bala_ccode_identifier_new ("node"); |
| 19681 | _tmp48_ = _tmp47_; |
| 19682 | _tmp49_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp48_, "data"); |
| 19683 | _tmp50_ = _tmp49_; |
| 19684 | bala_ccode_function_call_add_argument (_tmp46_, (BalaCCodeExpression*) _tmp50_); |
| 19685 | _bala_ccode_node_unref0 (_tmp50_)((_tmp50_ == ((void*)0)) ? ((void*)0) : (_tmp50_ = (bala_ccode_node_unref (_tmp50_), ((void*)0)))); |
| 19686 | _bala_ccode_node_unref0 (_tmp48_)((_tmp48_ == ((void*)0)) ? ((void*)0) : (_tmp48_ = (bala_ccode_node_unref (_tmp48_), ((void*)0)))); |
| 19687 | _tmp51_ = bala_ccode_identifier_new ("node"); |
| 19688 | _tmp52_ = _tmp51_; |
| 19689 | _tmp53_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp52_, "data"); |
| 19690 | _tmp54_ = _tmp53_; |
| 19691 | _tmp55_ = bala_ccode_constant_new ("NULL"); |
| 19692 | _tmp56_ = _tmp55_; |
| 19693 | _tmp57_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp54_, (BalaCCodeExpression*) _tmp56_); |
| 19694 | _tmp58_ = _tmp57_; |
| 19695 | _bala_ccode_node_unref0 (_tmp56_)((_tmp56_ == ((void*)0)) ? ((void*)0) : (_tmp56_ = (bala_ccode_node_unref (_tmp56_), ((void*)0)))); |
| 19696 | _bala_ccode_node_unref0 (_tmp54_)((_tmp54_ == ((void*)0)) ? ((void*)0) : (_tmp54_ = (bala_ccode_node_unref (_tmp54_), ((void*)0)))); |
| 19697 | _bala_ccode_node_unref0 (_tmp52_)((_tmp52_ == ((void*)0)) ? ((void*)0) : (_tmp52_ = (bala_ccode_node_unref (_tmp52_), ((void*)0)))); |
| 19698 | data_isnull = _tmp58_; |
| 19699 | _tmp59_ = bala_ccode_comma_expression_new (); |
| 19700 | ccomma_data = _tmp59_; |
| 19701 | _tmp60_ = ccomma_data; |
| 19702 | _tmp61_ = data_isnull; |
| 19703 | _tmp62_ = bala_ccode_constant_new ("NULL"); |
| 19704 | _tmp63_ = _tmp62_; |
| 19705 | _tmp64_ = free_call; |
| 19706 | _tmp65_ = bala_ccode_conditional_expression_new ((BalaCCodeExpression*) _tmp61_, (BalaCCodeExpression*) _tmp63_, (BalaCCodeExpression*) _tmp64_); |
| 19707 | _tmp66_ = _tmp65_; |
| 19708 | bala_ccode_comma_expression_append_expression (_tmp60_, (BalaCCodeExpression*) _tmp66_); |
| 19709 | _bala_ccode_node_unref0 (_tmp66_)((_tmp66_ == ((void*)0)) ? ((void*)0) : (_tmp66_ = (bala_ccode_node_unref (_tmp66_), ((void*)0)))); |
| 19710 | _bala_ccode_node_unref0 (_tmp63_)((_tmp63_ == ((void*)0)) ? ((void*)0) : (_tmp63_ = (bala_ccode_node_unref (_tmp63_), ((void*)0)))); |
| 19711 | _tmp67_ = bala_ccode_base_module_get_ccode (self); |
| 19712 | _tmp68_ = _tmp67_; |
| 19713 | _tmp69_ = ccomma_data; |
| 19714 | bala_ccode_function_add_expression (_tmp68_, (BalaCCodeExpression*) _tmp69_); |
| 19715 | _tmp70_ = bala_ccode_base_module_get_ccode (self); |
| 19716 | _tmp71_ = _tmp70_; |
| 19717 | _tmp72_ = bala_ccode_constant_new ("FALSE"); |
| 19718 | _tmp73_ = _tmp72_; |
| 19719 | bala_ccode_function_add_return (_tmp71_, (BalaCCodeExpression*) _tmp73_); |
| 19720 | _bala_ccode_node_unref0 (_tmp73_)((_tmp73_ == ((void*)0)) ? ((void*)0) : (_tmp73_ = (bala_ccode_node_unref (_tmp73_), ((void*)0)))); |
| 19721 | bala_ccode_base_module_pop_function (self); |
| 19722 | _tmp74_ = self->cfile; |
| 19723 | _tmp75_ = wrapper; |
| 19724 | bala_ccode_file_add_function_declaration (_tmp74_, _tmp75_); |
| 19725 | _tmp76_ = self->cfile; |
| 19726 | _tmp77_ = wrapper; |
| 19727 | bala_ccode_file_add_function (_tmp76_, _tmp77_); |
| 19728 | _tmp78_ = bala_ccode_identifier_new ("g_node_traverse"); |
| 19729 | _tmp79_ = _tmp78_; |
| 19730 | _tmp80_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp79_); |
| 19731 | _bala_ccode_node_unref0 (element_free_call)((element_free_call == ((void*)0)) ? ((void*)0) : (element_free_call = (bala_ccode_node_unref (element_free_call), ((void*)0)))); |
| 19732 | element_free_call = _tmp80_; |
| 19733 | _bala_ccode_node_unref0 (_tmp79_)((_tmp79_ == ((void*)0)) ? ((void*)0) : (_tmp79_ = (bala_ccode_node_unref (_tmp79_), ((void*)0)))); |
| 19734 | _tmp81_ = element_free_call; |
| 19735 | _tmp82_ = bala_ccode_identifier_new ("self"); |
| 19736 | _tmp83_ = _tmp82_; |
| 19737 | bala_ccode_function_call_add_argument (_tmp81_, (BalaCCodeExpression*) _tmp83_); |
| 19738 | _bala_ccode_node_unref0 (_tmp83_)((_tmp83_ == ((void*)0)) ? ((void*)0) : (_tmp83_ = (bala_ccode_node_unref (_tmp83_), ((void*)0)))); |
| 19739 | _tmp84_ = element_free_call; |
| 19740 | _tmp85_ = bala_ccode_constant_new ("G_POST_ORDER"); |
| 19741 | _tmp86_ = _tmp85_; |
| 19742 | bala_ccode_function_call_add_argument (_tmp84_, (BalaCCodeExpression*) _tmp86_); |
| 19743 | _bala_ccode_node_unref0 (_tmp86_)((_tmp86_ == ((void*)0)) ? ((void*)0) : (_tmp86_ = (bala_ccode_node_unref (_tmp86_), ((void*)0)))); |
| 19744 | _tmp87_ = element_free_call; |
| 19745 | _tmp88_ = bala_ccode_constant_new ("G_TRAVERSE_ALL"); |
| 19746 | _tmp89_ = _tmp88_; |
| 19747 | bala_ccode_function_call_add_argument (_tmp87_, (BalaCCodeExpression*) _tmp89_); |
| 19748 | _bala_ccode_node_unref0 (_tmp89_)((_tmp89_ == ((void*)0)) ? ((void*)0) : (_tmp89_ = (bala_ccode_node_unref (_tmp89_), ((void*)0)))); |
| 19749 | _tmp90_ = element_free_call; |
| 19750 | _tmp91_ = bala_ccode_constant_new ("-1"); |
| 19751 | _tmp92_ = _tmp91_; |
| 19752 | bala_ccode_function_call_add_argument (_tmp90_, (BalaCCodeExpression*) _tmp92_); |
| 19753 | _bala_ccode_node_unref0 (_tmp92_)((_tmp92_ == ((void*)0)) ? ((void*)0) : (_tmp92_ = (bala_ccode_node_unref (_tmp92_), ((void*)0)))); |
| 19754 | _tmp93_ = element_free_call; |
| 19755 | _tmp94_ = destroy_node_func; |
| 19756 | _tmp95_ = bala_ccode_identifier_new (_tmp94_); |
| 19757 | _tmp96_ = _tmp95_; |
| 19758 | _tmp97_ = bala_ccode_cast_expression_new ((BalaCCodeExpression*) _tmp96_, "GNodeTraverseFunc"); |
| 19759 | _tmp98_ = _tmp97_; |
| 19760 | bala_ccode_function_call_add_argument (_tmp93_, (BalaCCodeExpression*) _tmp98_); |
| 19761 | _bala_ccode_node_unref0 (_tmp98_)((_tmp98_ == ((void*)0)) ? ((void*)0) : (_tmp98_ = (bala_ccode_node_unref (_tmp98_), ((void*)0)))); |
| 19762 | _bala_ccode_node_unref0 (_tmp96_)((_tmp96_ == ((void*)0)) ? ((void*)0) : (_tmp96_ = (bala_ccode_node_unref (_tmp96_), ((void*)0)))); |
| 19763 | _tmp99_ = element_free_call; |
| 19764 | _tmp100_ = bala_ccode_identifier_new ("free_func"); |
| 19765 | _tmp101_ = _tmp100_; |
| 19766 | bala_ccode_function_call_add_argument (_tmp99_, (BalaCCodeExpression*) _tmp101_); |
| 19767 | _bala_ccode_node_unref0 (_tmp101_)((_tmp101_ == ((void*)0)) ? ((void*)0) : (_tmp101_ = (bala_ccode_node_unref (_tmp101_), ((void*)0)))); |
| 19768 | _tmp102_ = bala_ccode_identifier_new ("free_func"); |
| 19769 | _tmp103_ = _tmp102_; |
| 19770 | _tmp104_ = bala_ccode_constant_new ("NULL"); |
| 19771 | _tmp105_ = _tmp104_; |
| 19772 | _tmp106_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp103_, (BalaCCodeExpression*) _tmp105_); |
| 19773 | _tmp107_ = _tmp106_; |
| 19774 | _bala_ccode_node_unref0 (_tmp105_)((_tmp105_ == ((void*)0)) ? ((void*)0) : (_tmp105_ = (bala_ccode_node_unref (_tmp105_), ((void*)0)))); |
| 19775 | _bala_ccode_node_unref0 (_tmp103_)((_tmp103_ == ((void*)0)) ? ((void*)0) : (_tmp103_ = (bala_ccode_node_unref (_tmp103_), ((void*)0)))); |
| 19776 | free_func_isnull = _tmp107_; |
| 19777 | _tmp108_ = bala_ccode_comma_expression_new (); |
| 19778 | ccomma = _tmp108_; |
| 19779 | _tmp109_ = ccomma; |
| 19780 | _tmp110_ = free_func_isnull; |
| 19781 | _tmp111_ = bala_ccode_constant_new ("NULL"); |
| 19782 | _tmp112_ = _tmp111_; |
| 19783 | _tmp113_ = element_free_call; |
| 19784 | _tmp114_ = bala_ccode_conditional_expression_new ((BalaCCodeExpression*) _tmp110_, (BalaCCodeExpression*) _tmp112_, (BalaCCodeExpression*) _tmp113_); |
| 19785 | _tmp115_ = _tmp114_; |
| 19786 | bala_ccode_comma_expression_append_expression (_tmp109_, (BalaCCodeExpression*) _tmp115_); |
| 19787 | _bala_ccode_node_unref0 (_tmp115_)((_tmp115_ == ((void*)0)) ? ((void*)0) : (_tmp115_ = (bala_ccode_node_unref (_tmp115_), ((void*)0)))); |
| 19788 | _bala_ccode_node_unref0 (_tmp112_)((_tmp112_ == ((void*)0)) ? ((void*)0) : (_tmp112_ = (bala_ccode_node_unref (_tmp112_), ((void*)0)))); |
| 19789 | _tmp116_ = bala_ccode_base_module_get_ccode (self); |
| 19790 | _tmp117_ = _tmp116_; |
| 19791 | _tmp118_ = ccomma; |
| 19792 | bala_ccode_function_add_expression (_tmp117_, (BalaCCodeExpression*) _tmp118_); |
| 19793 | _tmp119_ = self->gnode_type; |
| 19794 | _tmp120_ = bala_get_ccode_free_function ((BalaTypeSymbol*) _tmp119_); |
| 19795 | _tmp121_ = _tmp120_; |
| 19796 | _tmp122_ = bala_ccode_identifier_new (_tmp121_); |
| 19797 | _tmp123_ = _tmp122_; |
| 19798 | _tmp124_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp123_); |
| 19799 | _tmp125_ = _tmp124_; |
| 19800 | _bala_ccode_node_unref0 (_tmp123_)((_tmp123_ == ((void*)0)) ? ((void*)0) : (_tmp123_ = (bala_ccode_node_unref (_tmp123_), ((void*)0)))); |
| 19801 | _g_free0 (_tmp121_)(_tmp121_ = (g_free (_tmp121_), ((void*)0))); |
| 19802 | cfreecall = _tmp125_; |
| 19803 | _tmp126_ = cfreecall; |
| 19804 | _tmp127_ = bala_ccode_identifier_new ("self"); |
| 19805 | _tmp128_ = _tmp127_; |
| 19806 | bala_ccode_function_call_add_argument (_tmp126_, (BalaCCodeExpression*) _tmp128_); |
| 19807 | _bala_ccode_node_unref0 (_tmp128_)((_tmp128_ == ((void*)0)) ? ((void*)0) : (_tmp128_ = (bala_ccode_node_unref (_tmp128_), ((void*)0)))); |
| 19808 | _tmp129_ = bala_ccode_base_module_get_ccode (self); |
| 19809 | _tmp130_ = _tmp129_; |
| 19810 | _tmp131_ = cfreecall; |
| 19811 | bala_ccode_function_add_expression (_tmp130_, (BalaCCodeExpression*) _tmp131_); |
| 19812 | _tmp132_ = function; |
| 19813 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp132_, BALA_CCODE_MODIFIERS_STATIC); |
| 19814 | bala_ccode_base_module_pop_function (self); |
| 19815 | _tmp133_ = self->cfile; |
| 19816 | _tmp134_ = function; |
| 19817 | bala_ccode_file_add_function_declaration (_tmp133_, _tmp134_); |
| 19818 | _tmp135_ = self->cfile; |
| 19819 | _tmp136_ = function; |
| 19820 | bala_ccode_file_add_function (_tmp135_, _tmp136_); |
| 19821 | _bala_ccode_node_unref0 (cfreecall)((cfreecall == ((void*)0)) ? ((void*)0) : (cfreecall = (bala_ccode_node_unref (cfreecall), ((void*)0)))); |
| 19822 | _bala_ccode_node_unref0 (ccomma)((ccomma == ((void*)0)) ? ((void*)0) : (ccomma = (bala_ccode_node_unref (ccomma), ((void*)0)))); |
| 19823 | _bala_ccode_node_unref0 (free_func_isnull)((free_func_isnull == ((void*)0)) ? ((void*)0) : (free_func_isnull = (bala_ccode_node_unref (free_func_isnull), ((void*)0)))); |
| 19824 | _bala_ccode_node_unref0 (ccomma_data)((ccomma_data == ((void*)0)) ? ((void*)0) : (ccomma_data = (bala_ccode_node_unref (ccomma_data), ((void*)0)))); |
| 19825 | _bala_ccode_node_unref0 (data_isnull)((data_isnull == ((void*)0)) ? ((void*)0) : (data_isnull = (bala_ccode_node_unref (data_isnull), ((void*)0)))); |
| 19826 | _bala_ccode_node_unref0 (free_call)((free_call == ((void*)0)) ? ((void*)0) : (free_call = (bala_ccode_node_unref (free_call), ((void*)0)))); |
| 19827 | _bala_ccode_node_unref0 (wrapper)((wrapper == ((void*)0)) ? ((void*)0) : (wrapper = (bala_ccode_node_unref (wrapper), ((void*)0)))); |
| 19828 | _g_free0 (destroy_node_func)(destroy_node_func = (g_free (destroy_node_func), ((void*)0)) ); |
| 19829 | _bala_ccode_node_unref0 (element_free_call)((element_free_call == ((void*)0)) ? ((void*)0) : (element_free_call = (bala_ccode_node_unref (element_free_call), ((void*)0)))); |
| 19830 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 19831 | } else { |
| 19832 | BalaTypeSymbol* _tmp137_; |
| 19833 | BalaTypeSymbol* _tmp138_; |
| 19834 | BalaClass* _tmp139_; |
| 19835 | _tmp137_ = bala_data_type_get_type_symbol (collection_type); |
| 19836 | _tmp138_ = _tmp137_; |
| 19837 | _tmp139_ = self->glist_type; |
| 19838 | if (_tmp138_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp139_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp139_), ((bala_typesymbol_get_type ())))))) { |
| 19839 | gchar* _tmp140_; |
| 19840 | _tmp140_ = g_strdup ("g_list_free_full"); |
| 19841 | _g_free0 (destroy_func)(destroy_func = (g_free (destroy_func), ((void*)0))); |
| 19842 | destroy_func = _tmp140_; |
| 19843 | } else { |
| 19844 | BalaTypeSymbol* _tmp141_; |
| 19845 | BalaTypeSymbol* _tmp142_; |
| 19846 | BalaClass* _tmp143_; |
| 19847 | _tmp141_ = bala_data_type_get_type_symbol (collection_type); |
| 19848 | _tmp142_ = _tmp141_; |
| 19849 | _tmp143_ = self->gslist_type; |
| 19850 | if (_tmp142_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp143_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp143_), ((bala_typesymbol_get_type ())))))) { |
| 19851 | gchar* _tmp144_; |
| 19852 | _tmp144_ = g_strdup ("g_slist_free_full"); |
| 19853 | _g_free0 (destroy_func)(destroy_func = (g_free (destroy_func), ((void*)0))); |
| 19854 | destroy_func = _tmp144_; |
| 19855 | } else { |
| 19856 | BalaTypeSymbol* _tmp145_; |
| 19857 | BalaTypeSymbol* _tmp146_; |
| 19858 | BalaClass* _tmp147_; |
| 19859 | _tmp145_ = bala_data_type_get_type_symbol (collection_type); |
| 19860 | _tmp146_ = _tmp145_; |
| 19861 | _tmp147_ = self->gqueue_type; |
| 19862 | if (_tmp146_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp147_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp147_), ((bala_typesymbol_get_type ())))))) { |
| 19863 | gchar* _tmp148_; |
| 19864 | _tmp148_ = g_strdup ("g_queue_free_full"); |
| 19865 | _g_free0 (destroy_func)(destroy_func = (g_free (destroy_func), ((void*)0))); |
| 19866 | destroy_func = _tmp148_; |
| 19867 | } else { |
| 19868 | gchar* _tmp149_; |
| 19869 | bala_report_error (NULL((void*)0), "internal error: type of collection not supported"); |
| 19870 | _tmp149_ = g_strdup (""); |
| 19871 | result = _tmp149_; |
| 19872 | _g_free0 (destroy_func_wrapper)(destroy_func_wrapper = (g_free (destroy_func_wrapper), ((void *)0))); |
| 19873 | _g_free0 (destroy_func)(destroy_func = (g_free (destroy_func), ((void*)0))); |
| 19874 | return result; |
| 19875 | } |
| 19876 | } |
| 19877 | } |
| 19878 | } |
| 19879 | if (element_destroy_func_expression != NULL((void*)0)) { |
| 19880 | BalaCCodeFunction* function = NULL((void*)0); |
| 19881 | const gchar* _tmp150_; |
| 19882 | BalaCCodeFunction* _tmp151_; |
| 19883 | BalaCCodeFunction* _tmp152_; |
| 19884 | gchar* _tmp153_; |
| 19885 | gchar* _tmp154_; |
| 19886 | BalaCCodeParameter* _tmp155_; |
| 19887 | BalaCCodeParameter* _tmp156_; |
| 19888 | BalaCCodeFunction* _tmp157_; |
| 19889 | BalaCCodeFunctionCall* collection_free_call = NULL((void*)0); |
| 19890 | const gchar* _tmp158_; |
| 19891 | BalaCCodeIdentifier* _tmp159_; |
| 19892 | BalaCCodeIdentifier* _tmp160_; |
| 19893 | BalaCCodeFunctionCall* _tmp161_; |
| 19894 | BalaCCodeFunctionCall* _tmp162_; |
| 19895 | BalaCCodeFunctionCall* _tmp163_; |
| 19896 | BalaCCodeIdentifier* _tmp164_; |
| 19897 | BalaCCodeIdentifier* _tmp165_; |
| 19898 | BalaCCodeFunctionCall* _tmp166_; |
| 19899 | BalaCCodeCastExpression* _tmp167_; |
| 19900 | BalaCCodeCastExpression* _tmp168_; |
| 19901 | BalaCCodeFunction* _tmp169_; |
| 19902 | BalaCCodeFunction* _tmp170_; |
| 19903 | BalaCCodeFunctionCall* _tmp171_; |
| 19904 | BalaCCodeFunction* _tmp172_; |
| 19905 | BalaCCodeFile* _tmp173_; |
| 19906 | BalaCCodeFunction* _tmp174_; |
| 19907 | BalaCCodeFile* _tmp175_; |
| 19908 | BalaCCodeFunction* _tmp176_; |
| 19909 | _tmp150_ = destroy_func_wrapper; |
| 19910 | _tmp151_ = bala_ccode_function_new (_tmp150_, "void"); |
| 19911 | function = _tmp151_; |
| 19912 | _tmp152_ = function; |
| 19913 | _tmp153_ = bala_get_ccode_name ((BalaCodeNode*) collection_type); |
| 19914 | _tmp154_ = _tmp153_; |
| 19915 | _tmp155_ = bala_ccode_parameter_new ("self", _tmp154_); |
| 19916 | _tmp156_ = _tmp155_; |
| 19917 | bala_ccode_function_add_parameter (_tmp152_, _tmp156_); |
| 19918 | _bala_ccode_node_unref0 (_tmp156_)((_tmp156_ == ((void*)0)) ? ((void*)0) : (_tmp156_ = (bala_ccode_node_unref (_tmp156_), ((void*)0)))); |
| 19919 | _g_free0 (_tmp154_)(_tmp154_ = (g_free (_tmp154_), ((void*)0))); |
| 19920 | _tmp157_ = function; |
| 19921 | bala_ccode_base_module_push_function (self, _tmp157_); |
| 19922 | _tmp158_ = destroy_func; |
| 19923 | _tmp159_ = bala_ccode_identifier_new (_tmp158_); |
| 19924 | _tmp160_ = _tmp159_; |
| 19925 | _tmp161_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp160_); |
| 19926 | _tmp162_ = _tmp161_; |
| 19927 | _bala_ccode_node_unref0 (_tmp160_)((_tmp160_ == ((void*)0)) ? ((void*)0) : (_tmp160_ = (bala_ccode_node_unref (_tmp160_), ((void*)0)))); |
| 19928 | collection_free_call = _tmp162_; |
| 19929 | _tmp163_ = collection_free_call; |
| 19930 | _tmp164_ = bala_ccode_identifier_new ("self"); |
| 19931 | _tmp165_ = _tmp164_; |
| 19932 | bala_ccode_function_call_add_argument (_tmp163_, (BalaCCodeExpression*) _tmp165_); |
| 19933 | _bala_ccode_node_unref0 (_tmp165_)((_tmp165_ == ((void*)0)) ? ((void*)0) : (_tmp165_ = (bala_ccode_node_unref (_tmp165_), ((void*)0)))); |
| 19934 | _tmp166_ = collection_free_call; |
| 19935 | _tmp167_ = bala_ccode_cast_expression_new ((BalaCCodeExpression*) element_destroy_func_expression, "GDestroyNotify"); |
| 19936 | _tmp168_ = _tmp167_; |
| 19937 | bala_ccode_function_call_add_argument (_tmp166_, (BalaCCodeExpression*) _tmp168_); |
| 19938 | _bala_ccode_node_unref0 (_tmp168_)((_tmp168_ == ((void*)0)) ? ((void*)0) : (_tmp168_ = (bala_ccode_node_unref (_tmp168_), ((void*)0)))); |
| 19939 | _tmp169_ = bala_ccode_base_module_get_ccode (self); |
| 19940 | _tmp170_ = _tmp169_; |
| 19941 | _tmp171_ = collection_free_call; |
| 19942 | bala_ccode_function_add_expression (_tmp170_, (BalaCCodeExpression*) _tmp171_); |
| 19943 | _tmp172_ = function; |
| 19944 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp172_, BALA_CCODE_MODIFIERS_STATIC | BALA_CCODE_MODIFIERS_INLINE); |
| 19945 | bala_ccode_base_module_pop_function (self); |
| 19946 | _tmp173_ = self->cfile; |
| 19947 | _tmp174_ = function; |
| 19948 | bala_ccode_file_add_function_declaration (_tmp173_, _tmp174_); |
| 19949 | _tmp175_ = self->cfile; |
| 19950 | _tmp176_ = function; |
| 19951 | bala_ccode_file_add_function (_tmp175_, _tmp176_); |
| 19952 | result = destroy_func_wrapper; |
| 19953 | _bala_ccode_node_unref0 (collection_free_call)((collection_free_call == ((void*)0)) ? ((void*)0) : (collection_free_call = (bala_ccode_node_unref (collection_free_call), ((void*)0)) )); |
| 19954 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 19955 | _g_free0 (destroy_func)(destroy_func = (g_free (destroy_func), ((void*)0))); |
| 19956 | return result; |
| 19957 | } |
| 19958 | result = destroy_func; |
| 19959 | _g_free0 (destroy_func_wrapper)(destroy_func_wrapper = (g_free (destroy_func_wrapper), ((void *)0))); |
| 19960 | return result; |
| 19961 | } |
| 19962 | |
| 19963 | static gchar* |
| 19964 | bala_ccode_base_module_real_append_struct_array_destroy (BalaCCodeBaseModule* self, |
| 19965 | BalaStruct* st) |
| 19966 | { |
| 19967 | gchar* result = NULL((void*)0); |
| 19968 | g_return_val_if_fail (st != NULL, NULL)do { if ((st != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "st != NULL"); return (((void*)0)); } } while (0); |
| 19969 | result = NULL((void*)0); |
| 19970 | return result; |
| 19971 | } |
| 19972 | |
| 19973 | gchar* |
| 19974 | bala_ccode_base_module_append_struct_array_destroy (BalaCCodeBaseModule* self, |
| 19975 | BalaStruct* st) |
| 19976 | { |
| 19977 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 19978 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->append_struct_array_destroy (self, st); |
| 19979 | } |
| 19980 | |
| 19981 | static gchar* |
| 19982 | bala_ccode_base_module_real_append_struct_array_free (BalaCCodeBaseModule* self, |
| 19983 | BalaStruct* st) |
| 19984 | { |
| 19985 | gchar* result = NULL((void*)0); |
| 19986 | g_return_val_if_fail (st != NULL, NULL)do { if ((st != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "st != NULL"); return (((void*)0)); } } while (0); |
| 19987 | result = NULL((void*)0); |
| 19988 | return result; |
| 19989 | } |
| 19990 | |
| 19991 | gchar* |
| 19992 | bala_ccode_base_module_append_struct_array_free (BalaCCodeBaseModule* self, |
| 19993 | BalaStruct* st) |
| 19994 | { |
| 19995 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 19996 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->append_struct_array_free (self, st); |
| 19997 | } |
| 19998 | |
| 19999 | BalaCCodeExpression* |
| 20000 | bala_ccode_base_module_destroy_local (BalaCCodeBaseModule* self, |
| 20001 | BalaLocalVariable* local) |
| 20002 | { |
| 20003 | BalaTargetValue* _tmp0_; |
| 20004 | BalaTargetValue* _tmp1_; |
| 20005 | BalaCCodeExpression* _tmp2_; |
| 20006 | BalaCCodeExpression* _tmp3_; |
| 20007 | BalaCCodeExpression* result = NULL((void*)0); |
| 20008 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 20009 | g_return_val_if_fail (local != NULL, NULL)do { if ((local != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "local != NULL" ); return (((void*)0)); } } while (0); |
| 20010 | _tmp0_ = bala_ccode_base_module_get_local_cvalue (self, local); |
| 20011 | _tmp1_ = _tmp0_; |
| 20012 | _tmp2_ = bala_ccode_base_module_destroy_value (self, _tmp1_, FALSE(0)); |
| 20013 | _tmp3_ = _tmp2_; |
| 20014 | _bala_target_value_unref0 (_tmp1_)((_tmp1_ == ((void*)0)) ? ((void*)0) : (_tmp1_ = (bala_target_value_unref (_tmp1_), ((void*)0)))); |
| 20015 | result = _tmp3_; |
| 20016 | return result; |
| 20017 | } |
| 20018 | |
| 20019 | BalaCCodeExpression* |
| 20020 | bala_ccode_base_module_destroy_parameter (BalaCCodeBaseModule* self, |
| 20021 | BalaParameter* param) |
| 20022 | { |
| 20023 | BalaTargetValue* _tmp0_; |
| 20024 | BalaTargetValue* _tmp1_; |
| 20025 | BalaCCodeExpression* _tmp2_; |
| 20026 | BalaCCodeExpression* _tmp3_; |
| 20027 | BalaCCodeExpression* result = NULL((void*)0); |
| 20028 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 20029 | g_return_val_if_fail (param != NULL, NULL)do { if ((param != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "param != NULL" ); return (((void*)0)); } } while (0); |
| 20030 | _tmp0_ = bala_ccode_base_module_get_parameter_cvalue (self, param); |
| 20031 | _tmp1_ = _tmp0_; |
| 20032 | _tmp2_ = bala_ccode_base_module_destroy_value (self, _tmp1_, FALSE(0)); |
| 20033 | _tmp3_ = _tmp2_; |
| 20034 | _bala_target_value_unref0 (_tmp1_)((_tmp1_ == ((void*)0)) ? ((void*)0) : (_tmp1_ = (bala_target_value_unref (_tmp1_), ((void*)0)))); |
| 20035 | result = _tmp3_; |
| 20036 | return result; |
| 20037 | } |
| 20038 | |
| 20039 | BalaCCodeExpression* |
| 20040 | bala_ccode_base_module_destroy_field (BalaCCodeBaseModule* self, |
| 20041 | BalaField* field, |
| 20042 | BalaTargetValue* instance) |
| 20043 | { |
| 20044 | BalaTargetValue* _tmp0_; |
| 20045 | BalaTargetValue* _tmp1_; |
| 20046 | BalaCCodeExpression* _tmp2_; |
| 20047 | BalaCCodeExpression* _tmp3_; |
| 20048 | BalaCCodeExpression* result = NULL((void*)0); |
| 20049 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 20050 | g_return_val_if_fail (field != NULL, NULL)do { if ((field != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "field != NULL" ); return (((void*)0)); } } while (0); |
| 20051 | _tmp0_ = bala_ccode_base_module_get_field_cvalue (self, field, instance); |
| 20052 | _tmp1_ = _tmp0_; |
| 20053 | _tmp2_ = bala_ccode_base_module_destroy_value (self, _tmp1_, FALSE(0)); |
| 20054 | _tmp3_ = _tmp2_; |
| 20055 | _bala_target_value_unref0 (_tmp1_)((_tmp1_ == ((void*)0)) ? ((void*)0) : (_tmp1_ = (bala_target_value_unref (_tmp1_), ((void*)0)))); |
| 20056 | result = _tmp3_; |
| 20057 | return result; |
| 20058 | } |
| 20059 | |
| 20060 | static BalaCCodeExpression* |
| 20061 | bala_ccode_base_module_real_destroy_value (BalaCCodeBaseModule* self, |
| 20062 | BalaTargetValue* value, |
| 20063 | gboolean is_macro_definition) |
| 20064 | { |
| 20065 | BalaDataType* type = NULL((void*)0); |
| 20066 | BalaDataType* _tmp0_; |
| 20067 | BalaDataType* _tmp1_; |
| 20068 | BalaDataType* _tmp2_; |
| 20069 | BalaDataType* _tmp3_; |
| 20070 | BalaDataType* _tmp4_; |
| 20071 | BalaCCodeExpression* cvar = NULL((void*)0); |
| 20072 | BalaCCodeExpression* _tmp8_; |
| 20073 | BalaCCodeExpression* _tmp9_; |
| 20074 | BalaDataType* _tmp10_; |
| 20075 | gboolean _tmp58_ = FALSE(0); |
| 20076 | gboolean _tmp59_ = FALSE(0); |
| 20077 | gboolean _tmp60_ = FALSE(0); |
| 20078 | BalaDataType* _tmp61_; |
| 20079 | BalaTypeSymbol* _tmp62_; |
| 20080 | BalaTypeSymbol* _tmp63_; |
| 20081 | BalaClass* _tmp64_; |
| 20082 | gboolean is_gcollection = FALSE(0); |
| 20083 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 20084 | BalaCCodeExpression* cexpr = NULL((void*)0); |
| 20085 | BalaDataType* _tmp77_; |
| 20086 | BalaCCodeExpression* _tmp78_; |
| 20087 | gboolean _tmp79_ = FALSE(0); |
| 20088 | gboolean _tmp85_ = FALSE(0); |
| 20089 | BalaDataType* _tmp86_; |
| 20090 | gboolean _tmp157_ = FALSE(0); |
| 20091 | gboolean _tmp158_ = FALSE(0); |
| 20092 | gboolean _tmp159_ = FALSE(0); |
| 20093 | gboolean _tmp160_ = FALSE(0); |
| 20094 | BalaCodeContext* _tmp205_; |
| 20095 | BalaProfile _tmp206_; |
| 20096 | BalaProfile _tmp207_; |
| 20097 | BalaCCodeBinaryExpression* cisnull = NULL((void*)0); |
| 20098 | BalaCCodeExpression* _tmp209_; |
| 20099 | BalaCCodeConstant* _tmp210_; |
| 20100 | BalaCCodeConstant* _tmp211_; |
| 20101 | BalaCCodeBinaryExpression* _tmp212_; |
| 20102 | BalaCCodeBinaryExpression* _tmp213_; |
| 20103 | BalaDataType* _tmp214_; |
| 20104 | BalaCCodeFunctionCall* _tmp243_; |
| 20105 | BalaCCodeExpression* _tmp244_; |
| 20106 | BalaCCodeCommaExpression* ccomma = NULL((void*)0); |
| 20107 | BalaCCodeCommaExpression* _tmp245_; |
| 20108 | gboolean _tmp246_ = FALSE(0); |
| 20109 | gboolean _tmp247_ = FALSE(0); |
| 20110 | gboolean _tmp248_ = FALSE(0); |
| 20111 | BalaCodeContext* _tmp249_; |
| 20112 | BalaProfile _tmp250_; |
| 20113 | BalaProfile _tmp251_; |
| 20114 | BalaCCodeCommaExpression* _tmp351_; |
| 20115 | BalaCCodeFunctionCall* _tmp352_; |
| 20116 | BalaCCodeCommaExpression* _tmp353_; |
| 20117 | BalaCCodeConstant* _tmp354_; |
| 20118 | BalaCCodeConstant* _tmp355_; |
| 20119 | BalaCCodeAssignment* cassign = NULL((void*)0); |
| 20120 | BalaCCodeExpression* _tmp356_; |
| 20121 | BalaCCodeCommaExpression* _tmp357_; |
| 20122 | BalaCCodeAssignment* _tmp358_; |
| 20123 | gboolean _tmp359_ = FALSE(0); |
| 20124 | gboolean _tmp360_ = FALSE(0); |
| 20125 | BalaDataType* _tmp361_; |
| 20126 | BalaTypeSymbol* _tmp362_; |
| 20127 | BalaTypeSymbol* _tmp363_; |
| 20128 | gboolean uses_gfree = FALSE(0); |
| 20129 | gboolean _tmp372_ = FALSE(0); |
| 20130 | BalaCCodeBinaryExpression* _tmp374_; |
| 20131 | BalaCCodeConstant* _tmp375_; |
| 20132 | BalaCCodeConstant* _tmp376_; |
| 20133 | BalaCCodeAssignment* _tmp377_; |
| 20134 | BalaCCodeConditionalExpression* _tmp378_; |
| 20135 | BalaCCodeExpression* _tmp379_; |
| 20136 | BalaCCodeExpression* result = NULL((void*)0); |
| 20137 | g_return_val_if_fail (value != NULL, NULL)do { if ((value != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "value != NULL" ); return (((void*)0)); } } while (0); |
| 20138 | _tmp0_ = bala_target_value_get_value_type (value); |
| 20139 | _tmp1_ = _tmp0_; |
| 20140 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 20141 | type = _tmp2_; |
| 20142 | _tmp3_ = bala_target_value_get_actual_value_type (value); |
| 20143 | _tmp4_ = _tmp3_; |
| 20144 | if (_tmp4_ != NULL((void*)0)) { |
| 20145 | BalaDataType* _tmp5_; |
| 20146 | BalaDataType* _tmp6_; |
| 20147 | BalaDataType* _tmp7_; |
| 20148 | _tmp5_ = bala_target_value_get_actual_value_type (value); |
| 20149 | _tmp6_ = _tmp5_; |
| 20150 | _tmp7_ = _bala_code_node_ref0 (_tmp6_); |
| 20151 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 20152 | type = _tmp7_; |
| 20153 | } |
| 20154 | _tmp8_ = bala_get_cvalue_ (value); |
| 20155 | _tmp9_ = _bala_ccode_node_ref0 (_tmp8_); |
| 20156 | cvar = _tmp9_; |
| 20157 | _tmp10_ = type; |
| 20158 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp10_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 20159 | BalaCodeContext* _tmp11_; |
| 20160 | BalaProfile _tmp12_; |
| 20161 | BalaProfile _tmp13_; |
| 20162 | BalaCCodeExpression* delegate_target = NULL((void*)0); |
| 20163 | BalaCCodeExpression* _tmp15_; |
| 20164 | BalaCCodeExpression* delegate_target_destroy_notify = NULL((void*)0); |
| 20165 | BalaCCodeExpression* _tmp16_; |
| 20166 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 20167 | BalaCCodeExpression* _tmp17_; |
| 20168 | BalaCCodeFunctionCall* _tmp18_; |
| 20169 | BalaCCodeFunctionCall* _tmp19_; |
| 20170 | BalaCCodeExpression* _tmp20_; |
| 20171 | BalaCCodeCommaExpression* destroy_call = NULL((void*)0); |
| 20172 | BalaCCodeCommaExpression* _tmp21_; |
| 20173 | BalaCCodeCommaExpression* _tmp22_; |
| 20174 | BalaCCodeFunctionCall* _tmp23_; |
| 20175 | BalaCCodeCommaExpression* _tmp24_; |
| 20176 | BalaCCodeConstant* _tmp25_; |
| 20177 | BalaCCodeConstant* _tmp26_; |
| 20178 | BalaCCodeBinaryExpression* cisnull = NULL((void*)0); |
| 20179 | BalaCCodeExpression* _tmp27_; |
| 20180 | BalaCCodeConstant* _tmp28_; |
| 20181 | BalaCCodeConstant* _tmp29_; |
| 20182 | BalaCCodeBinaryExpression* _tmp30_; |
| 20183 | BalaCCodeBinaryExpression* _tmp31_; |
| 20184 | BalaCCodeCommaExpression* ccomma = NULL((void*)0); |
| 20185 | BalaCCodeCommaExpression* _tmp32_; |
| 20186 | BalaCCodeCommaExpression* _tmp33_; |
| 20187 | BalaCCodeBinaryExpression* _tmp34_; |
| 20188 | BalaCCodeConstant* _tmp35_; |
| 20189 | BalaCCodeConstant* _tmp36_; |
| 20190 | BalaCCodeCommaExpression* _tmp37_; |
| 20191 | BalaCCodeConditionalExpression* _tmp38_; |
| 20192 | BalaCCodeConditionalExpression* _tmp39_; |
| 20193 | BalaCCodeCommaExpression* _tmp40_; |
| 20194 | BalaCCodeExpression* _tmp41_; |
| 20195 | BalaCCodeConstant* _tmp42_; |
| 20196 | BalaCCodeConstant* _tmp43_; |
| 20197 | BalaCCodeAssignment* _tmp44_; |
| 20198 | BalaCCodeAssignment* _tmp45_; |
| 20199 | BalaCCodeCommaExpression* _tmp46_; |
| 20200 | BalaCCodeExpression* _tmp47_; |
| 20201 | BalaCCodeConstant* _tmp48_; |
| 20202 | BalaCCodeConstant* _tmp49_; |
| 20203 | BalaCCodeAssignment* _tmp50_; |
| 20204 | BalaCCodeAssignment* _tmp51_; |
| 20205 | BalaCCodeCommaExpression* _tmp52_; |
| 20206 | BalaCCodeExpression* _tmp53_; |
| 20207 | BalaCCodeConstant* _tmp54_; |
| 20208 | BalaCCodeConstant* _tmp55_; |
| 20209 | BalaCCodeAssignment* _tmp56_; |
| 20210 | BalaCCodeAssignment* _tmp57_; |
| 20211 | _tmp11_ = self->priv->_context; |
| 20212 | _tmp12_ = bala_code_context_get_profile (_tmp11_); |
| 20213 | _tmp13_ = _tmp12_; |
| 20214 | if (_tmp13_ != BALA_PROFILE_GOBJECT) { |
| 20215 | BalaCCodeFile* _tmp14_; |
| 20216 | _tmp14_ = self->cfile; |
| 20217 | bala_ccode_file_add_include (_tmp14_, "stddef.h", FALSE(0)); |
| 20218 | } |
| 20219 | _tmp15_ = bala_ccode_base_module_get_delegate_target_cvalue (self, value); |
| 20220 | delegate_target = _tmp15_; |
| 20221 | _tmp16_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cvalue (self, value); |
| 20222 | delegate_target_destroy_notify = _tmp16_; |
| 20223 | _tmp17_ = delegate_target_destroy_notify; |
| 20224 | _tmp18_ = bala_ccode_function_call_new (_tmp17_); |
| 20225 | ccall = _tmp18_; |
| 20226 | _tmp19_ = ccall; |
| 20227 | _tmp20_ = delegate_target; |
| 20228 | bala_ccode_function_call_add_argument (_tmp19_, _tmp20_); |
| 20229 | _tmp21_ = bala_ccode_comma_expression_new (); |
| 20230 | destroy_call = _tmp21_; |
| 20231 | _tmp22_ = destroy_call; |
| 20232 | _tmp23_ = ccall; |
| 20233 | bala_ccode_comma_expression_append_expression (_tmp22_, (BalaCCodeExpression*) _tmp23_); |
| 20234 | _tmp24_ = destroy_call; |
| 20235 | _tmp25_ = bala_ccode_constant_new ("NULL"); |
| 20236 | _tmp26_ = _tmp25_; |
| 20237 | bala_ccode_comma_expression_append_expression (_tmp24_, (BalaCCodeExpression*) _tmp26_); |
| 20238 | _bala_ccode_node_unref0 (_tmp26_)((_tmp26_ == ((void*)0)) ? ((void*)0) : (_tmp26_ = (bala_ccode_node_unref (_tmp26_), ((void*)0)))); |
| 20239 | _tmp27_ = delegate_target_destroy_notify; |
| 20240 | _tmp28_ = bala_ccode_constant_new ("NULL"); |
| 20241 | _tmp29_ = _tmp28_; |
| 20242 | _tmp30_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, _tmp27_, (BalaCCodeExpression*) _tmp29_); |
| 20243 | _tmp31_ = _tmp30_; |
| 20244 | _bala_ccode_node_unref0 (_tmp29_)((_tmp29_ == ((void*)0)) ? ((void*)0) : (_tmp29_ = (bala_ccode_node_unref (_tmp29_), ((void*)0)))); |
| 20245 | cisnull = _tmp31_; |
| 20246 | _tmp32_ = bala_ccode_comma_expression_new (); |
| 20247 | ccomma = _tmp32_; |
| 20248 | _tmp33_ = ccomma; |
| 20249 | _tmp34_ = cisnull; |
| 20250 | _tmp35_ = bala_ccode_constant_new ("NULL"); |
| 20251 | _tmp36_ = _tmp35_; |
| 20252 | _tmp37_ = destroy_call; |
| 20253 | _tmp38_ = bala_ccode_conditional_expression_new ((BalaCCodeExpression*) _tmp34_, (BalaCCodeExpression*) _tmp36_, (BalaCCodeExpression*) _tmp37_); |
| 20254 | _tmp39_ = _tmp38_; |
| 20255 | bala_ccode_comma_expression_append_expression (_tmp33_, (BalaCCodeExpression*) _tmp39_); |
| 20256 | _bala_ccode_node_unref0 (_tmp39_)((_tmp39_ == ((void*)0)) ? ((void*)0) : (_tmp39_ = (bala_ccode_node_unref (_tmp39_), ((void*)0)))); |
| 20257 | _bala_ccode_node_unref0 (_tmp36_)((_tmp36_ == ((void*)0)) ? ((void*)0) : (_tmp36_ = (bala_ccode_node_unref (_tmp36_), ((void*)0)))); |
| 20258 | _tmp40_ = ccomma; |
| 20259 | _tmp41_ = cvar; |
| 20260 | _tmp42_ = bala_ccode_constant_new ("NULL"); |
| 20261 | _tmp43_ = _tmp42_; |
| 20262 | _tmp44_ = bala_ccode_assignment_new (_tmp41_, (BalaCCodeExpression*) _tmp43_, BALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE); |
| 20263 | _tmp45_ = _tmp44_; |
| 20264 | bala_ccode_comma_expression_append_expression (_tmp40_, (BalaCCodeExpression*) _tmp45_); |
| 20265 | _bala_ccode_node_unref0 (_tmp45_)((_tmp45_ == ((void*)0)) ? ((void*)0) : (_tmp45_ = (bala_ccode_node_unref (_tmp45_), ((void*)0)))); |
| 20266 | _bala_ccode_node_unref0 (_tmp43_)((_tmp43_ == ((void*)0)) ? ((void*)0) : (_tmp43_ = (bala_ccode_node_unref (_tmp43_), ((void*)0)))); |
| 20267 | _tmp46_ = ccomma; |
| 20268 | _tmp47_ = delegate_target; |
| 20269 | _tmp48_ = bala_ccode_constant_new ("NULL"); |
| 20270 | _tmp49_ = _tmp48_; |
| 20271 | _tmp50_ = bala_ccode_assignment_new (_tmp47_, (BalaCCodeExpression*) _tmp49_, BALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE); |
| 20272 | _tmp51_ = _tmp50_; |
| 20273 | bala_ccode_comma_expression_append_expression (_tmp46_, (BalaCCodeExpression*) _tmp51_); |
| 20274 | _bala_ccode_node_unref0 (_tmp51_)((_tmp51_ == ((void*)0)) ? ((void*)0) : (_tmp51_ = (bala_ccode_node_unref (_tmp51_), ((void*)0)))); |
| 20275 | _bala_ccode_node_unref0 (_tmp49_)((_tmp49_ == ((void*)0)) ? ((void*)0) : (_tmp49_ = (bala_ccode_node_unref (_tmp49_), ((void*)0)))); |
| 20276 | _tmp52_ = ccomma; |
| 20277 | _tmp53_ = delegate_target_destroy_notify; |
| 20278 | _tmp54_ = bala_ccode_constant_new ("NULL"); |
| 20279 | _tmp55_ = _tmp54_; |
| 20280 | _tmp56_ = bala_ccode_assignment_new (_tmp53_, (BalaCCodeExpression*) _tmp55_, BALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE); |
| 20281 | _tmp57_ = _tmp56_; |
| 20282 | bala_ccode_comma_expression_append_expression (_tmp52_, (BalaCCodeExpression*) _tmp57_); |
| 20283 | _bala_ccode_node_unref0 (_tmp57_)((_tmp57_ == ((void*)0)) ? ((void*)0) : (_tmp57_ = (bala_ccode_node_unref (_tmp57_), ((void*)0)))); |
| 20284 | _bala_ccode_node_unref0 (_tmp55_)((_tmp55_ == ((void*)0)) ? ((void*)0) : (_tmp55_ = (bala_ccode_node_unref (_tmp55_), ((void*)0)))); |
| 20285 | result = (BalaCCodeExpression*) ccomma; |
| 20286 | _bala_ccode_node_unref0 (cisnull)((cisnull == ((void*)0)) ? ((void*)0) : (cisnull = (bala_ccode_node_unref (cisnull), ((void*)0)))); |
| 20287 | _bala_ccode_node_unref0 (destroy_call)((destroy_call == ((void*)0)) ? ((void*)0) : (destroy_call = ( bala_ccode_node_unref (destroy_call), ((void*)0)))); |
| 20288 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 20289 | _bala_ccode_node_unref0 (delegate_target_destroy_notify)((delegate_target_destroy_notify == ((void*)0)) ? ((void*)0) : (delegate_target_destroy_notify = (bala_ccode_node_unref (delegate_target_destroy_notify ), ((void*)0)))); |
| 20290 | _bala_ccode_node_unref0 (delegate_target)((delegate_target == ((void*)0)) ? ((void*)0) : (delegate_target = (bala_ccode_node_unref (delegate_target), ((void*)0)))); |
| 20291 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 20292 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 20293 | return result; |
| 20294 | } |
| 20295 | _tmp61_ = type; |
| 20296 | _tmp62_ = bala_data_type_get_type_symbol (_tmp61_); |
| 20297 | _tmp63_ = _tmp62_; |
| 20298 | _tmp64_ = self->glist_type; |
| 20299 | if (_tmp63_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp64_), ((bala_typesymbol_get_type ())))))) { |
| 20300 | _tmp60_ = TRUE(!(0)); |
| 20301 | } else { |
| 20302 | BalaDataType* _tmp65_; |
| 20303 | BalaTypeSymbol* _tmp66_; |
| 20304 | BalaTypeSymbol* _tmp67_; |
| 20305 | BalaClass* _tmp68_; |
| 20306 | _tmp65_ = type; |
| 20307 | _tmp66_ = bala_data_type_get_type_symbol (_tmp65_); |
| 20308 | _tmp67_ = _tmp66_; |
| 20309 | _tmp68_ = self->gslist_type; |
| 20310 | _tmp60_ = _tmp67_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp68_), ((bala_typesymbol_get_type ()))))); |
| 20311 | } |
| 20312 | if (_tmp60_) { |
| 20313 | _tmp59_ = TRUE(!(0)); |
| 20314 | } else { |
| 20315 | BalaDataType* _tmp69_; |
| 20316 | BalaTypeSymbol* _tmp70_; |
| 20317 | BalaTypeSymbol* _tmp71_; |
| 20318 | BalaClass* _tmp72_; |
| 20319 | _tmp69_ = type; |
| 20320 | _tmp70_ = bala_data_type_get_type_symbol (_tmp69_); |
| 20321 | _tmp71_ = _tmp70_; |
| 20322 | _tmp72_ = self->gnode_type; |
| 20323 | _tmp59_ = _tmp71_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp72_), ((bala_typesymbol_get_type ()))))); |
| 20324 | } |
| 20325 | if (_tmp59_) { |
| 20326 | _tmp58_ = TRUE(!(0)); |
| 20327 | } else { |
| 20328 | BalaDataType* _tmp73_; |
| 20329 | BalaTypeSymbol* _tmp74_; |
| 20330 | BalaTypeSymbol* _tmp75_; |
| 20331 | BalaClass* _tmp76_; |
| 20332 | _tmp73_ = type; |
| 20333 | _tmp74_ = bala_data_type_get_type_symbol (_tmp73_); |
| 20334 | _tmp75_ = _tmp74_; |
| 20335 | _tmp76_ = self->gqueue_type; |
| 20336 | _tmp58_ = _tmp75_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp76_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp76_), ((bala_typesymbol_get_type ()))))); |
| 20337 | } |
| 20338 | is_gcollection = _tmp58_; |
| 20339 | _tmp77_ = type; |
| 20340 | _tmp78_ = bala_ccode_base_module_get_destroy_func_expression (self, _tmp77_, FALSE(0)); |
| 20341 | cexpr = _tmp78_; |
| 20342 | if (is_gcollection) { |
| 20343 | BalaCCodeExpression* _tmp80_; |
| 20344 | _tmp80_ = cexpr; |
| 20345 | _tmp79_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp80_, BALA_TYPE_CCODE_FUNCTION_CALL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp80_); GType __t = ((bala_ccode_function_call_get_type ()) ); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 20346 | } else { |
| 20347 | _tmp79_ = FALSE(0); |
| 20348 | } |
| 20349 | if (_tmp79_) { |
| 20350 | BalaCCodeExpression* _tmp81_; |
| 20351 | BalaCCodeFunctionCall* _tmp82_; |
| 20352 | _tmp81_ = cexpr; |
| 20353 | _tmp82_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp81_, BALA_TYPE_CCODE_FUNCTION_CALL, BalaCCodeFunctionCall)(((BalaCCodeFunctionCall*) g_type_check_instance_cast ((GTypeInstance *) (_tmp81_), ((bala_ccode_function_call_get_type ())))))); |
| 20354 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 20355 | ccall = _tmp82_; |
| 20356 | } else { |
| 20357 | BalaCCodeExpression* _tmp83_; |
| 20358 | BalaCCodeFunctionCall* _tmp84_; |
| 20359 | _tmp83_ = cexpr; |
| 20360 | _tmp84_ = bala_ccode_function_call_new (_tmp83_); |
| 20361 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 20362 | ccall = _tmp84_; |
| 20363 | } |
| 20364 | _tmp86_ = type; |
| 20365 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp86_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp86_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 20366 | BalaDataType* _tmp87_; |
| 20367 | gboolean _tmp88_; |
| 20368 | gboolean _tmp89_; |
| 20369 | _tmp87_ = type; |
| 20370 | _tmp88_ = bala_data_type_get_nullable (_tmp87_); |
| 20371 | _tmp89_ = _tmp88_; |
| 20372 | _tmp85_ = !_tmp89_; |
| 20373 | } else { |
| 20374 | _tmp85_ = FALSE(0); |
| 20375 | } |
| 20376 | if (_tmp85_) { |
| 20377 | BalaStruct* st = NULL((void*)0); |
| 20378 | BalaDataType* _tmp90_; |
| 20379 | BalaTypeSymbol* _tmp91_; |
| 20380 | BalaTypeSymbol* _tmp92_; |
| 20381 | gboolean _tmp93_ = FALSE(0); |
| 20382 | BalaStruct* _tmp94_; |
| 20383 | gboolean _tmp102_ = FALSE(0); |
| 20384 | BalaStruct* _tmp103_; |
| 20385 | _tmp90_ = type; |
| 20386 | _tmp91_ = bala_data_type_get_type_symbol (_tmp90_); |
| 20387 | _tmp92_ = _tmp91_; |
| 20388 | st = G_TYPE_CHECK_INSTANCE_TYPE (_tmp92_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp92_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp92_) : NULL((void*)0); |
| 20389 | _tmp94_ = st; |
| 20390 | if (_tmp94_ != NULL((void*)0)) { |
| 20391 | BalaStruct* _tmp95_; |
| 20392 | _tmp95_ = st; |
| 20393 | _tmp93_ = bala_struct_is_simple_type (_tmp95_); |
| 20394 | } else { |
| 20395 | _tmp93_ = FALSE(0); |
| 20396 | } |
| 20397 | if (_tmp93_) { |
| 20398 | BalaCCodeFunctionCall* _tmp96_; |
| 20399 | BalaCCodeExpression* _tmp97_; |
| 20400 | _tmp96_ = ccall; |
| 20401 | _tmp97_ = cvar; |
| 20402 | bala_ccode_function_call_add_argument (_tmp96_, _tmp97_); |
| 20403 | } else { |
| 20404 | BalaCCodeFunctionCall* _tmp98_; |
| 20405 | BalaCCodeExpression* _tmp99_; |
| 20406 | BalaCCodeUnaryExpression* _tmp100_; |
| 20407 | BalaCCodeUnaryExpression* _tmp101_; |
| 20408 | _tmp98_ = ccall; |
| 20409 | _tmp99_ = cvar; |
| 20410 | _tmp100_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp99_); |
| 20411 | _tmp101_ = _tmp100_; |
| 20412 | bala_ccode_function_call_add_argument (_tmp98_, (BalaCCodeExpression*) _tmp101_); |
| 20413 | _bala_ccode_node_unref0 (_tmp101_)((_tmp101_ == ((void*)0)) ? ((void*)0) : (_tmp101_ = (bala_ccode_node_unref (_tmp101_), ((void*)0)))); |
| 20414 | } |
| 20415 | _tmp103_ = self->gvalue_type; |
| 20416 | if (_tmp103_ != NULL((void*)0)) { |
| 20417 | BalaDataType* _tmp104_; |
| 20418 | BalaTypeSymbol* _tmp105_; |
| 20419 | BalaTypeSymbol* _tmp106_; |
| 20420 | BalaStruct* _tmp107_; |
| 20421 | _tmp104_ = type; |
| 20422 | _tmp105_ = bala_data_type_get_type_symbol (_tmp104_); |
| 20423 | _tmp106_ = _tmp105_; |
| 20424 | _tmp107_ = self->gvalue_type; |
| 20425 | _tmp102_ = _tmp106_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp107_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp107_), ((bala_typesymbol_get_type ()))))); |
| 20426 | } else { |
| 20427 | _tmp102_ = FALSE(0); |
| 20428 | } |
| 20429 | if (_tmp102_) { |
| 20430 | BalaCCodeFunctionCall* cisvalid = NULL((void*)0); |
| 20431 | BalaCCodeIdentifier* _tmp108_; |
| 20432 | BalaCCodeIdentifier* _tmp109_; |
| 20433 | BalaCCodeFunctionCall* _tmp110_; |
| 20434 | BalaCCodeFunctionCall* _tmp111_; |
| 20435 | BalaCCodeFunctionCall* _tmp112_; |
| 20436 | BalaCCodeExpression* _tmp113_; |
| 20437 | BalaCCodeUnaryExpression* _tmp114_; |
| 20438 | BalaCCodeUnaryExpression* _tmp115_; |
| 20439 | BalaCCodeCommaExpression* ccomma = NULL((void*)0); |
| 20440 | BalaCCodeCommaExpression* _tmp116_; |
| 20441 | BalaCCodeCommaExpression* _tmp117_; |
| 20442 | BalaCCodeFunctionCall* _tmp118_; |
| 20443 | BalaCCodeCommaExpression* _tmp119_; |
| 20444 | BalaCCodeConstant* _tmp120_; |
| 20445 | BalaCCodeConstant* _tmp121_; |
| 20446 | BalaCCodeFunctionCall* _tmp122_; |
| 20447 | BalaCCodeCommaExpression* _tmp123_; |
| 20448 | BalaCCodeConstant* _tmp124_; |
| 20449 | BalaCCodeConstant* _tmp125_; |
| 20450 | BalaCCodeConditionalExpression* _tmp126_; |
| 20451 | BalaCCodeExpression* _tmp127_; |
| 20452 | _tmp108_ = bala_ccode_identifier_new ("G_IS_VALUE"); |
| 20453 | _tmp109_ = _tmp108_; |
| 20454 | _tmp110_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp109_); |
| 20455 | _tmp111_ = _tmp110_; |
| 20456 | _bala_ccode_node_unref0 (_tmp109_)((_tmp109_ == ((void*)0)) ? ((void*)0) : (_tmp109_ = (bala_ccode_node_unref (_tmp109_), ((void*)0)))); |
| 20457 | cisvalid = _tmp111_; |
| 20458 | _tmp112_ = cisvalid; |
| 20459 | _tmp113_ = cvar; |
| 20460 | _tmp114_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp113_); |
| 20461 | _tmp115_ = _tmp114_; |
| 20462 | bala_ccode_function_call_add_argument (_tmp112_, (BalaCCodeExpression*) _tmp115_); |
| 20463 | _bala_ccode_node_unref0 (_tmp115_)((_tmp115_ == ((void*)0)) ? ((void*)0) : (_tmp115_ = (bala_ccode_node_unref (_tmp115_), ((void*)0)))); |
| 20464 | _tmp116_ = bala_ccode_comma_expression_new (); |
| 20465 | ccomma = _tmp116_; |
| 20466 | _tmp117_ = ccomma; |
| 20467 | _tmp118_ = ccall; |
| 20468 | bala_ccode_comma_expression_append_expression (_tmp117_, (BalaCCodeExpression*) _tmp118_); |
| 20469 | _tmp119_ = ccomma; |
| 20470 | _tmp120_ = bala_ccode_constant_new ("NULL"); |
| 20471 | _tmp121_ = _tmp120_; |
| 20472 | bala_ccode_comma_expression_append_expression (_tmp119_, (BalaCCodeExpression*) _tmp121_); |
| 20473 | _bala_ccode_node_unref0 (_tmp121_)((_tmp121_ == ((void*)0)) ? ((void*)0) : (_tmp121_ = (bala_ccode_node_unref (_tmp121_), ((void*)0)))); |
| 20474 | _tmp122_ = cisvalid; |
| 20475 | _tmp123_ = ccomma; |
| 20476 | _tmp124_ = bala_ccode_constant_new ("NULL"); |
| 20477 | _tmp125_ = _tmp124_; |
| 20478 | _tmp126_ = bala_ccode_conditional_expression_new ((BalaCCodeExpression*) _tmp122_, (BalaCCodeExpression*) _tmp123_, (BalaCCodeExpression*) _tmp125_); |
| 20479 | _tmp127_ = (BalaCCodeExpression*) _tmp126_; |
| 20480 | _bala_ccode_node_unref0 (_tmp125_)((_tmp125_ == ((void*)0)) ? ((void*)0) : (_tmp125_ = (bala_ccode_node_unref (_tmp125_), ((void*)0)))); |
| 20481 | result = _tmp127_; |
| 20482 | _bala_ccode_node_unref0 (ccomma)((ccomma == ((void*)0)) ? ((void*)0) : (ccomma = (bala_ccode_node_unref (ccomma), ((void*)0)))); |
| 20483 | _bala_ccode_node_unref0 (cisvalid)((cisvalid == ((void*)0)) ? ((void*)0) : (cisvalid = (bala_ccode_node_unref (cisvalid), ((void*)0)))); |
| 20484 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 20485 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 20486 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 20487 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 20488 | return result; |
| 20489 | } else { |
| 20490 | gboolean _tmp128_ = FALSE(0); |
| 20491 | gboolean _tmp129_ = FALSE(0); |
| 20492 | gboolean _tmp130_ = FALSE(0); |
| 20493 | BalaDataType* _tmp131_; |
| 20494 | BalaTypeSymbol* _tmp132_; |
| 20495 | BalaTypeSymbol* _tmp133_; |
| 20496 | BalaStruct* _tmp134_; |
| 20497 | _tmp131_ = type; |
| 20498 | _tmp132_ = bala_data_type_get_type_symbol (_tmp131_); |
| 20499 | _tmp133_ = _tmp132_; |
| 20500 | _tmp134_ = self->gmutex_type; |
| 20501 | if (_tmp133_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp134_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp134_), ((bala_typesymbol_get_type ())))))) { |
| 20502 | _tmp130_ = TRUE(!(0)); |
| 20503 | } else { |
| 20504 | BalaDataType* _tmp135_; |
| 20505 | BalaTypeSymbol* _tmp136_; |
| 20506 | BalaTypeSymbol* _tmp137_; |
| 20507 | BalaStruct* _tmp138_; |
| 20508 | _tmp135_ = type; |
| 20509 | _tmp136_ = bala_data_type_get_type_symbol (_tmp135_); |
| 20510 | _tmp137_ = _tmp136_; |
| 20511 | _tmp138_ = self->grecmutex_type; |
| 20512 | _tmp130_ = _tmp137_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp138_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp138_), ((bala_typesymbol_get_type ()))))); |
| 20513 | } |
| 20514 | if (_tmp130_) { |
| 20515 | _tmp129_ = TRUE(!(0)); |
| 20516 | } else { |
| 20517 | BalaDataType* _tmp139_; |
| 20518 | BalaTypeSymbol* _tmp140_; |
| 20519 | BalaTypeSymbol* _tmp141_; |
| 20520 | BalaStruct* _tmp142_; |
| 20521 | _tmp139_ = type; |
| 20522 | _tmp140_ = bala_data_type_get_type_symbol (_tmp139_); |
| 20523 | _tmp141_ = _tmp140_; |
| 20524 | _tmp142_ = self->grwlock_type; |
| 20525 | _tmp129_ = _tmp141_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp142_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp142_), ((bala_typesymbol_get_type ()))))); |
| 20526 | } |
| 20527 | if (_tmp129_) { |
| 20528 | _tmp128_ = TRUE(!(0)); |
| 20529 | } else { |
| 20530 | BalaDataType* _tmp143_; |
| 20531 | BalaTypeSymbol* _tmp144_; |
| 20532 | BalaTypeSymbol* _tmp145_; |
| 20533 | BalaStruct* _tmp146_; |
| 20534 | _tmp143_ = type; |
| 20535 | _tmp144_ = bala_data_type_get_type_symbol (_tmp143_); |
| 20536 | _tmp145_ = _tmp144_; |
| 20537 | _tmp146_ = self->gcond_type; |
| 20538 | _tmp128_ = _tmp145_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp146_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp146_), ((bala_typesymbol_get_type ()))))); |
| 20539 | } |
| 20540 | if (_tmp128_) { |
| 20541 | BalaCCodeFunctionCall* _tmp147_; |
| 20542 | BalaDataType* _tmp148_; |
| 20543 | BalaTypeSymbol* _tmp149_; |
| 20544 | BalaTypeSymbol* _tmp150_; |
| 20545 | gchar* _tmp151_; |
| 20546 | gchar* _tmp152_; |
| 20547 | gchar* _tmp153_; |
| 20548 | gchar* _tmp154_; |
| 20549 | BalaCCodeIdentifier* _tmp155_; |
| 20550 | BalaCCodeIdentifier* _tmp156_; |
| 20551 | self->requires_clear_mutex = TRUE(!(0)); |
| 20552 | _tmp147_ = ccall; |
| 20553 | _tmp148_ = type; |
| 20554 | _tmp149_ = bala_data_type_get_type_symbol (_tmp148_); |
| 20555 | _tmp150_ = _tmp149_; |
| 20556 | _tmp151_ = bala_get_ccode_name ((BalaCodeNode*) _tmp150_); |
| 20557 | _tmp152_ = _tmp151_; |
| 20558 | _tmp153_ = g_strconcat ("_bala_clear_", _tmp152_, NULL((void*)0)); |
| 20559 | _tmp154_ = _tmp153_; |
| 20560 | _tmp155_ = bala_ccode_identifier_new (_tmp154_); |
| 20561 | _tmp156_ = _tmp155_; |
| 20562 | bala_ccode_function_call_set_call (_tmp147_, (BalaCCodeExpression*) _tmp156_); |
| 20563 | _bala_ccode_node_unref0 (_tmp156_)((_tmp156_ == ((void*)0)) ? ((void*)0) : (_tmp156_ = (bala_ccode_node_unref (_tmp156_), ((void*)0)))); |
| 20564 | _g_free0 (_tmp154_)(_tmp154_ = (g_free (_tmp154_), ((void*)0))); |
| 20565 | _g_free0 (_tmp152_)(_tmp152_ = (g_free (_tmp152_), ((void*)0))); |
| 20566 | result = (BalaCCodeExpression*) ccall; |
| 20567 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 20568 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 20569 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 20570 | return result; |
| 20571 | } else { |
| 20572 | result = (BalaCCodeExpression*) ccall; |
| 20573 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 20574 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 20575 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 20576 | return result; |
| 20577 | } |
| 20578 | } |
| 20579 | } |
| 20580 | if (!is_gcollection) { |
| 20581 | BalaCCodeFunctionCall* _tmp161_; |
| 20582 | BalaCCodeExpression* _tmp162_; |
| 20583 | BalaCCodeExpression* _tmp163_; |
| 20584 | _tmp161_ = ccall; |
| 20585 | _tmp162_ = bala_ccode_function_call_get_call (_tmp161_); |
| 20586 | _tmp163_ = _tmp162_; |
| 20587 | _tmp160_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp163_, BALA_TYPE_CCODE_IDENTIFIER)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp163_); GType __t = ((bala_ccode_identifier_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } ))); |
| 20588 | } else { |
| 20589 | _tmp160_ = FALSE(0); |
| 20590 | } |
| 20591 | if (_tmp160_) { |
| 20592 | BalaDataType* _tmp164_; |
| 20593 | _tmp164_ = type; |
| 20594 | _tmp159_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp164_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp164_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 20595 | } else { |
| 20596 | _tmp159_ = FALSE(0); |
| 20597 | } |
| 20598 | if (_tmp159_) { |
| 20599 | BalaDataType* _tmp165_; |
| 20600 | _tmp165_ = type; |
| 20601 | _tmp158_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp165_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp165_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 20602 | } else { |
| 20603 | _tmp158_ = FALSE(0); |
| 20604 | } |
| 20605 | if (_tmp158_) { |
| 20606 | _tmp157_ = !is_macro_definition; |
| 20607 | } else { |
| 20608 | _tmp157_ = FALSE(0); |
| 20609 | } |
| 20610 | if (_tmp157_) { |
| 20611 | BalaCCodeIdentifier* freeid = NULL((void*)0); |
| 20612 | BalaCCodeFunctionCall* _tmp166_; |
| 20613 | BalaCCodeExpression* _tmp167_; |
| 20614 | BalaCCodeExpression* _tmp168_; |
| 20615 | BalaCCodeIdentifier* _tmp169_; |
| 20616 | gchar* free0_func = NULL((void*)0); |
| 20617 | BalaCCodeIdentifier* _tmp170_; |
| 20618 | const gchar* _tmp171_; |
| 20619 | const gchar* _tmp172_; |
| 20620 | gchar* _tmp173_; |
| 20621 | const gchar* _tmp174_; |
| 20622 | BalaCCodeExpression* _tmp194_; |
| 20623 | const gchar* _tmp199_; |
| 20624 | BalaCCodeIdentifier* _tmp200_; |
| 20625 | BalaCCodeIdentifier* _tmp201_; |
| 20626 | BalaCCodeFunctionCall* _tmp202_; |
| 20627 | BalaCCodeFunctionCall* _tmp203_; |
| 20628 | BalaCCodeExpression* _tmp204_; |
| 20629 | _tmp166_ = ccall; |
| 20630 | _tmp167_ = bala_ccode_function_call_get_call (_tmp166_); |
| 20631 | _tmp168_ = _tmp167_; |
| 20632 | _tmp169_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp168_, BALA_TYPE_CCODE_IDENTIFIER, BalaCCodeIdentifier)(((BalaCCodeIdentifier*) g_type_check_instance_cast ((GTypeInstance *) (_tmp168_), ((bala_ccode_identifier_get_type ())))))); |
| 20633 | freeid = _tmp169_; |
| 20634 | _tmp170_ = freeid; |
| 20635 | _tmp171_ = bala_ccode_identifier_get_name (_tmp170_); |
| 20636 | _tmp172_ = _tmp171_; |
| 20637 | _tmp173_ = g_strdup_printf ("_%s0", _tmp172_); |
| 20638 | free0_func = _tmp173_; |
| 20639 | _tmp174_ = free0_func; |
| 20640 | if (bala_ccode_base_module_add_wrapper (self, _tmp174_)) { |
| 20641 | BalaCCodeExpression* macro = NULL((void*)0); |
| 20642 | BalaDataType* _tmp175_; |
| 20643 | BalaCCodeIdentifier* _tmp176_; |
| 20644 | BalaCCodeIdentifier* _tmp177_; |
| 20645 | BalaGLibValue* _tmp178_; |
| 20646 | BalaGLibValue* _tmp179_; |
| 20647 | BalaCCodeExpression* _tmp180_; |
| 20648 | BalaCCodeExpression* _tmp181_; |
| 20649 | BalaCCodeFile* _tmp182_; |
| 20650 | const gchar* _tmp183_; |
| 20651 | gchar* _tmp184_; |
| 20652 | gchar* _tmp185_; |
| 20653 | BalaCCodeExpression* _tmp186_; |
| 20654 | BalaCCodeMacroReplacement* _tmp187_; |
| 20655 | BalaCCodeMacroReplacement* _tmp188_; |
| 20656 | _tmp175_ = type; |
| 20657 | _tmp176_ = bala_ccode_identifier_new ("var"); |
| 20658 | _tmp177_ = _tmp176_; |
| 20659 | _tmp178_ = bala_glib_value_new (_tmp175_, (BalaCCodeExpression*) _tmp177_, TRUE(!(0))); |
| 20660 | _tmp179_ = _tmp178_; |
| 20661 | _tmp180_ = bala_ccode_base_module_destroy_value (self, (BalaTargetValue*) _tmp179_, TRUE(!(0))); |
| 20662 | _tmp181_ = _tmp180_; |
| 20663 | _bala_target_value_unref0 (_tmp179_)((_tmp179_ == ((void*)0)) ? ((void*)0) : (_tmp179_ = (bala_target_value_unref (_tmp179_), ((void*)0)))); |
| 20664 | _bala_ccode_node_unref0 (_tmp177_)((_tmp177_ == ((void*)0)) ? ((void*)0) : (_tmp177_ = (bala_ccode_node_unref (_tmp177_), ((void*)0)))); |
| 20665 | macro = _tmp181_; |
| 20666 | _tmp182_ = self->cfile; |
| 20667 | _tmp183_ = free0_func; |
| 20668 | _tmp184_ = g_strdup_printf ("%s(var)", _tmp183_); |
| 20669 | _tmp185_ = _tmp184_; |
| 20670 | _tmp186_ = macro; |
| 20671 | _tmp187_ = bala_ccode_macro_replacement_new_with_expression (_tmp185_, _tmp186_); |
| 20672 | _tmp188_ = _tmp187_; |
| 20673 | bala_ccode_file_add_type_declaration (_tmp182_, (BalaCCodeNode*) _tmp188_); |
| 20674 | _bala_ccode_node_unref0 (_tmp188_)((_tmp188_ == ((void*)0)) ? ((void*)0) : (_tmp188_ = (bala_ccode_node_unref (_tmp188_), ((void*)0)))); |
| 20675 | _g_free0 (_tmp185_)(_tmp185_ = (g_free (_tmp185_), ((void*)0))); |
| 20676 | _bala_ccode_node_unref0 (macro)((macro == ((void*)0)) ? ((void*)0) : (macro = (bala_ccode_node_unref (macro), ((void*)0)))); |
| 20677 | } |
| 20678 | while (TRUE(!(0))) { |
| 20679 | BalaCCodeExpression* _tmp189_; |
| 20680 | BalaCCodeExpression* _tmp190_; |
| 20681 | BalaCCodeExpression* _tmp191_; |
| 20682 | BalaCCodeExpression* _tmp192_; |
| 20683 | BalaCCodeExpression* _tmp193_; |
| 20684 | _tmp189_ = cvar; |
| 20685 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp189_, BALA_TYPE_CCODE_CAST_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp189_); GType __t = ((bala_ccode_cast_expression_get_type ( ))); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 20686 | break; |
| 20687 | } |
| 20688 | _tmp190_ = cvar; |
| 20689 | _tmp191_ = bala_ccode_cast_expression_get_inner (G_TYPE_CHECK_INSTANCE_CAST (_tmp190_, BALA_TYPE_CCODE_CAST_EXPRESSION, BalaCCodeCastExpression)(((BalaCCodeCastExpression*) g_type_check_instance_cast ((GTypeInstance *) (_tmp190_), ((bala_ccode_cast_expression_get_type ())))))); |
| 20690 | _tmp192_ = _tmp191_; |
| 20691 | _tmp193_ = _bala_ccode_node_ref0 (_tmp192_); |
| 20692 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 20693 | cvar = _tmp193_; |
| 20694 | } |
| 20695 | _tmp194_ = cvar; |
| 20696 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp194_, BALA_TYPE_CCODE_FUNCTION_CALL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp194_); GType __t = ((bala_ccode_function_call_get_type () )); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 20697 | BalaCCodeExpression* _tmp195_; |
| 20698 | BalaList* _tmp196_; |
| 20699 | BalaList* _tmp197_; |
| 20700 | gpointer _tmp198_; |
| 20701 | _tmp195_ = cvar; |
| 20702 | _tmp196_ = bala_ccode_function_call_get_arguments (G_TYPE_CHECK_INSTANCE_CAST (_tmp195_, BALA_TYPE_CCODE_FUNCTION_CALL, BalaCCodeFunctionCall)(((BalaCCodeFunctionCall*) g_type_check_instance_cast ((GTypeInstance *) (_tmp195_), ((bala_ccode_function_call_get_type ())))))); |
| 20703 | _tmp197_ = _tmp196_; |
| 20704 | _tmp198_ = bala_list_get (_tmp197_, 0); |
| 20705 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 20706 | cvar = (BalaCCodeExpression*) _tmp198_; |
| 20707 | _bala_iterable_unref0 (_tmp197_)((_tmp197_ == ((void*)0)) ? ((void*)0) : (_tmp197_ = (bala_iterable_unref (_tmp197_), ((void*)0)))); |
| 20708 | } |
| 20709 | _tmp199_ = free0_func; |
| 20710 | _tmp200_ = bala_ccode_identifier_new (_tmp199_); |
| 20711 | _tmp201_ = _tmp200_; |
| 20712 | _tmp202_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp201_); |
| 20713 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 20714 | ccall = _tmp202_; |
| 20715 | _bala_ccode_node_unref0 (_tmp201_)((_tmp201_ == ((void*)0)) ? ((void*)0) : (_tmp201_ = (bala_ccode_node_unref (_tmp201_), ((void*)0)))); |
| 20716 | _tmp203_ = ccall; |
| 20717 | _tmp204_ = cvar; |
| 20718 | bala_ccode_function_call_add_argument (_tmp203_, _tmp204_); |
| 20719 | result = (BalaCCodeExpression*) ccall; |
| 20720 | _g_free0 (free0_func)(free0_func = (g_free (free0_func), ((void*)0))); |
| 20721 | _bala_ccode_node_unref0 (freeid)((freeid == ((void*)0)) ? ((void*)0) : (freeid = (bala_ccode_node_unref (freeid), ((void*)0)))); |
| 20722 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 20723 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 20724 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 20725 | return result; |
| 20726 | } |
| 20727 | _tmp205_ = self->priv->_context; |
| 20728 | _tmp206_ = bala_code_context_get_profile (_tmp205_); |
| 20729 | _tmp207_ = _tmp206_; |
| 20730 | if (_tmp207_ != BALA_PROFILE_GOBJECT) { |
| 20731 | BalaCCodeFile* _tmp208_; |
| 20732 | _tmp208_ = self->cfile; |
| 20733 | bala_ccode_file_add_include (_tmp208_, "stddef.h", FALSE(0)); |
| 20734 | } |
| 20735 | _tmp209_ = cvar; |
| 20736 | _tmp210_ = bala_ccode_constant_new ("NULL"); |
| 20737 | _tmp211_ = _tmp210_; |
| 20738 | _tmp212_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, _tmp209_, (BalaCCodeExpression*) _tmp211_); |
| 20739 | _tmp213_ = _tmp212_; |
| 20740 | _bala_ccode_node_unref0 (_tmp211_)((_tmp211_ == ((void*)0)) ? ((void*)0) : (_tmp211_ = (bala_ccode_node_unref (_tmp211_), ((void*)0)))); |
| 20741 | cisnull = _tmp213_; |
| 20742 | _tmp214_ = type; |
| 20743 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp214_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp214_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 20744 | BalaSymbol* parent = NULL((void*)0); |
| 20745 | BalaDataType* _tmp215_; |
| 20746 | BalaTypeParameter* _tmp216_; |
| 20747 | BalaTypeParameter* _tmp217_; |
| 20748 | BalaSymbol* _tmp218_; |
| 20749 | BalaSymbol* _tmp219_; |
| 20750 | BalaSymbol* _tmp220_; |
| 20751 | BalaClass* cl = NULL((void*)0); |
| 20752 | BalaSymbol* _tmp221_; |
| 20753 | BalaClass* _tmp222_; |
| 20754 | gboolean _tmp223_ = FALSE(0); |
| 20755 | gboolean _tmp224_ = FALSE(0); |
| 20756 | BalaSymbol* _tmp225_; |
| 20757 | BalaCCodeBinaryExpression* cunrefisnull = NULL((void*)0); |
| 20758 | BalaDataType* _tmp233_; |
| 20759 | BalaCCodeExpression* _tmp234_; |
| 20760 | BalaCCodeExpression* _tmp235_; |
| 20761 | BalaCCodeConstant* _tmp236_; |
| 20762 | BalaCCodeConstant* _tmp237_; |
| 20763 | BalaCCodeBinaryExpression* _tmp238_; |
| 20764 | BalaCCodeBinaryExpression* _tmp239_; |
| 20765 | BalaCCodeBinaryExpression* _tmp240_; |
| 20766 | BalaCCodeBinaryExpression* _tmp241_; |
| 20767 | BalaCCodeBinaryExpression* _tmp242_; |
| 20768 | _tmp215_ = type; |
| 20769 | _tmp216_ = bala_generic_type_get_type_parameter (G_TYPE_CHECK_INSTANCE_CAST (_tmp215_, BALA_TYPE_GENERIC_TYPE, BalaGenericType)(((BalaGenericType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp215_), ((bala_generic_type_get_type ())))))); |
| 20770 | _tmp217_ = _tmp216_; |
| 20771 | _tmp218_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp217_); |
| 20772 | _tmp219_ = _tmp218_; |
| 20773 | _tmp220_ = _bala_code_node_ref0 (_tmp219_); |
| 20774 | parent = _tmp220_; |
| 20775 | _tmp221_ = parent; |
| 20776 | _tmp222_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp221_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp221_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp221_) : NULL((void*)0)); |
| 20777 | cl = _tmp222_; |
| 20778 | _tmp225_ = parent; |
| 20779 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp225_, BALA_TYPE_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp225_); GType __t = ((bala_method_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 20780 | BalaSymbol* _tmp226_; |
| 20781 | _tmp226_ = parent; |
| 20782 | _tmp224_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp226_, BALA_TYPE_OBJECT_TYPE_SYMBOL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp226_); GType __t = ((bala_object_type_symbol_get_type ()) ); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 20783 | } else { |
| 20784 | _tmp224_ = FALSE(0); |
| 20785 | } |
| 20786 | if (_tmp224_) { |
| 20787 | _tmp223_ = TRUE(!(0)); |
| 20788 | } else { |
| 20789 | gboolean _tmp227_ = FALSE(0); |
| 20790 | BalaClass* _tmp228_; |
| 20791 | _tmp228_ = cl; |
| 20792 | if (_tmp228_ != NULL((void*)0)) { |
| 20793 | BalaClass* _tmp229_; |
| 20794 | gboolean _tmp230_; |
| 20795 | gboolean _tmp231_; |
| 20796 | _tmp229_ = cl; |
| 20797 | _tmp230_ = bala_class_get_is_compact (_tmp229_); |
| 20798 | _tmp231_ = _tmp230_; |
| 20799 | _tmp227_ = _tmp231_; |
| 20800 | } else { |
| 20801 | _tmp227_ = FALSE(0); |
| 20802 | } |
| 20803 | _tmp223_ = _tmp227_; |
| 20804 | } |
| 20805 | if (_tmp223_) { |
| 20806 | BalaCCodeConstant* _tmp232_; |
| 20807 | _tmp232_ = bala_ccode_constant_new ("NULL"); |
| 20808 | result = (BalaCCodeExpression*) _tmp232_; |
| 20809 | _bala_code_node_unref0 (cl)((cl == ((void*)0)) ? ((void*)0) : (cl = (bala_code_node_unref (cl), ((void*)0)))); |
| 20810 | _bala_code_node_unref0 (parent)((parent == ((void*)0)) ? ((void*)0) : (parent = (bala_code_node_unref (parent), ((void*)0)))); |
| 20811 | _bala_ccode_node_unref0 (cisnull)((cisnull == ((void*)0)) ? ((void*)0) : (cisnull = (bala_ccode_node_unref (cisnull), ((void*)0)))); |
| 20812 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 20813 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 20814 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 20815 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 20816 | return result; |
| 20817 | } |
| 20818 | _tmp233_ = type; |
| 20819 | _tmp234_ = bala_ccode_base_module_get_destroy_func_expression (self, _tmp233_, FALSE(0)); |
| 20820 | _tmp235_ = _tmp234_; |
| 20821 | _tmp236_ = bala_ccode_constant_new ("NULL"); |
| 20822 | _tmp237_ = _tmp236_; |
| 20823 | _tmp238_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, _tmp235_, (BalaCCodeExpression*) _tmp237_); |
| 20824 | _tmp239_ = _tmp238_; |
| 20825 | _bala_ccode_node_unref0 (_tmp237_)((_tmp237_ == ((void*)0)) ? ((void*)0) : (_tmp237_ = (bala_ccode_node_unref (_tmp237_), ((void*)0)))); |
| 20826 | _bala_ccode_node_unref0 (_tmp235_)((_tmp235_ == ((void*)0)) ? ((void*)0) : (_tmp235_ = (bala_ccode_node_unref (_tmp235_), ((void*)0)))); |
| 20827 | cunrefisnull = _tmp239_; |
| 20828 | _tmp240_ = cisnull; |
| 20829 | _tmp241_ = cunrefisnull; |
| 20830 | _tmp242_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_OR, (BalaCCodeExpression*) _tmp240_, (BalaCCodeExpression*) _tmp241_); |
| 20831 | _bala_ccode_node_unref0 (cisnull)((cisnull == ((void*)0)) ? ((void*)0) : (cisnull = (bala_ccode_node_unref (cisnull), ((void*)0)))); |
| 20832 | cisnull = _tmp242_; |
| 20833 | _bala_ccode_node_unref0 (cunrefisnull)((cunrefisnull == ((void*)0)) ? ((void*)0) : (cunrefisnull = ( bala_ccode_node_unref (cunrefisnull), ((void*)0)))); |
| 20834 | _bala_code_node_unref0 (cl)((cl == ((void*)0)) ? ((void*)0) : (cl = (bala_code_node_unref (cl), ((void*)0)))); |
| 20835 | _bala_code_node_unref0 (parent)((parent == ((void*)0)) ? ((void*)0) : (parent = (bala_code_node_unref (parent), ((void*)0)))); |
| 20836 | } |
| 20837 | _tmp243_ = ccall; |
| 20838 | _tmp244_ = cvar; |
| 20839 | bala_ccode_function_call_insert_argument (_tmp243_, 0, _tmp244_); |
| 20840 | _tmp245_ = bala_ccode_comma_expression_new (); |
| 20841 | ccomma = _tmp245_; |
| 20842 | _tmp249_ = self->priv->_context; |
| 20843 | _tmp250_ = bala_code_context_get_profile (_tmp249_); |
| 20844 | _tmp251_ = _tmp250_; |
| 20845 | if (_tmp251_ == BALA_PROFILE_GOBJECT) { |
| 20846 | BalaDataType* _tmp252_; |
| 20847 | BalaTypeSymbol* _tmp253_; |
| 20848 | BalaTypeSymbol* _tmp254_; |
| 20849 | _tmp252_ = type; |
| 20850 | _tmp253_ = bala_data_type_get_type_symbol (_tmp252_); |
| 20851 | _tmp254_ = _tmp253_; |
| 20852 | _tmp248_ = _tmp254_ != NULL((void*)0); |
| 20853 | } else { |
| 20854 | _tmp248_ = FALSE(0); |
| 20855 | } |
| 20856 | if (_tmp248_) { |
| 20857 | BalaDataType* _tmp255_; |
| 20858 | BalaTypeSymbol* _tmp256_; |
| 20859 | BalaTypeSymbol* _tmp257_; |
| 20860 | _tmp255_ = type; |
| 20861 | _tmp256_ = bala_data_type_get_type_symbol (_tmp255_); |
| 20862 | _tmp257_ = _tmp256_; |
| 20863 | _tmp247_ = !bala_is_reference_counting (_tmp257_); |
| 20864 | } else { |
| 20865 | _tmp247_ = FALSE(0); |
| 20866 | } |
| 20867 | if (_tmp247_) { |
| 20868 | gboolean _tmp258_ = FALSE(0); |
| 20869 | gboolean _tmp259_ = FALSE(0); |
| 20870 | gboolean _tmp260_ = FALSE(0); |
| 20871 | BalaDataType* _tmp261_; |
| 20872 | BalaTypeSymbol* _tmp262_; |
| 20873 | BalaTypeSymbol* _tmp263_; |
| 20874 | BalaTypeSymbol* _tmp264_; |
| 20875 | _tmp261_ = type; |
| 20876 | _tmp262_ = bala_data_type_get_type_symbol (_tmp261_); |
| 20877 | _tmp263_ = _tmp262_; |
| 20878 | _tmp264_ = self->gstringbuilder_type; |
| 20879 | if (bala_typesymbol_is_subtype_of (_tmp263_, _tmp264_)) { |
| 20880 | _tmp260_ = TRUE(!(0)); |
| 20881 | } else { |
| 20882 | BalaDataType* _tmp265_; |
| 20883 | BalaTypeSymbol* _tmp266_; |
| 20884 | BalaTypeSymbol* _tmp267_; |
| 20885 | BalaTypeSymbol* _tmp268_; |
| 20886 | _tmp265_ = type; |
| 20887 | _tmp266_ = bala_data_type_get_type_symbol (_tmp265_); |
| 20888 | _tmp267_ = _tmp266_; |
| 20889 | _tmp268_ = self->garray_type; |
| 20890 | _tmp260_ = bala_typesymbol_is_subtype_of (_tmp267_, _tmp268_); |
| 20891 | } |
| 20892 | if (_tmp260_) { |
| 20893 | _tmp259_ = TRUE(!(0)); |
| 20894 | } else { |
| 20895 | BalaDataType* _tmp269_; |
| 20896 | BalaTypeSymbol* _tmp270_; |
| 20897 | BalaTypeSymbol* _tmp271_; |
| 20898 | BalaTypeSymbol* _tmp272_; |
| 20899 | _tmp269_ = type; |
| 20900 | _tmp270_ = bala_data_type_get_type_symbol (_tmp269_); |
| 20901 | _tmp271_ = _tmp270_; |
| 20902 | _tmp272_ = self->gbytearray_type; |
| 20903 | _tmp259_ = bala_typesymbol_is_subtype_of (_tmp271_, _tmp272_); |
| 20904 | } |
| 20905 | if (_tmp259_) { |
| 20906 | _tmp258_ = TRUE(!(0)); |
| 20907 | } else { |
| 20908 | BalaDataType* _tmp273_; |
| 20909 | BalaTypeSymbol* _tmp274_; |
| 20910 | BalaTypeSymbol* _tmp275_; |
| 20911 | BalaTypeSymbol* _tmp276_; |
| 20912 | _tmp273_ = type; |
| 20913 | _tmp274_ = bala_data_type_get_type_symbol (_tmp273_); |
| 20914 | _tmp275_ = _tmp274_; |
| 20915 | _tmp276_ = self->gptrarray_type; |
| 20916 | _tmp258_ = bala_typesymbol_is_subtype_of (_tmp275_, _tmp276_); |
| 20917 | } |
| 20918 | _tmp246_ = _tmp258_; |
| 20919 | } else { |
| 20920 | _tmp246_ = FALSE(0); |
| 20921 | } |
| 20922 | if (_tmp246_) { |
| 20923 | BalaCCodeFunctionCall* _tmp277_; |
| 20924 | BalaCCodeConstant* _tmp278_; |
| 20925 | BalaCCodeConstant* _tmp279_; |
| 20926 | _tmp277_ = ccall; |
| 20927 | _tmp278_ = bala_ccode_constant_new ("TRUE"); |
| 20928 | _tmp279_ = _tmp278_; |
| 20929 | bala_ccode_function_call_add_argument (_tmp277_, (BalaCCodeExpression*) _tmp279_); |
| 20930 | _bala_ccode_node_unref0 (_tmp279_)((_tmp279_ == ((void*)0)) ? ((void*)0) : (_tmp279_ = (bala_ccode_node_unref (_tmp279_), ((void*)0)))); |
| 20931 | } else { |
| 20932 | gboolean _tmp280_ = FALSE(0); |
| 20933 | BalaCodeContext* _tmp281_; |
| 20934 | BalaProfile _tmp282_; |
| 20935 | BalaProfile _tmp283_; |
| 20936 | _tmp281_ = self->priv->_context; |
| 20937 | _tmp282_ = bala_code_context_get_profile (_tmp281_); |
| 20938 | _tmp283_ = _tmp282_; |
| 20939 | if (_tmp283_ == BALA_PROFILE_GOBJECT) { |
| 20940 | BalaDataType* _tmp284_; |
| 20941 | BalaTypeSymbol* _tmp285_; |
| 20942 | BalaTypeSymbol* _tmp286_; |
| 20943 | BalaTypeSymbol* _tmp287_; |
| 20944 | _tmp284_ = type; |
| 20945 | _tmp285_ = bala_data_type_get_type_symbol (_tmp284_); |
| 20946 | _tmp286_ = _tmp285_; |
| 20947 | _tmp287_ = self->gthreadpool_type; |
| 20948 | _tmp280_ = _tmp286_ == _tmp287_; |
| 20949 | } else { |
| 20950 | _tmp280_ = FALSE(0); |
| 20951 | } |
| 20952 | if (_tmp280_) { |
| 20953 | BalaCCodeFunctionCall* _tmp288_; |
| 20954 | BalaCCodeConstant* _tmp289_; |
| 20955 | BalaCCodeConstant* _tmp290_; |
| 20956 | BalaCCodeFunctionCall* _tmp291_; |
| 20957 | BalaCCodeConstant* _tmp292_; |
| 20958 | BalaCCodeConstant* _tmp293_; |
| 20959 | _tmp288_ = ccall; |
| 20960 | _tmp289_ = bala_ccode_constant_new ("FALSE"); |
| 20961 | _tmp290_ = _tmp289_; |
| 20962 | bala_ccode_function_call_add_argument (_tmp288_, (BalaCCodeExpression*) _tmp290_); |
| 20963 | _bala_ccode_node_unref0 (_tmp290_)((_tmp290_ == ((void*)0)) ? ((void*)0) : (_tmp290_ = (bala_ccode_node_unref (_tmp290_), ((void*)0)))); |
| 20964 | _tmp291_ = ccall; |
| 20965 | _tmp292_ = bala_ccode_constant_new ("TRUE"); |
| 20966 | _tmp293_ = _tmp292_; |
| 20967 | bala_ccode_function_call_add_argument (_tmp291_, (BalaCCodeExpression*) _tmp293_); |
| 20968 | _bala_ccode_node_unref0 (_tmp293_)((_tmp293_ == ((void*)0)) ? ((void*)0) : (_tmp293_ = (bala_ccode_node_unref (_tmp293_), ((void*)0)))); |
| 20969 | } else { |
| 20970 | BalaDataType* _tmp294_; |
| 20971 | _tmp294_ = type; |
| 20972 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp294_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp294_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 20973 | BalaArrayType* array_type = NULL((void*)0); |
| 20974 | BalaDataType* _tmp295_; |
| 20975 | BalaArrayType* _tmp296_; |
| 20976 | BalaArrayType* _tmp297_; |
| 20977 | BalaDataType* _tmp298_; |
| 20978 | BalaDataType* _tmp299_; |
| 20979 | _tmp295_ = type; |
| 20980 | _tmp296_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp295_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp295_), ((bala_array_type_get_type ())))))); |
| 20981 | array_type = _tmp296_; |
| 20982 | _tmp297_ = array_type; |
| 20983 | _tmp298_ = bala_array_type_get_element_type (_tmp297_); |
| 20984 | _tmp299_ = _tmp298_; |
| 20985 | if (bala_ccode_base_module_requires_destroy (_tmp299_)) { |
| 20986 | BalaCCodeExpression* csizeexpr = NULL((void*)0); |
| 20987 | BalaList* _tmp300_; |
| 20988 | BalaCCodeExpression* _tmp312_; |
| 20989 | csizeexpr = NULL((void*)0); |
| 20990 | _tmp300_ = G_TYPE_CHECK_INSTANCE_CAST (value, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (value), ((bala_glib_value_get_type ())))))->array_length_cvalues; |
| 20991 | if (_tmp300_ != NULL((void*)0)) { |
| 20992 | BalaCCodeExpression* _tmp301_; |
| 20993 | _tmp301_ = bala_ccode_base_module_get_array_length_cvalue (self, value, -1); |
| 20994 | _bala_ccode_node_unref0 (csizeexpr)((csizeexpr == ((void*)0)) ? ((void*)0) : (csizeexpr = (bala_ccode_node_unref (csizeexpr), ((void*)0)))); |
| 20995 | csizeexpr = _tmp301_; |
| 20996 | } else { |
| 20997 | if (bala_get_array_null_terminated (value)) { |
| 20998 | BalaCCodeFunctionCall* len_call = NULL((void*)0); |
| 20999 | BalaCCodeIdentifier* _tmp302_; |
| 21000 | BalaCCodeIdentifier* _tmp303_; |
| 21001 | BalaCCodeFunctionCall* _tmp304_; |
| 21002 | BalaCCodeFunctionCall* _tmp305_; |
| 21003 | BalaCCodeFunctionCall* _tmp306_; |
| 21004 | BalaCCodeExpression* _tmp307_; |
| 21005 | BalaCCodeFunctionCall* _tmp308_; |
| 21006 | BalaCCodeExpression* _tmp309_; |
| 21007 | self->requires_array_length = TRUE(!(0)); |
| 21008 | _tmp302_ = bala_ccode_identifier_new ("_bala_array_length"); |
| 21009 | _tmp303_ = _tmp302_; |
| 21010 | _tmp304_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp303_); |
| 21011 | _tmp305_ = _tmp304_; |
| 21012 | _bala_ccode_node_unref0 (_tmp303_)((_tmp303_ == ((void*)0)) ? ((void*)0) : (_tmp303_ = (bala_ccode_node_unref (_tmp303_), ((void*)0)))); |
| 21013 | len_call = _tmp305_; |
| 21014 | _tmp306_ = len_call; |
| 21015 | _tmp307_ = cvar; |
| 21016 | bala_ccode_function_call_add_argument (_tmp306_, _tmp307_); |
| 21017 | _tmp308_ = len_call; |
| 21018 | _tmp309_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp308_); |
| 21019 | _bala_ccode_node_unref0 (csizeexpr)((csizeexpr == ((void*)0)) ? ((void*)0) : (csizeexpr = (bala_ccode_node_unref (csizeexpr), ((void*)0)))); |
| 21020 | csizeexpr = _tmp309_; |
| 21021 | _bala_ccode_node_unref0 (len_call)((len_call == ((void*)0)) ? ((void*)0) : (len_call = (bala_ccode_node_unref (len_call), ((void*)0)))); |
| 21022 | } else { |
| 21023 | BalaCCodeExpression* _tmp310_; |
| 21024 | BalaCCodeExpression* _tmp311_; |
| 21025 | _tmp310_ = bala_get_array_length_cexpr (value); |
| 21026 | _tmp311_ = _bala_ccode_node_ref0 (_tmp310_); |
| 21027 | _bala_ccode_node_unref0 (csizeexpr)((csizeexpr == ((void*)0)) ? ((void*)0) : (csizeexpr = (bala_ccode_node_unref (csizeexpr), ((void*)0)))); |
| 21028 | csizeexpr = _tmp311_; |
| 21029 | } |
| 21030 | } |
| 21031 | _tmp312_ = csizeexpr; |
| 21032 | if (_tmp312_ != NULL((void*)0)) { |
| 21033 | BalaStruct* st = NULL((void*)0); |
| 21034 | BalaArrayType* _tmp313_; |
| 21035 | BalaDataType* _tmp314_; |
| 21036 | BalaDataType* _tmp315_; |
| 21037 | BalaTypeSymbol* _tmp316_; |
| 21038 | BalaTypeSymbol* _tmp317_; |
| 21039 | gboolean _tmp318_ = FALSE(0); |
| 21040 | BalaStruct* _tmp319_; |
| 21041 | _tmp313_ = array_type; |
| 21042 | _tmp314_ = bala_array_type_get_element_type (_tmp313_); |
| 21043 | _tmp315_ = _tmp314_; |
| 21044 | _tmp316_ = bala_data_type_get_type_symbol (_tmp315_); |
| 21045 | _tmp317_ = _tmp316_; |
| 21046 | st = G_TYPE_CHECK_INSTANCE_TYPE (_tmp317_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp317_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp317_) : NULL((void*)0); |
| 21047 | _tmp319_ = st; |
| 21048 | if (_tmp319_ != NULL((void*)0)) { |
| 21049 | BalaArrayType* _tmp320_; |
| 21050 | BalaDataType* _tmp321_; |
| 21051 | BalaDataType* _tmp322_; |
| 21052 | gboolean _tmp323_; |
| 21053 | gboolean _tmp324_; |
| 21054 | _tmp320_ = array_type; |
| 21055 | _tmp321_ = bala_array_type_get_element_type (_tmp320_); |
| 21056 | _tmp322_ = _tmp321_; |
| 21057 | _tmp323_ = bala_data_type_get_nullable (_tmp322_); |
| 21058 | _tmp324_ = _tmp323_; |
| 21059 | _tmp318_ = !_tmp324_; |
| 21060 | } else { |
| 21061 | _tmp318_ = FALSE(0); |
| 21062 | } |
| 21063 | if (_tmp318_) { |
| 21064 | BalaCCodeFunctionCall* _tmp325_; |
| 21065 | BalaStruct* _tmp326_; |
| 21066 | gchar* _tmp327_; |
| 21067 | gchar* _tmp328_; |
| 21068 | BalaCCodeIdentifier* _tmp329_; |
| 21069 | BalaCCodeIdentifier* _tmp330_; |
| 21070 | BalaCCodeFunctionCall* _tmp331_; |
| 21071 | BalaCCodeExpression* _tmp332_; |
| 21072 | _tmp325_ = ccall; |
| 21073 | _tmp326_ = st; |
| 21074 | _tmp327_ = bala_ccode_base_module_append_struct_array_free (self, _tmp326_); |
| 21075 | _tmp328_ = _tmp327_; |
| 21076 | _tmp329_ = bala_ccode_identifier_new (_tmp328_); |
| 21077 | _tmp330_ = _tmp329_; |
| 21078 | bala_ccode_function_call_set_call (_tmp325_, (BalaCCodeExpression*) _tmp330_); |
| 21079 | _bala_ccode_node_unref0 (_tmp330_)((_tmp330_ == ((void*)0)) ? ((void*)0) : (_tmp330_ = (bala_ccode_node_unref (_tmp330_), ((void*)0)))); |
| 21080 | _g_free0 (_tmp328_)(_tmp328_ = (g_free (_tmp328_), ((void*)0))); |
| 21081 | _tmp331_ = ccall; |
| 21082 | _tmp332_ = csizeexpr; |
| 21083 | bala_ccode_function_call_add_argument (_tmp331_, _tmp332_); |
| 21084 | } else { |
| 21085 | BalaDelegateType* _tmp333_; |
| 21086 | BalaCCodeFile* _tmp334_; |
| 21087 | BalaCCodeFunctionCall* _tmp335_; |
| 21088 | BalaCCodeIdentifier* _tmp336_; |
| 21089 | BalaCCodeIdentifier* _tmp337_; |
| 21090 | BalaCCodeFunctionCall* _tmp338_; |
| 21091 | BalaCCodeExpression* _tmp339_; |
| 21092 | BalaCCodeFunctionCall* _tmp340_; |
| 21093 | BalaArrayType* _tmp341_; |
| 21094 | BalaDataType* _tmp342_; |
| 21095 | BalaDataType* _tmp343_; |
| 21096 | BalaCCodeExpression* _tmp344_; |
| 21097 | BalaCCodeExpression* _tmp345_; |
| 21098 | BalaDelegateType* _tmp346_; |
| 21099 | gchar* _tmp347_; |
| 21100 | gchar* _tmp348_; |
| 21101 | BalaCCodeCastExpression* _tmp349_; |
| 21102 | BalaCCodeCastExpression* _tmp350_; |
| 21103 | self->requires_array_free = TRUE(!(0)); |
| 21104 | _tmp333_ = self->delegate_target_destroy_type; |
| 21105 | _tmp334_ = self->cfile; |
| 21106 | bala_ccode_base_module_generate_type_declaration (self, (BalaDataType*) _tmp333_, _tmp334_); |
| 21107 | _tmp335_ = ccall; |
| 21108 | _tmp336_ = bala_ccode_identifier_new ("_bala_array_free"); |
| 21109 | _tmp337_ = _tmp336_; |
| 21110 | bala_ccode_function_call_set_call (_tmp335_, (BalaCCodeExpression*) _tmp337_); |
| 21111 | _bala_ccode_node_unref0 (_tmp337_)((_tmp337_ == ((void*)0)) ? ((void*)0) : (_tmp337_ = (bala_ccode_node_unref (_tmp337_), ((void*)0)))); |
| 21112 | _tmp338_ = ccall; |
| 21113 | _tmp339_ = csizeexpr; |
| 21114 | bala_ccode_function_call_add_argument (_tmp338_, _tmp339_); |
| 21115 | _tmp340_ = ccall; |
| 21116 | _tmp341_ = array_type; |
| 21117 | _tmp342_ = bala_array_type_get_element_type (_tmp341_); |
| 21118 | _tmp343_ = _tmp342_; |
| 21119 | _tmp344_ = bala_ccode_base_module_get_destroy_func_expression (self, _tmp343_, FALSE(0)); |
| 21120 | _tmp345_ = _tmp344_; |
| 21121 | _tmp346_ = self->delegate_target_destroy_type; |
| 21122 | _tmp347_ = bala_get_ccode_name ((BalaCodeNode*) _tmp346_); |
| 21123 | _tmp348_ = _tmp347_; |
| 21124 | _tmp349_ = bala_ccode_cast_expression_new (_tmp345_, _tmp348_); |
| 21125 | _tmp350_ = _tmp349_; |
| 21126 | bala_ccode_function_call_add_argument (_tmp340_, (BalaCCodeExpression*) _tmp350_); |
| 21127 | _bala_ccode_node_unref0 (_tmp350_)((_tmp350_ == ((void*)0)) ? ((void*)0) : (_tmp350_ = (bala_ccode_node_unref (_tmp350_), ((void*)0)))); |
| 21128 | _g_free0 (_tmp348_)(_tmp348_ = (g_free (_tmp348_), ((void*)0))); |
| 21129 | _bala_ccode_node_unref0 (_tmp345_)((_tmp345_ == ((void*)0)) ? ((void*)0) : (_tmp345_ = (bala_ccode_node_unref (_tmp345_), ((void*)0)))); |
| 21130 | } |
| 21131 | } |
| 21132 | _bala_ccode_node_unref0 (csizeexpr)((csizeexpr == ((void*)0)) ? ((void*)0) : (csizeexpr = (bala_ccode_node_unref (csizeexpr), ((void*)0)))); |
| 21133 | } |
| 21134 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 21135 | } |
| 21136 | } |
| 21137 | } |
| 21138 | _tmp351_ = ccomma; |
| 21139 | _tmp352_ = ccall; |
| 21140 | bala_ccode_comma_expression_append_expression (_tmp351_, (BalaCCodeExpression*) _tmp352_); |
| 21141 | _tmp353_ = ccomma; |
| 21142 | _tmp354_ = bala_ccode_constant_new ("NULL"); |
| 21143 | _tmp355_ = _tmp354_; |
| 21144 | bala_ccode_comma_expression_append_expression (_tmp353_, (BalaCCodeExpression*) _tmp355_); |
| 21145 | _bala_ccode_node_unref0 (_tmp355_)((_tmp355_ == ((void*)0)) ? ((void*)0) : (_tmp355_ = (bala_ccode_node_unref (_tmp355_), ((void*)0)))); |
| 21146 | _tmp356_ = cvar; |
| 21147 | _tmp357_ = ccomma; |
| 21148 | _tmp358_ = bala_ccode_assignment_new (_tmp356_, (BalaCCodeExpression*) _tmp357_, BALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE); |
| 21149 | cassign = _tmp358_; |
| 21150 | _tmp361_ = type; |
| 21151 | _tmp362_ = bala_data_type_get_type_symbol (_tmp361_); |
| 21152 | _tmp363_ = _tmp362_; |
| 21153 | if (_tmp363_ != NULL((void*)0)) { |
| 21154 | BalaDataType* _tmp364_; |
| 21155 | BalaTypeSymbol* _tmp365_; |
| 21156 | BalaTypeSymbol* _tmp366_; |
| 21157 | _tmp364_ = type; |
| 21158 | _tmp365_ = bala_data_type_get_type_symbol (_tmp364_); |
| 21159 | _tmp366_ = _tmp365_; |
| 21160 | _tmp360_ = !bala_is_reference_counting (_tmp366_); |
| 21161 | } else { |
| 21162 | _tmp360_ = FALSE(0); |
| 21163 | } |
| 21164 | if (_tmp360_) { |
| 21165 | BalaDataType* _tmp367_; |
| 21166 | BalaTypeSymbol* _tmp368_; |
| 21167 | BalaTypeSymbol* _tmp369_; |
| 21168 | gchar* _tmp370_; |
| 21169 | gchar* _tmp371_; |
| 21170 | _tmp367_ = type; |
| 21171 | _tmp368_ = bala_data_type_get_type_symbol (_tmp367_); |
| 21172 | _tmp369_ = _tmp368_; |
| 21173 | _tmp370_ = bala_get_ccode_free_function (_tmp369_); |
| 21174 | _tmp371_ = _tmp370_; |
| 21175 | _tmp359_ = g_strcmp0 (_tmp371_, "g_free") == 0; |
| 21176 | _g_free0 (_tmp371_)(_tmp371_ = (g_free (_tmp371_), ((void*)0))); |
| 21177 | } else { |
| 21178 | _tmp359_ = FALSE(0); |
| 21179 | } |
| 21180 | uses_gfree = _tmp359_; |
| 21181 | if (uses_gfree) { |
| 21182 | _tmp372_ = TRUE(!(0)); |
| 21183 | } else { |
| 21184 | BalaDataType* _tmp373_; |
| 21185 | _tmp373_ = type; |
| 21186 | _tmp372_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp373_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp373_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 21187 | } |
| 21188 | uses_gfree = _tmp372_; |
| 21189 | if (uses_gfree) { |
| 21190 | result = (BalaCCodeExpression*) cassign; |
| 21191 | _bala_ccode_node_unref0 (ccomma)((ccomma == ((void*)0)) ? ((void*)0) : (ccomma = (bala_ccode_node_unref (ccomma), ((void*)0)))); |
| 21192 | _bala_ccode_node_unref0 (cisnull)((cisnull == ((void*)0)) ? ((void*)0) : (cisnull = (bala_ccode_node_unref (cisnull), ((void*)0)))); |
| 21193 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 21194 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 21195 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 21196 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 21197 | return result; |
| 21198 | } |
| 21199 | _tmp374_ = cisnull; |
| 21200 | _tmp375_ = bala_ccode_constant_new ("NULL"); |
| 21201 | _tmp376_ = _tmp375_; |
| 21202 | _tmp377_ = cassign; |
| 21203 | _tmp378_ = bala_ccode_conditional_expression_new ((BalaCCodeExpression*) _tmp374_, (BalaCCodeExpression*) _tmp376_, (BalaCCodeExpression*) _tmp377_); |
| 21204 | _tmp379_ = (BalaCCodeExpression*) _tmp378_; |
| 21205 | _bala_ccode_node_unref0 (_tmp376_)((_tmp376_ == ((void*)0)) ? ((void*)0) : (_tmp376_ = (bala_ccode_node_unref (_tmp376_), ((void*)0)))); |
| 21206 | result = _tmp379_; |
| 21207 | _bala_ccode_node_unref0 (cassign)((cassign == ((void*)0)) ? ((void*)0) : (cassign = (bala_ccode_node_unref (cassign), ((void*)0)))); |
| 21208 | _bala_ccode_node_unref0 (ccomma)((ccomma == ((void*)0)) ? ((void*)0) : (ccomma = (bala_ccode_node_unref (ccomma), ((void*)0)))); |
| 21209 | _bala_ccode_node_unref0 (cisnull)((cisnull == ((void*)0)) ? ((void*)0) : (cisnull = (bala_ccode_node_unref (cisnull), ((void*)0)))); |
| 21210 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 21211 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 21212 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 21213 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 21214 | return result; |
| 21215 | } |
| 21216 | |
| 21217 | BalaCCodeExpression* |
| 21218 | bala_ccode_base_module_destroy_value (BalaCCodeBaseModule* self, |
| 21219 | BalaTargetValue* value, |
| 21220 | gboolean is_macro_definition) |
| 21221 | { |
| 21222 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 21223 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->destroy_value (self, value, is_macro_definition); |
| 21224 | } |
| 21225 | |
| 21226 | static void |
| 21227 | bala_ccode_base_module_real_visit_end_full_expression (BalaCodeVisitor* base, |
| 21228 | BalaExpression* expr) |
| 21229 | { |
| 21230 | BalaCCodeBaseModule * self; |
| 21231 | BalaArrayList* _tmp0_; |
| 21232 | BalaArrayList* _tmp1_; |
| 21233 | gint _tmp2_; |
| 21234 | gint _tmp3_; |
| 21235 | BalaLocalVariable* local_decl = NULL((void*)0); |
| 21236 | BalaCodeNode* _tmp4_; |
| 21237 | BalaCodeNode* _tmp5_; |
| 21238 | BalaLocalVariable* _tmp6_; |
| 21239 | gboolean _tmp7_ = FALSE(0); |
| 21240 | BalaLocalVariable* _tmp8_; |
| 21241 | BalaArrayList* _tmp32_; |
| 21242 | BalaArrayList* _tmp33_; |
| 21243 | self = (BalaCCodeBaseModule*) base; |
| 21244 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 21245 | _tmp0_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 21246 | _tmp1_ = _tmp0_; |
| 21247 | _tmp2_ = bala_collection_get_size ((BalaCollection*) _tmp1_); |
| 21248 | _tmp3_ = _tmp2_; |
| 21249 | if (_tmp3_ == 0) { |
| 21250 | return; |
| 21251 | } |
| 21252 | _tmp4_ = bala_code_node_get_parent_node ((BalaCodeNode*) expr); |
| 21253 | _tmp5_ = _tmp4_; |
| 21254 | _tmp6_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, BALA_TYPE_LOCAL_VARIABLE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp5_); GType __t = ((bala_local_variable_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaLocalVariable*) _tmp5_) : NULL((void*)0)); |
| 21255 | local_decl = _tmp6_; |
| 21256 | _tmp8_ = local_decl; |
| 21257 | if (_tmp8_ != NULL((void*)0)) { |
| 21258 | BalaLocalVariable* _tmp9_; |
| 21259 | BalaLocalVariable* _tmp10_; |
| 21260 | BalaExpression* _tmp11_; |
| 21261 | BalaExpression* _tmp12_; |
| 21262 | _tmp9_ = local_decl; |
| 21263 | _tmp10_ = local_decl; |
| 21264 | _tmp11_ = bala_variable_get_initializer ((BalaVariable*) _tmp10_); |
| 21265 | _tmp12_ = _tmp11_; |
| 21266 | _tmp7_ = bala_ccode_base_module_is_simple_struct_creation (self, (BalaVariable*) _tmp9_, _tmp12_); |
| 21267 | } else { |
| 21268 | _tmp7_ = FALSE(0); |
| 21269 | } |
| 21270 | if (!_tmp7_) { |
| 21271 | BalaTargetValue* _tmp13_; |
| 21272 | BalaTargetValue* _tmp14_; |
| 21273 | BalaTargetValue* _tmp15_; |
| 21274 | BalaTargetValue* _tmp16_; |
| 21275 | _tmp13_ = bala_expression_get_target_value (expr); |
| 21276 | _tmp14_ = _tmp13_; |
| 21277 | _tmp15_ = bala_ccode_base_module_store_temp_value (self, _tmp14_, (BalaCodeNode*) expr, NULL((void*)0)); |
| 21278 | _tmp16_ = _tmp15_; |
| 21279 | bala_expression_set_target_value (expr, _tmp16_); |
| 21280 | _bala_target_value_unref0 (_tmp16_)((_tmp16_ == ((void*)0)) ? ((void*)0) : (_tmp16_ = (bala_target_value_unref (_tmp16_), ((void*)0)))); |
| 21281 | } |
| 21282 | { |
| 21283 | BalaArrayList* _value_list = NULL((void*)0); |
| 21284 | BalaArrayList* _tmp17_; |
| 21285 | BalaArrayList* _tmp18_; |
| 21286 | BalaArrayList* _tmp19_; |
| 21287 | gint _value_size = 0; |
| 21288 | BalaArrayList* _tmp20_; |
| 21289 | gint _tmp21_; |
| 21290 | gint _tmp22_; |
| 21291 | gint _value_index = 0; |
| 21292 | _tmp17_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 21293 | _tmp18_ = _tmp17_; |
| 21294 | _tmp19_ = _bala_iterable_ref0 (_tmp18_); |
| 21295 | _value_list = _tmp19_; |
| 21296 | _tmp20_ = _value_list; |
| 21297 | _tmp21_ = bala_collection_get_size ((BalaCollection*) _tmp20_); |
| 21298 | _tmp22_ = _tmp21_; |
| 21299 | _value_size = _tmp22_; |
| 21300 | _value_index = -1; |
| 21301 | while (TRUE(!(0))) { |
| 21302 | gint _tmp23_; |
| 21303 | gint _tmp24_; |
| 21304 | BalaTargetValue* value = NULL((void*)0); |
| 21305 | BalaArrayList* _tmp25_; |
| 21306 | gpointer _tmp26_; |
| 21307 | BalaCCodeFunction* _tmp27_; |
| 21308 | BalaCCodeFunction* _tmp28_; |
| 21309 | BalaTargetValue* _tmp29_; |
| 21310 | BalaCCodeExpression* _tmp30_; |
| 21311 | BalaCCodeExpression* _tmp31_; |
| 21312 | _value_index = _value_index + 1; |
| 21313 | _tmp23_ = _value_index; |
| 21314 | _tmp24_ = _value_size; |
| 21315 | if (!(_tmp23_ < _tmp24_)) { |
| 21316 | break; |
| 21317 | } |
| 21318 | _tmp25_ = _value_list; |
| 21319 | _tmp26_ = bala_list_get ((BalaList*) _tmp25_, _value_index); |
| 21320 | value = (BalaTargetValue*) _tmp26_; |
| 21321 | _tmp27_ = bala_ccode_base_module_get_ccode (self); |
| 21322 | _tmp28_ = _tmp27_; |
| 21323 | _tmp29_ = value; |
| 21324 | _tmp30_ = bala_ccode_base_module_destroy_value (self, _tmp29_, FALSE(0)); |
| 21325 | _tmp31_ = _tmp30_; |
| 21326 | bala_ccode_function_add_expression (_tmp28_, _tmp31_); |
| 21327 | _bala_ccode_node_unref0 (_tmp31_)((_tmp31_ == ((void*)0)) ? ((void*)0) : (_tmp31_ = (bala_ccode_node_unref (_tmp31_), ((void*)0)))); |
| 21328 | _bala_target_value_unref0 (value)((value == ((void*)0)) ? ((void*)0) : (value = (bala_target_value_unref (value), ((void*)0)))); |
| 21329 | } |
| 21330 | _bala_iterable_unref0 (_value_list)((_value_list == ((void*)0)) ? ((void*)0) : (_value_list = (bala_iterable_unref (_value_list), ((void*)0)))); |
| 21331 | } |
| 21332 | _tmp32_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 21333 | _tmp33_ = _tmp32_; |
| 21334 | bala_collection_clear ((BalaCollection*) _tmp33_); |
| 21335 | _bala_code_node_unref0 (local_decl)((local_decl == ((void*)0)) ? ((void*)0) : (local_decl = (bala_code_node_unref (local_decl), ((void*)0)))); |
| 21336 | } |
| 21337 | |
| 21338 | void |
| 21339 | bala_ccode_base_module_emit_temp_var (BalaCCodeBaseModule* self, |
| 21340 | BalaLocalVariable* local, |
| 21341 | gboolean on_error) |
| 21342 | { |
| 21343 | gboolean _tmp0_ = FALSE(0); |
| 21344 | const gchar* _tmp1_; |
| 21345 | const gchar* _tmp2_; |
| 21346 | gboolean init = FALSE(0); |
| 21347 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 21348 | g_return_if_fail (local != NULL)do { if ((local != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "local != NULL" ); return; } } while (0); |
| 21349 | _tmp1_ = bala_symbol_get_name ((BalaSymbol*) local); |
| 21350 | _tmp2_ = _tmp1_; |
| 21351 | if (!g_str_has_prefix (_tmp2_, "*")) { |
| 21352 | gboolean _tmp3_; |
| 21353 | gboolean _tmp4_; |
| 21354 | _tmp3_ = bala_local_variable_get_init (local); |
| 21355 | _tmp4_ = _tmp3_; |
| 21356 | _tmp0_ = _tmp4_; |
| 21357 | } else { |
| 21358 | _tmp0_ = FALSE(0); |
| 21359 | } |
| 21360 | init = _tmp0_; |
| 21361 | if (bala_ccode_base_module_is_in_coroutine (self)) { |
| 21362 | BalaCCodeStruct* _tmp5_; |
| 21363 | BalaDataType* _tmp6_; |
| 21364 | BalaDataType* _tmp7_; |
| 21365 | gchar* _tmp8_; |
| 21366 | gchar* _tmp9_; |
| 21367 | const gchar* _tmp10_; |
| 21368 | const gchar* _tmp11_; |
| 21369 | BalaDataType* _tmp12_; |
| 21370 | BalaDataType* _tmp13_; |
| 21371 | BalaCCodeDeclaratorSuffix* _tmp14_; |
| 21372 | BalaCCodeDeclaratorSuffix* _tmp15_; |
| 21373 | _tmp5_ = self->closure_struct; |
| 21374 | _tmp6_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 21375 | _tmp7_ = _tmp6_; |
| 21376 | _tmp8_ = bala_get_ccode_name ((BalaCodeNode*) _tmp7_); |
| 21377 | _tmp9_ = _tmp8_; |
| 21378 | _tmp10_ = bala_symbol_get_name ((BalaSymbol*) local); |
| 21379 | _tmp11_ = _tmp10_; |
| 21380 | _tmp12_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 21381 | _tmp13_ = _tmp12_; |
| 21382 | _tmp14_ = bala_ccode_base_module_get_ccode_declarator_suffix (self, _tmp13_); |
| 21383 | _tmp15_ = _tmp14_; |
| 21384 | bala_ccode_struct_add_field (_tmp5_, _tmp9_, _tmp11_, 0, _tmp15_); |
| 21385 | _bala_ccode_declarator_suffix_unref0 (_tmp15_)((_tmp15_ == ((void*)0)) ? ((void*)0) : (_tmp15_ = (bala_ccode_declarator_suffix_unref (_tmp15_), ((void*)0)))); |
| 21386 | _g_free0 (_tmp9_)(_tmp9_ = (g_free (_tmp9_), ((void*)0))); |
| 21387 | if (init) { |
| 21388 | BalaCCodeExpression* initializer = NULL((void*)0); |
| 21389 | BalaDataType* _tmp16_; |
| 21390 | BalaDataType* _tmp17_; |
| 21391 | BalaCCodeExpression* _tmp18_; |
| 21392 | BalaCCodeExpression* _tmp19_; |
| 21393 | _tmp16_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 21394 | _tmp17_ = _tmp16_; |
| 21395 | _tmp18_ = bala_ccode_base_module_default_value_for_type (self, _tmp17_, FALSE(0), on_error); |
| 21396 | initializer = _tmp18_; |
| 21397 | _tmp19_ = initializer; |
| 21398 | if (_tmp19_ == NULL((void*)0)) { |
| 21399 | BalaCCodeFile* _tmp20_; |
| 21400 | BalaCCodeFunctionCall* memset_call = NULL((void*)0); |
| 21401 | BalaCCodeIdentifier* _tmp21_; |
| 21402 | BalaCCodeIdentifier* _tmp22_; |
| 21403 | BalaCCodeFunctionCall* _tmp23_; |
| 21404 | BalaCCodeFunctionCall* _tmp24_; |
| 21405 | BalaCCodeFunctionCall* _tmp25_; |
| 21406 | const gchar* _tmp26_; |
| 21407 | const gchar* _tmp27_; |
| 21408 | BalaCCodeExpression* _tmp28_; |
| 21409 | BalaCCodeExpression* _tmp29_; |
| 21410 | BalaCCodeUnaryExpression* _tmp30_; |
| 21411 | BalaCCodeUnaryExpression* _tmp31_; |
| 21412 | BalaCCodeFunctionCall* _tmp32_; |
| 21413 | BalaCCodeConstant* _tmp33_; |
| 21414 | BalaCCodeConstant* _tmp34_; |
| 21415 | BalaCCodeExpression* size = NULL((void*)0); |
| 21416 | BalaCCodeExpression* _tmp35_ = NULL((void*)0); |
| 21417 | BalaCCodeExpression* _tmp36_; |
| 21418 | BalaCCodeFunctionCall* _tmp44_; |
| 21419 | BalaCCodeExpression* _tmp45_; |
| 21420 | BalaCCodeFunction* _tmp46_; |
| 21421 | BalaCCodeFunction* _tmp47_; |
| 21422 | BalaCCodeFunctionCall* _tmp48_; |
| 21423 | _tmp20_ = self->cfile; |
| 21424 | bala_ccode_file_add_include (_tmp20_, "string.h", FALSE(0)); |
| 21425 | _tmp21_ = bala_ccode_identifier_new ("memset"); |
| 21426 | _tmp22_ = _tmp21_; |
| 21427 | _tmp23_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp22_); |
| 21428 | _tmp24_ = _tmp23_; |
| 21429 | _bala_ccode_node_unref0 (_tmp22_)((_tmp22_ == ((void*)0)) ? ((void*)0) : (_tmp22_ = (bala_ccode_node_unref (_tmp22_), ((void*)0)))); |
| 21430 | memset_call = _tmp24_; |
| 21431 | _tmp25_ = memset_call; |
| 21432 | _tmp26_ = bala_symbol_get_name ((BalaSymbol*) local); |
| 21433 | _tmp27_ = _tmp26_; |
| 21434 | _tmp28_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp27_); |
| 21435 | _tmp29_ = _tmp28_; |
| 21436 | _tmp30_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp29_); |
| 21437 | _tmp31_ = _tmp30_; |
| 21438 | bala_ccode_function_call_add_argument (_tmp25_, (BalaCCodeExpression*) _tmp31_); |
| 21439 | _bala_ccode_node_unref0 (_tmp31_)((_tmp31_ == ((void*)0)) ? ((void*)0) : (_tmp31_ = (bala_ccode_node_unref (_tmp31_), ((void*)0)))); |
| 21440 | _bala_ccode_node_unref0 (_tmp29_)((_tmp29_ == ((void*)0)) ? ((void*)0) : (_tmp29_ = (bala_ccode_node_unref (_tmp29_), ((void*)0)))); |
| 21441 | _tmp32_ = memset_call; |
| 21442 | _tmp33_ = bala_ccode_constant_new ("0"); |
| 21443 | _tmp34_ = _tmp33_; |
| 21444 | bala_ccode_function_call_add_argument (_tmp32_, (BalaCCodeExpression*) _tmp34_); |
| 21445 | _bala_ccode_node_unref0 (_tmp34_)((_tmp34_ == ((void*)0)) ? ((void*)0) : (_tmp34_ = (bala_ccode_node_unref (_tmp34_), ((void*)0)))); |
| 21446 | size = NULL((void*)0); |
| 21447 | bala_ccode_base_module_requires_memset_init (self, (BalaVariable*) local, &_tmp35_); |
| 21448 | _bala_ccode_node_unref0 (size)((size == ((void*)0)) ? ((void*)0) : (size = (bala_ccode_node_unref (size), ((void*)0)))); |
| 21449 | size = _tmp35_; |
| 21450 | _tmp36_ = size; |
| 21451 | if (_tmp36_ == NULL((void*)0)) { |
| 21452 | BalaDataType* _tmp37_; |
| 21453 | BalaDataType* _tmp38_; |
| 21454 | gchar* _tmp39_; |
| 21455 | gchar* _tmp40_; |
| 21456 | gchar* _tmp41_; |
| 21457 | gchar* _tmp42_; |
| 21458 | BalaCCodeIdentifier* _tmp43_; |
| 21459 | _tmp37_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 21460 | _tmp38_ = _tmp37_; |
| 21461 | _tmp39_ = bala_get_ccode_name ((BalaCodeNode*) _tmp38_); |
| 21462 | _tmp40_ = _tmp39_; |
| 21463 | _tmp41_ = g_strdup_printf ("sizeof (%s)", _tmp40_); |
| 21464 | _tmp42_ = _tmp41_; |
| 21465 | _tmp43_ = bala_ccode_identifier_new (_tmp42_); |
| 21466 | _bala_ccode_node_unref0 (size)((size == ((void*)0)) ? ((void*)0) : (size = (bala_ccode_node_unref (size), ((void*)0)))); |
| 21467 | size = (BalaCCodeExpression*) _tmp43_; |
| 21468 | _g_free0 (_tmp42_)(_tmp42_ = (g_free (_tmp42_), ((void*)0))); |
| 21469 | _g_free0 (_tmp40_)(_tmp40_ = (g_free (_tmp40_), ((void*)0))); |
| 21470 | } |
| 21471 | _tmp44_ = memset_call; |
| 21472 | _tmp45_ = size; |
| 21473 | bala_ccode_function_call_add_argument (_tmp44_, _tmp45_); |
| 21474 | _tmp46_ = bala_ccode_base_module_get_ccode (self); |
| 21475 | _tmp47_ = _tmp46_; |
| 21476 | _tmp48_ = memset_call; |
| 21477 | bala_ccode_function_add_expression (_tmp47_, (BalaCCodeExpression*) _tmp48_); |
| 21478 | _bala_ccode_node_unref0 (size)((size == ((void*)0)) ? ((void*)0) : (size = (bala_ccode_node_unref (size), ((void*)0)))); |
| 21479 | _bala_ccode_node_unref0 (memset_call)((memset_call == ((void*)0)) ? ((void*)0) : (memset_call = (bala_ccode_node_unref (memset_call), ((void*)0)))); |
| 21480 | } else { |
| 21481 | BalaCCodeFunction* _tmp49_; |
| 21482 | BalaCCodeFunction* _tmp50_; |
| 21483 | const gchar* _tmp51_; |
| 21484 | const gchar* _tmp52_; |
| 21485 | BalaCCodeExpression* _tmp53_; |
| 21486 | BalaCCodeExpression* _tmp54_; |
| 21487 | BalaCCodeExpression* _tmp55_; |
| 21488 | _tmp49_ = bala_ccode_base_module_get_ccode (self); |
| 21489 | _tmp50_ = _tmp49_; |
| 21490 | _tmp51_ = bala_symbol_get_name ((BalaSymbol*) local); |
| 21491 | _tmp52_ = _tmp51_; |
| 21492 | _tmp53_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp52_); |
| 21493 | _tmp54_ = _tmp53_; |
| 21494 | _tmp55_ = initializer; |
| 21495 | bala_ccode_function_add_assignment (_tmp50_, _tmp54_, _tmp55_); |
| 21496 | _bala_ccode_node_unref0 (_tmp54_)((_tmp54_ == ((void*)0)) ? ((void*)0) : (_tmp54_ = (bala_ccode_node_unref (_tmp54_), ((void*)0)))); |
| 21497 | } |
| 21498 | _bala_ccode_node_unref0 (initializer)((initializer == ((void*)0)) ? ((void*)0) : (initializer = (bala_ccode_node_unref (initializer), ((void*)0)))); |
| 21499 | } |
| 21500 | } else { |
| 21501 | BalaCCodeVariableDeclarator* cvar = NULL((void*)0); |
| 21502 | const gchar* _tmp56_; |
| 21503 | const gchar* _tmp57_; |
| 21504 | BalaDataType* _tmp58_; |
| 21505 | BalaDataType* _tmp59_; |
| 21506 | BalaCCodeDeclaratorSuffix* _tmp60_; |
| 21507 | BalaCCodeDeclaratorSuffix* _tmp61_; |
| 21508 | BalaCCodeVariableDeclarator* _tmp62_; |
| 21509 | BalaCCodeVariableDeclarator* _tmp63_; |
| 21510 | BalaCCodeExpression* size = NULL((void*)0); |
| 21511 | gboolean _tmp64_ = FALSE(0); |
| 21512 | BalaCCodeFunction* _tmp96_; |
| 21513 | BalaCCodeFunction* _tmp97_; |
| 21514 | BalaDataType* _tmp98_; |
| 21515 | BalaDataType* _tmp99_; |
| 21516 | gchar* _tmp100_; |
| 21517 | gchar* _tmp101_; |
| 21518 | BalaCCodeVariableDeclarator* _tmp102_; |
| 21519 | _tmp56_ = bala_symbol_get_name ((BalaSymbol*) local); |
| 21520 | _tmp57_ = _tmp56_; |
| 21521 | _tmp58_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 21522 | _tmp59_ = _tmp58_; |
| 21523 | _tmp60_ = bala_ccode_base_module_get_ccode_declarator_suffix (self, _tmp59_); |
| 21524 | _tmp61_ = _tmp60_; |
| 21525 | _tmp62_ = bala_ccode_variable_declarator_new (_tmp57_, NULL((void*)0), _tmp61_); |
| 21526 | _tmp63_ = _tmp62_; |
| 21527 | _bala_ccode_declarator_suffix_unref0 (_tmp61_)((_tmp61_ == ((void*)0)) ? ((void*)0) : (_tmp61_ = (bala_ccode_declarator_suffix_unref (_tmp61_), ((void*)0)))); |
| 21528 | cvar = _tmp63_; |
| 21529 | size = NULL((void*)0); |
| 21530 | if (init) { |
| 21531 | BalaCCodeExpression* _tmp65_ = NULL((void*)0); |
| 21532 | gboolean _tmp66_; |
| 21533 | _tmp66_ = bala_ccode_base_module_requires_memset_init (self, (BalaVariable*) local, &_tmp65_); |
| 21534 | _bala_ccode_node_unref0 (size)((size == ((void*)0)) ? ((void*)0) : (size = (bala_ccode_node_unref (size), ((void*)0)))); |
| 21535 | size = _tmp65_; |
| 21536 | _tmp64_ = !_tmp66_; |
| 21537 | } else { |
| 21538 | _tmp64_ = FALSE(0); |
| 21539 | } |
| 21540 | if (_tmp64_) { |
| 21541 | BalaCCodeVariableDeclarator* _tmp67_; |
| 21542 | BalaDataType* _tmp68_; |
| 21543 | BalaDataType* _tmp69_; |
| 21544 | BalaCCodeExpression* _tmp70_; |
| 21545 | BalaCCodeExpression* _tmp71_; |
| 21546 | BalaCCodeVariableDeclarator* _tmp72_; |
| 21547 | _tmp67_ = cvar; |
| 21548 | _tmp68_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 21549 | _tmp69_ = _tmp68_; |
| 21550 | _tmp70_ = bala_ccode_base_module_default_value_for_type (self, _tmp69_, TRUE(!(0)), on_error); |
| 21551 | _tmp71_ = _tmp70_; |
| 21552 | bala_ccode_variable_declarator_set_initializer (_tmp67_, _tmp71_); |
| 21553 | _bala_ccode_node_unref0 (_tmp71_)((_tmp71_ == ((void*)0)) ? ((void*)0) : (_tmp71_ = (bala_ccode_node_unref (_tmp71_), ((void*)0)))); |
| 21554 | _tmp72_ = cvar; |
| 21555 | bala_ccode_variable_declarator_set_init0 (_tmp72_, TRUE(!(0))); |
| 21556 | } else { |
| 21557 | gboolean _tmp73_ = FALSE(0); |
| 21558 | gboolean _tmp74_ = FALSE(0); |
| 21559 | if (init) { |
| 21560 | BalaCCodeExpression* _tmp75_; |
| 21561 | _tmp75_ = size; |
| 21562 | _tmp74_ = _tmp75_ != NULL((void*)0); |
| 21563 | } else { |
| 21564 | _tmp74_ = FALSE(0); |
| 21565 | } |
| 21566 | if (_tmp74_) { |
| 21567 | BalaExpression* _tmp76_; |
| 21568 | BalaExpression* _tmp77_; |
| 21569 | _tmp76_ = bala_variable_get_initializer ((BalaVariable*) local); |
| 21570 | _tmp77_ = _tmp76_; |
| 21571 | _tmp73_ = _tmp77_ == NULL((void*)0); |
| 21572 | } else { |
| 21573 | _tmp73_ = FALSE(0); |
| 21574 | } |
| 21575 | if (_tmp73_) { |
| 21576 | BalaCCodeFile* _tmp78_; |
| 21577 | BalaCCodeFunctionCall* memset_call = NULL((void*)0); |
| 21578 | BalaCCodeIdentifier* _tmp79_; |
| 21579 | BalaCCodeIdentifier* _tmp80_; |
| 21580 | BalaCCodeFunctionCall* _tmp81_; |
| 21581 | BalaCCodeFunctionCall* _tmp82_; |
| 21582 | BalaCCodeFunctionCall* _tmp83_; |
| 21583 | const gchar* _tmp84_; |
| 21584 | const gchar* _tmp85_; |
| 21585 | BalaCCodeExpression* _tmp86_; |
| 21586 | BalaCCodeExpression* _tmp87_; |
| 21587 | BalaCCodeFunctionCall* _tmp88_; |
| 21588 | BalaCCodeConstant* _tmp89_; |
| 21589 | BalaCCodeConstant* _tmp90_; |
| 21590 | BalaCCodeFunctionCall* _tmp91_; |
| 21591 | BalaCCodeExpression* _tmp92_; |
| 21592 | BalaCCodeFunction* _tmp93_; |
| 21593 | BalaCCodeFunction* _tmp94_; |
| 21594 | BalaCCodeFunctionCall* _tmp95_; |
| 21595 | _tmp78_ = self->cfile; |
| 21596 | bala_ccode_file_add_include (_tmp78_, "string.h", FALSE(0)); |
| 21597 | _tmp79_ = bala_ccode_identifier_new ("memset"); |
| 21598 | _tmp80_ = _tmp79_; |
| 21599 | _tmp81_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp80_); |
| 21600 | _tmp82_ = _tmp81_; |
| 21601 | _bala_ccode_node_unref0 (_tmp80_)((_tmp80_ == ((void*)0)) ? ((void*)0) : (_tmp80_ = (bala_ccode_node_unref (_tmp80_), ((void*)0)))); |
| 21602 | memset_call = _tmp82_; |
| 21603 | _tmp83_ = memset_call; |
| 21604 | _tmp84_ = bala_symbol_get_name ((BalaSymbol*) local); |
| 21605 | _tmp85_ = _tmp84_; |
| 21606 | _tmp86_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp85_); |
| 21607 | _tmp87_ = _tmp86_; |
| 21608 | bala_ccode_function_call_add_argument (_tmp83_, _tmp87_); |
| 21609 | _bala_ccode_node_unref0 (_tmp87_)((_tmp87_ == ((void*)0)) ? ((void*)0) : (_tmp87_ = (bala_ccode_node_unref (_tmp87_), ((void*)0)))); |
| 21610 | _tmp88_ = memset_call; |
| 21611 | _tmp89_ = bala_ccode_constant_new ("0"); |
| 21612 | _tmp90_ = _tmp89_; |
| 21613 | bala_ccode_function_call_add_argument (_tmp88_, (BalaCCodeExpression*) _tmp90_); |
| 21614 | _bala_ccode_node_unref0 (_tmp90_)((_tmp90_ == ((void*)0)) ? ((void*)0) : (_tmp90_ = (bala_ccode_node_unref (_tmp90_), ((void*)0)))); |
| 21615 | _tmp91_ = memset_call; |
| 21616 | _tmp92_ = size; |
| 21617 | bala_ccode_function_call_add_argument (_tmp91_, _tmp92_); |
| 21618 | _tmp93_ = bala_ccode_base_module_get_ccode (self); |
| 21619 | _tmp94_ = _tmp93_; |
| 21620 | _tmp95_ = memset_call; |
| 21621 | bala_ccode_function_add_expression (_tmp94_, (BalaCCodeExpression*) _tmp95_); |
| 21622 | _bala_ccode_node_unref0 (memset_call)((memset_call == ((void*)0)) ? ((void*)0) : (memset_call = (bala_ccode_node_unref (memset_call), ((void*)0)))); |
| 21623 | } |
| 21624 | } |
| 21625 | _tmp96_ = bala_ccode_base_module_get_ccode (self); |
| 21626 | _tmp97_ = _tmp96_; |
| 21627 | _tmp98_ = bala_variable_get_variable_type ((BalaVariable*) local); |
| 21628 | _tmp99_ = _tmp98_; |
| 21629 | _tmp100_ = bala_get_ccode_name ((BalaCodeNode*) _tmp99_); |
| 21630 | _tmp101_ = _tmp100_; |
| 21631 | _tmp102_ = cvar; |
| 21632 | bala_ccode_function_add_declaration (_tmp97_, _tmp101_, (BalaCCodeDeclarator*) _tmp102_, 0); |
| 21633 | _g_free0 (_tmp101_)(_tmp101_ = (g_free (_tmp101_), ((void*)0))); |
| 21634 | _bala_ccode_node_unref0 (size)((size == ((void*)0)) ? ((void*)0) : (size = (bala_ccode_node_unref (size), ((void*)0)))); |
| 21635 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 21636 | } |
| 21637 | } |
| 21638 | |
| 21639 | static void |
| 21640 | bala_ccode_base_module_real_visit_expression_statement (BalaCodeVisitor* base, |
| 21641 | BalaExpressionStatement* stmt) |
| 21642 | { |
| 21643 | BalaCCodeBaseModule * self; |
| 21644 | BalaExpression* _tmp0_; |
| 21645 | BalaExpression* _tmp1_; |
| 21646 | gboolean _tmp2_; |
| 21647 | gboolean _tmp3_; |
| 21648 | gboolean _tmp19_ = FALSE(0); |
| 21649 | gboolean _tmp20_; |
| 21650 | gboolean _tmp21_; |
| 21651 | BalaArrayList* _tmp28_; |
| 21652 | BalaArrayList* _tmp29_; |
| 21653 | self = (BalaCCodeBaseModule*) base; |
| 21654 | g_return_if_fail (stmt != NULL)do { if ((stmt != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "stmt != NULL" ); return; } } while (0); |
| 21655 | _tmp0_ = bala_expression_statement_get_expression (stmt); |
| 21656 | _tmp1_ = _tmp0_; |
| 21657 | _tmp2_ = bala_code_node_get_error ((BalaCodeNode*) _tmp1_); |
| 21658 | _tmp3_ = _tmp2_; |
| 21659 | if (_tmp3_) { |
| 21660 | bala_code_node_set_error ((BalaCodeNode*) stmt, TRUE(!(0))); |
| 21661 | return; |
| 21662 | } |
| 21663 | { |
| 21664 | BalaArrayList* _value_list = NULL((void*)0); |
| 21665 | BalaArrayList* _tmp4_; |
| 21666 | BalaArrayList* _tmp5_; |
| 21667 | BalaArrayList* _tmp6_; |
| 21668 | gint _value_size = 0; |
| 21669 | BalaArrayList* _tmp7_; |
| 21670 | gint _tmp8_; |
| 21671 | gint _tmp9_; |
| 21672 | gint _value_index = 0; |
| 21673 | _tmp4_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 21674 | _tmp5_ = _tmp4_; |
| 21675 | _tmp6_ = _bala_iterable_ref0 (_tmp5_); |
| 21676 | _value_list = _tmp6_; |
| 21677 | _tmp7_ = _value_list; |
| 21678 | _tmp8_ = bala_collection_get_size ((BalaCollection*) _tmp7_); |
| 21679 | _tmp9_ = _tmp8_; |
| 21680 | _value_size = _tmp9_; |
| 21681 | _value_index = -1; |
| 21682 | while (TRUE(!(0))) { |
| 21683 | gint _tmp10_; |
| 21684 | gint _tmp11_; |
| 21685 | BalaTargetValue* value = NULL((void*)0); |
| 21686 | BalaArrayList* _tmp12_; |
| 21687 | gpointer _tmp13_; |
| 21688 | BalaCCodeFunction* _tmp14_; |
| 21689 | BalaCCodeFunction* _tmp15_; |
| 21690 | BalaTargetValue* _tmp16_; |
| 21691 | BalaCCodeExpression* _tmp17_; |
| 21692 | BalaCCodeExpression* _tmp18_; |
| 21693 | _value_index = _value_index + 1; |
| 21694 | _tmp10_ = _value_index; |
| 21695 | _tmp11_ = _value_size; |
| 21696 | if (!(_tmp10_ < _tmp11_)) { |
| 21697 | break; |
| 21698 | } |
| 21699 | _tmp12_ = _value_list; |
| 21700 | _tmp13_ = bala_list_get ((BalaList*) _tmp12_, _value_index); |
| 21701 | value = (BalaTargetValue*) _tmp13_; |
| 21702 | _tmp14_ = bala_ccode_base_module_get_ccode (self); |
| 21703 | _tmp15_ = _tmp14_; |
| 21704 | _tmp16_ = value; |
| 21705 | _tmp17_ = bala_ccode_base_module_destroy_value (self, _tmp16_, FALSE(0)); |
| 21706 | _tmp18_ = _tmp17_; |
| 21707 | bala_ccode_function_add_expression (_tmp15_, _tmp18_); |
| 21708 | _bala_ccode_node_unref0 (_tmp18_)((_tmp18_ == ((void*)0)) ? ((void*)0) : (_tmp18_ = (bala_ccode_node_unref (_tmp18_), ((void*)0)))); |
| 21709 | _bala_target_value_unref0 (value)((value == ((void*)0)) ? ((void*)0) : (value = (bala_target_value_unref (value), ((void*)0)))); |
| 21710 | } |
| 21711 | _bala_iterable_unref0 (_value_list)((_value_list == ((void*)0)) ? ((void*)0) : (_value_list = (bala_iterable_unref (_value_list), ((void*)0)))); |
| 21712 | } |
| 21713 | _tmp20_ = bala_code_node_get_tree_can_fail ((BalaCodeNode*) stmt); |
| 21714 | _tmp21_ = _tmp20_; |
| 21715 | if (_tmp21_) { |
| 21716 | BalaExpression* _tmp22_; |
| 21717 | BalaExpression* _tmp23_; |
| 21718 | gboolean _tmp24_; |
| 21719 | gboolean _tmp25_; |
| 21720 | _tmp22_ = bala_expression_statement_get_expression (stmt); |
| 21721 | _tmp23_ = _tmp22_; |
| 21722 | _tmp24_ = bala_code_node_get_tree_can_fail ((BalaCodeNode*) _tmp23_); |
| 21723 | _tmp25_ = _tmp24_; |
| 21724 | _tmp19_ = _tmp25_; |
| 21725 | } else { |
| 21726 | _tmp19_ = FALSE(0); |
| 21727 | } |
| 21728 | if (_tmp19_) { |
| 21729 | BalaExpression* _tmp26_; |
| 21730 | BalaExpression* _tmp27_; |
| 21731 | _tmp26_ = bala_expression_statement_get_expression (stmt); |
| 21732 | _tmp27_ = _tmp26_; |
| 21733 | bala_ccode_base_module_add_simple_check (self, (BalaCodeNode*) _tmp27_, FALSE(0)); |
| 21734 | } |
| 21735 | _tmp28_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 21736 | _tmp29_ = _tmp28_; |
| 21737 | bala_collection_clear ((BalaCollection*) _tmp29_); |
| 21738 | } |
| 21739 | |
| 21740 | static void |
| 21741 | bala_ccode_base_module_real_append_scope_free (BalaCCodeBaseModule* self, |
| 21742 | BalaSymbol* sym, |
| 21743 | BalaCodeNode* stop_at) |
| 21744 | { |
| 21745 | BalaBlock* b = NULL((void*)0); |
| 21746 | BalaBlock* _tmp0_; |
| 21747 | BalaList* local_vars = NULL((void*)0); |
| 21748 | BalaBlock* _tmp1_; |
| 21749 | BalaList* _tmp2_; |
| 21750 | BalaList* _tmp3_; |
| 21751 | BalaBlock* _tmp31_; |
| 21752 | gboolean _tmp32_; |
| 21753 | gboolean _tmp33_; |
| 21754 | g_return_if_fail (sym != NULL)do { if ((sym != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "sym != NULL") ; return; } } while (0); |
| 21755 | _tmp0_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (sym, BALA_TYPE_BLOCK, BalaBlock)(((BalaBlock*) g_type_check_instance_cast ((GTypeInstance*) ( sym), ((bala_block_get_type ())))))); |
| 21756 | b = _tmp0_; |
| 21757 | _tmp1_ = b; |
| 21758 | _tmp2_ = bala_block_get_local_variables (_tmp1_); |
| 21759 | _tmp3_ = _bala_iterable_ref0 (_tmp2_); |
| 21760 | local_vars = _tmp3_; |
| 21761 | { |
| 21762 | gint i = 0; |
| 21763 | BalaList* _tmp4_; |
| 21764 | gint _tmp5_; |
| 21765 | gint _tmp6_; |
| 21766 | _tmp4_ = local_vars; |
| 21767 | _tmp5_ = bala_collection_get_size ((BalaCollection*) _tmp4_); |
| 21768 | _tmp6_ = _tmp5_; |
| 21769 | i = _tmp6_ - 1; |
| 21770 | { |
| 21771 | gboolean _tmp7_ = FALSE(0); |
| 21772 | _tmp7_ = TRUE(!(0)); |
| 21773 | while (TRUE(!(0))) { |
| 21774 | BalaLocalVariable* local = NULL((void*)0); |
| 21775 | BalaList* _tmp9_; |
| 21776 | gpointer _tmp10_; |
| 21777 | gboolean _tmp11_ = FALSE(0); |
| 21778 | gboolean _tmp12_ = FALSE(0); |
| 21779 | gboolean _tmp13_ = FALSE(0); |
| 21780 | BalaLocalVariable* _tmp14_; |
| 21781 | gboolean _tmp15_; |
| 21782 | gboolean _tmp16_; |
| 21783 | if (!_tmp7_) { |
| 21784 | gint _tmp8_; |
| 21785 | _tmp8_ = i; |
| 21786 | i = _tmp8_ - 1; |
| 21787 | } |
| 21788 | _tmp7_ = FALSE(0); |
| 21789 | if (!(i >= 0)) { |
| 21790 | break; |
| 21791 | } |
| 21792 | _tmp9_ = local_vars; |
| 21793 | _tmp10_ = bala_list_get (_tmp9_, i); |
| 21794 | local = (BalaLocalVariable*) _tmp10_; |
| 21795 | _tmp14_ = local; |
| 21796 | _tmp15_ = bala_code_node_get_unreachable ((BalaCodeNode*) _tmp14_); |
| 21797 | _tmp16_ = _tmp15_; |
| 21798 | if (!_tmp16_) { |
| 21799 | BalaLocalVariable* _tmp17_; |
| 21800 | gboolean _tmp18_; |
| 21801 | gboolean _tmp19_; |
| 21802 | _tmp17_ = local; |
| 21803 | _tmp18_ = bala_symbol_get_active ((BalaSymbol*) _tmp17_); |
| 21804 | _tmp19_ = _tmp18_; |
| 21805 | _tmp13_ = _tmp19_; |
| 21806 | } else { |
| 21807 | _tmp13_ = FALSE(0); |
| 21808 | } |
| 21809 | if (_tmp13_) { |
| 21810 | BalaLocalVariable* _tmp20_; |
| 21811 | gboolean _tmp21_; |
| 21812 | gboolean _tmp22_; |
| 21813 | _tmp20_ = local; |
| 21814 | _tmp21_ = bala_local_variable_get_captured (_tmp20_); |
| 21815 | _tmp22_ = _tmp21_; |
| 21816 | _tmp12_ = !_tmp22_; |
| 21817 | } else { |
| 21818 | _tmp12_ = FALSE(0); |
| 21819 | } |
| 21820 | if (_tmp12_) { |
| 21821 | BalaLocalVariable* _tmp23_; |
| 21822 | BalaDataType* _tmp24_; |
| 21823 | BalaDataType* _tmp25_; |
| 21824 | _tmp23_ = local; |
| 21825 | _tmp24_ = bala_variable_get_variable_type ((BalaVariable*) _tmp23_); |
| 21826 | _tmp25_ = _tmp24_; |
| 21827 | _tmp11_ = bala_ccode_base_module_requires_destroy (_tmp25_); |
| 21828 | } else { |
| 21829 | _tmp11_ = FALSE(0); |
| 21830 | } |
| 21831 | if (_tmp11_) { |
| 21832 | BalaCCodeFunction* _tmp26_; |
| 21833 | BalaCCodeFunction* _tmp27_; |
| 21834 | BalaLocalVariable* _tmp28_; |
| 21835 | BalaCCodeExpression* _tmp29_; |
| 21836 | BalaCCodeExpression* _tmp30_; |
| 21837 | _tmp26_ = bala_ccode_base_module_get_ccode (self); |
| 21838 | _tmp27_ = _tmp26_; |
| 21839 | _tmp28_ = local; |
| 21840 | _tmp29_ = bala_ccode_base_module_destroy_local (self, _tmp28_); |
| 21841 | _tmp30_ = _tmp29_; |
| 21842 | bala_ccode_function_add_expression (_tmp27_, _tmp30_); |
| 21843 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 21844 | } |
| 21845 | _bala_code_node_unref0 (local)((local == ((void*)0)) ? ((void*)0) : (local = (bala_code_node_unref (local), ((void*)0)))); |
| 21846 | } |
| 21847 | } |
| 21848 | } |
| 21849 | _tmp31_ = b; |
| 21850 | _tmp32_ = bala_block_get_captured (_tmp31_); |
| 21851 | _tmp33_ = _tmp32_; |
| 21852 | if (_tmp33_) { |
| 21853 | gint block_id = 0; |
| 21854 | BalaBlock* _tmp34_; |
| 21855 | BalaCCodeFunctionCall* data_unref = NULL((void*)0); |
| 21856 | gchar* _tmp35_; |
| 21857 | gchar* _tmp36_; |
| 21858 | BalaCCodeIdentifier* _tmp37_; |
| 21859 | BalaCCodeIdentifier* _tmp38_; |
| 21860 | BalaCCodeFunctionCall* _tmp39_; |
| 21861 | BalaCCodeFunctionCall* _tmp40_; |
| 21862 | BalaCCodeFunctionCall* _tmp41_; |
| 21863 | gchar* _tmp42_; |
| 21864 | gchar* _tmp43_; |
| 21865 | BalaCCodeExpression* _tmp44_; |
| 21866 | BalaCCodeExpression* _tmp45_; |
| 21867 | BalaCCodeFunction* _tmp46_; |
| 21868 | BalaCCodeFunction* _tmp47_; |
| 21869 | BalaCCodeFunctionCall* _tmp48_; |
| 21870 | BalaCCodeFunction* _tmp49_; |
| 21871 | BalaCCodeFunction* _tmp50_; |
| 21872 | gchar* _tmp51_; |
| 21873 | gchar* _tmp52_; |
| 21874 | BalaCCodeExpression* _tmp53_; |
| 21875 | BalaCCodeExpression* _tmp54_; |
| 21876 | BalaCCodeConstant* _tmp55_; |
| 21877 | BalaCCodeConstant* _tmp56_; |
| 21878 | _tmp34_ = b; |
| 21879 | block_id = bala_ccode_base_module_get_block_id (self, _tmp34_); |
| 21880 | _tmp35_ = g_strdup_printf ("block%d_data_unref", block_id); |
| 21881 | _tmp36_ = _tmp35_; |
| 21882 | _tmp37_ = bala_ccode_identifier_new (_tmp36_); |
| 21883 | _tmp38_ = _tmp37_; |
| 21884 | _tmp39_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp38_); |
| 21885 | _tmp40_ = _tmp39_; |
| 21886 | _bala_ccode_node_unref0 (_tmp38_)((_tmp38_ == ((void*)0)) ? ((void*)0) : (_tmp38_ = (bala_ccode_node_unref (_tmp38_), ((void*)0)))); |
| 21887 | _g_free0 (_tmp36_)(_tmp36_ = (g_free (_tmp36_), ((void*)0))); |
| 21888 | data_unref = _tmp40_; |
| 21889 | _tmp41_ = data_unref; |
| 21890 | _tmp42_ = g_strdup_printf ("_data%d_", block_id); |
| 21891 | _tmp43_ = _tmp42_; |
| 21892 | _tmp44_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp43_); |
| 21893 | _tmp45_ = _tmp44_; |
| 21894 | bala_ccode_function_call_add_argument (_tmp41_, _tmp45_); |
| 21895 | _bala_ccode_node_unref0 (_tmp45_)((_tmp45_ == ((void*)0)) ? ((void*)0) : (_tmp45_ = (bala_ccode_node_unref (_tmp45_), ((void*)0)))); |
| 21896 | _g_free0 (_tmp43_)(_tmp43_ = (g_free (_tmp43_), ((void*)0))); |
| 21897 | _tmp46_ = bala_ccode_base_module_get_ccode (self); |
| 21898 | _tmp47_ = _tmp46_; |
| 21899 | _tmp48_ = data_unref; |
| 21900 | bala_ccode_function_add_expression (_tmp47_, (BalaCCodeExpression*) _tmp48_); |
| 21901 | _tmp49_ = bala_ccode_base_module_get_ccode (self); |
| 21902 | _tmp50_ = _tmp49_; |
| 21903 | _tmp51_ = g_strdup_printf ("_data%d_", block_id); |
| 21904 | _tmp52_ = _tmp51_; |
| 21905 | _tmp53_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp52_); |
| 21906 | _tmp54_ = _tmp53_; |
| 21907 | _tmp55_ = bala_ccode_constant_new ("NULL"); |
| 21908 | _tmp56_ = _tmp55_; |
| 21909 | bala_ccode_function_add_assignment (_tmp50_, _tmp54_, (BalaCCodeExpression*) _tmp56_); |
| 21910 | _bala_ccode_node_unref0 (_tmp56_)((_tmp56_ == ((void*)0)) ? ((void*)0) : (_tmp56_ = (bala_ccode_node_unref (_tmp56_), ((void*)0)))); |
| 21911 | _bala_ccode_node_unref0 (_tmp54_)((_tmp54_ == ((void*)0)) ? ((void*)0) : (_tmp54_ = (bala_ccode_node_unref (_tmp54_), ((void*)0)))); |
| 21912 | _g_free0 (_tmp52_)(_tmp52_ = (g_free (_tmp52_), ((void*)0))); |
| 21913 | _bala_ccode_node_unref0 (data_unref)((data_unref == ((void*)0)) ? ((void*)0) : (data_unref = (bala_ccode_node_unref (data_unref), ((void*)0)))); |
| 21914 | } |
| 21915 | _bala_iterable_unref0 (local_vars)((local_vars == ((void*)0)) ? ((void*)0) : (local_vars = (bala_iterable_unref (local_vars), ((void*)0)))); |
| 21916 | _bala_code_node_unref0 (b)((b == ((void*)0)) ? ((void*)0) : (b = (bala_code_node_unref ( b), ((void*)0)))); |
| 21917 | } |
| 21918 | |
| 21919 | void |
| 21920 | bala_ccode_base_module_append_scope_free (BalaCCodeBaseModule* self, |
| 21921 | BalaSymbol* sym, |
| 21922 | BalaCodeNode* stop_at) |
| 21923 | { |
| 21924 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 21925 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->append_scope_free (self, sym, stop_at); |
| 21926 | } |
| 21927 | |
| 21928 | void |
| 21929 | bala_ccode_base_module_append_local_free (BalaCCodeBaseModule* self, |
| 21930 | BalaSymbol* sym, |
| 21931 | BalaStatement* jump_stmt, |
| 21932 | BalaCodeNode* stop_at) |
| 21933 | { |
| 21934 | BalaBlock* b = NULL((void*)0); |
| 21935 | BalaBlock* _tmp0_; |
| 21936 | gboolean _tmp19_ = FALSE(0); |
| 21937 | BalaSymbol* _tmp23_; |
| 21938 | BalaSymbol* _tmp24_; |
| 21939 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 21940 | g_return_if_fail (sym != NULL)do { if ((sym != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "sym != NULL") ; return; } } while (0); |
| 21941 | _tmp0_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (sym, BALA_TYPE_BLOCK, BalaBlock)(((BalaBlock*) g_type_check_instance_cast ((GTypeInstance*) ( sym), ((bala_block_get_type ())))))); |
| 21942 | b = _tmp0_; |
| 21943 | bala_ccode_base_module_append_scope_free (self, sym, stop_at); |
| 21944 | if (G_TYPE_CHECK_INSTANCE_TYPE (jump_stmt, BALA_TYPE_BREAK_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( jump_stmt); GType __t = ((bala_break_statement_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 21945 | gboolean _tmp1_ = FALSE(0); |
| 21946 | gboolean _tmp2_ = FALSE(0); |
| 21947 | BalaBlock* _tmp3_; |
| 21948 | BalaCodeNode* _tmp4_; |
| 21949 | BalaCodeNode* _tmp5_; |
| 21950 | _tmp3_ = b; |
| 21951 | _tmp4_ = bala_code_node_get_parent_node ((BalaCodeNode*) _tmp3_); |
| 21952 | _tmp5_ = _tmp4_; |
| 21953 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, BALA_TYPE_LOOP)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp5_); GType __t = ((bala_loop_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 21954 | _tmp2_ = TRUE(!(0)); |
| 21955 | } else { |
| 21956 | BalaBlock* _tmp6_; |
| 21957 | BalaCodeNode* _tmp7_; |
| 21958 | BalaCodeNode* _tmp8_; |
| 21959 | _tmp6_ = b; |
| 21960 | _tmp7_ = bala_code_node_get_parent_node ((BalaCodeNode*) _tmp6_); |
| 21961 | _tmp8_ = _tmp7_; |
| 21962 | _tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, BALA_TYPE_FOREACH_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp8_); GType __t = ((bala_foreach_statement_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 21963 | } |
| 21964 | if (_tmp2_) { |
| 21965 | _tmp1_ = TRUE(!(0)); |
| 21966 | } else { |
| 21967 | BalaBlock* _tmp9_; |
| 21968 | BalaCodeNode* _tmp10_; |
| 21969 | BalaCodeNode* _tmp11_; |
| 21970 | _tmp9_ = b; |
| 21971 | _tmp10_ = bala_code_node_get_parent_node ((BalaCodeNode*) _tmp9_); |
| 21972 | _tmp11_ = _tmp10_; |
| 21973 | _tmp1_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, BALA_TYPE_SWITCH_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp11_); GType __t = ((bala_switch_statement_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 21974 | } |
| 21975 | if (_tmp1_) { |
| 21976 | _bala_code_node_unref0 (b)((b == ((void*)0)) ? ((void*)0) : (b = (bala_code_node_unref ( b), ((void*)0)))); |
| 21977 | return; |
| 21978 | } |
| 21979 | } else { |
| 21980 | if (G_TYPE_CHECK_INSTANCE_TYPE (jump_stmt, BALA_TYPE_CONTINUE_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( jump_stmt); GType __t = ((bala_continue_statement_get_type () )); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 21981 | gboolean _tmp12_ = FALSE(0); |
| 21982 | BalaBlock* _tmp13_; |
| 21983 | BalaCodeNode* _tmp14_; |
| 21984 | BalaCodeNode* _tmp15_; |
| 21985 | _tmp13_ = b; |
| 21986 | _tmp14_ = bala_code_node_get_parent_node ((BalaCodeNode*) _tmp13_); |
| 21987 | _tmp15_ = _tmp14_; |
| 21988 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, BALA_TYPE_LOOP)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp15_); GType __t = ((bala_loop_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 21989 | _tmp12_ = TRUE(!(0)); |
| 21990 | } else { |
| 21991 | BalaBlock* _tmp16_; |
| 21992 | BalaCodeNode* _tmp17_; |
| 21993 | BalaCodeNode* _tmp18_; |
| 21994 | _tmp16_ = b; |
| 21995 | _tmp17_ = bala_code_node_get_parent_node ((BalaCodeNode*) _tmp16_); |
| 21996 | _tmp18_ = _tmp17_; |
| 21997 | _tmp12_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, BALA_TYPE_FOREACH_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp18_); GType __t = ((bala_foreach_statement_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } ))); |
| 21998 | } |
| 21999 | if (_tmp12_) { |
| 22000 | _bala_code_node_unref0 (b)((b == ((void*)0)) ? ((void*)0) : (b = (bala_code_node_unref ( b), ((void*)0)))); |
| 22001 | return; |
| 22002 | } |
| 22003 | } |
| 22004 | } |
| 22005 | if (stop_at != NULL((void*)0)) { |
| 22006 | BalaBlock* _tmp20_; |
| 22007 | BalaCodeNode* _tmp21_; |
| 22008 | BalaCodeNode* _tmp22_; |
| 22009 | _tmp20_ = b; |
| 22010 | _tmp21_ = bala_code_node_get_parent_node ((BalaCodeNode*) _tmp20_); |
| 22011 | _tmp22_ = _tmp21_; |
| 22012 | _tmp19_ = _tmp22_ == stop_at; |
| 22013 | } else { |
| 22014 | _tmp19_ = FALSE(0); |
| 22015 | } |
| 22016 | if (_tmp19_) { |
| 22017 | _bala_code_node_unref0 (b)((b == ((void*)0)) ? ((void*)0) : (b = (bala_code_node_unref ( b), ((void*)0)))); |
| 22018 | return; |
| 22019 | } |
| 22020 | _tmp23_ = bala_symbol_get_parent_symbol (sym); |
| 22021 | _tmp24_ = _tmp23_; |
| 22022 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, BALA_TYPE_BLOCK)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp24_); GType __t = ((bala_block_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 22023 | BalaSymbol* _tmp25_; |
| 22024 | BalaSymbol* _tmp26_; |
| 22025 | _tmp25_ = bala_symbol_get_parent_symbol (sym); |
| 22026 | _tmp26_ = _tmp25_; |
| 22027 | bala_ccode_base_module_append_local_free (self, _tmp26_, jump_stmt, stop_at); |
| 22028 | } else { |
| 22029 | BalaSymbol* _tmp27_; |
| 22030 | BalaSymbol* _tmp28_; |
| 22031 | _tmp27_ = bala_symbol_get_parent_symbol (sym); |
| 22032 | _tmp28_ = _tmp27_; |
| 22033 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp28_, BALA_TYPE_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp28_); GType __t = ((bala_method_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 22034 | BalaSymbol* _tmp29_; |
| 22035 | BalaSymbol* _tmp30_; |
| 22036 | _tmp29_ = bala_symbol_get_parent_symbol (sym); |
| 22037 | _tmp30_ = _tmp29_; |
| 22038 | bala_ccode_base_module_append_param_free (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, BALA_TYPE_METHOD, BalaMethod)(((BalaMethod*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp30_), ((bala_method_get_type ())))))); |
| 22039 | } else { |
| 22040 | BalaSymbol* _tmp31_; |
| 22041 | BalaSymbol* _tmp32_; |
| 22042 | _tmp31_ = bala_symbol_get_parent_symbol (sym); |
| 22043 | _tmp32_ = _tmp31_; |
| 22044 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp32_, BALA_TYPE_PROPERTY_ACCESSOR)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp32_); GType __t = ((bala_property_accessor_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 22045 | BalaPropertyAccessor* acc = NULL((void*)0); |
| 22046 | BalaSymbol* _tmp33_; |
| 22047 | BalaSymbol* _tmp34_; |
| 22048 | BalaPropertyAccessor* _tmp35_; |
| 22049 | gboolean _tmp36_ = FALSE(0); |
| 22050 | BalaPropertyAccessor* _tmp37_; |
| 22051 | BalaParameter* _tmp38_; |
| 22052 | BalaParameter* _tmp39_; |
| 22053 | _tmp33_ = bala_symbol_get_parent_symbol (sym); |
| 22054 | _tmp34_ = _tmp33_; |
| 22055 | _tmp35_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, BALA_TYPE_PROPERTY_ACCESSOR, BalaPropertyAccessor)(((BalaPropertyAccessor*) g_type_check_instance_cast ((GTypeInstance *) (_tmp34_), ((bala_property_accessor_get_type ())))))); |
| 22056 | acc = _tmp35_; |
| 22057 | _tmp37_ = acc; |
| 22058 | _tmp38_ = bala_property_accessor_get_value_parameter (_tmp37_); |
| 22059 | _tmp39_ = _tmp38_; |
| 22060 | if (_tmp39_ != NULL((void*)0)) { |
| 22061 | BalaPropertyAccessor* _tmp40_; |
| 22062 | BalaParameter* _tmp41_; |
| 22063 | BalaParameter* _tmp42_; |
| 22064 | BalaDataType* _tmp43_; |
| 22065 | BalaDataType* _tmp44_; |
| 22066 | _tmp40_ = acc; |
| 22067 | _tmp41_ = bala_property_accessor_get_value_parameter (_tmp40_); |
| 22068 | _tmp42_ = _tmp41_; |
| 22069 | _tmp43_ = bala_variable_get_variable_type ((BalaVariable*) _tmp42_); |
| 22070 | _tmp44_ = _tmp43_; |
| 22071 | _tmp36_ = bala_ccode_base_module_requires_destroy (_tmp44_); |
| 22072 | } else { |
| 22073 | _tmp36_ = FALSE(0); |
| 22074 | } |
| 22075 | if (_tmp36_) { |
| 22076 | BalaCCodeFunction* _tmp45_; |
| 22077 | BalaCCodeFunction* _tmp46_; |
| 22078 | BalaPropertyAccessor* _tmp47_; |
| 22079 | BalaParameter* _tmp48_; |
| 22080 | BalaParameter* _tmp49_; |
| 22081 | BalaCCodeExpression* _tmp50_; |
| 22082 | BalaCCodeExpression* _tmp51_; |
| 22083 | _tmp45_ = bala_ccode_base_module_get_ccode (self); |
| 22084 | _tmp46_ = _tmp45_; |
| 22085 | _tmp47_ = acc; |
| 22086 | _tmp48_ = bala_property_accessor_get_value_parameter (_tmp47_); |
| 22087 | _tmp49_ = _tmp48_; |
| 22088 | _tmp50_ = bala_ccode_base_module_destroy_parameter (self, _tmp49_); |
| 22089 | _tmp51_ = _tmp50_; |
| 22090 | bala_ccode_function_add_expression (_tmp46_, _tmp51_); |
| 22091 | _bala_ccode_node_unref0 (_tmp51_)((_tmp51_ == ((void*)0)) ? ((void*)0) : (_tmp51_ = (bala_ccode_node_unref (_tmp51_), ((void*)0)))); |
| 22092 | } |
| 22093 | _bala_code_node_unref0 (acc)((acc == ((void*)0)) ? ((void*)0) : (acc = (bala_code_node_unref (acc), ((void*)0)))); |
| 22094 | } |
| 22095 | } |
| 22096 | } |
| 22097 | _bala_code_node_unref0 (b)((b == ((void*)0)) ? ((void*)0) : (b = (bala_code_node_unref ( b), ((void*)0)))); |
| 22098 | } |
| 22099 | |
| 22100 | static void |
| 22101 | bala_ccode_base_module_append_param_free (BalaCCodeBaseModule* self, |
| 22102 | BalaMethod* m) |
| 22103 | { |
| 22104 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 22105 | g_return_if_fail (m != NULL)do { if ((m != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "m != NULL"); return ; } } while (0); |
| 22106 | { |
| 22107 | BalaList* _param_list = NULL((void*)0); |
| 22108 | BalaList* _tmp0_; |
| 22109 | BalaList* _tmp1_; |
| 22110 | gint _param_size = 0; |
| 22111 | BalaList* _tmp2_; |
| 22112 | gint _tmp3_; |
| 22113 | gint _tmp4_; |
| 22114 | gint _param_index = 0; |
| 22115 | _tmp0_ = bala_callable_get_parameters ((BalaCallable*) m); |
| 22116 | _tmp1_ = _bala_iterable_ref0 (_tmp0_); |
| 22117 | _param_list = _tmp1_; |
| 22118 | _tmp2_ = _param_list; |
| 22119 | _tmp3_ = bala_collection_get_size ((BalaCollection*) _tmp2_); |
| 22120 | _tmp4_ = _tmp3_; |
| 22121 | _param_size = _tmp4_; |
| 22122 | _param_index = -1; |
| 22123 | while (TRUE(!(0))) { |
| 22124 | gint _tmp5_; |
| 22125 | gint _tmp6_; |
| 22126 | BalaParameter* param = NULL((void*)0); |
| 22127 | BalaList* _tmp7_; |
| 22128 | gpointer _tmp8_; |
| 22129 | gboolean _tmp9_ = FALSE(0); |
| 22130 | gboolean _tmp10_ = FALSE(0); |
| 22131 | gboolean _tmp11_ = FALSE(0); |
| 22132 | gboolean _tmp12_ = FALSE(0); |
| 22133 | BalaParameter* _tmp13_; |
| 22134 | gboolean _tmp14_; |
| 22135 | gboolean _tmp15_; |
| 22136 | _param_index = _param_index + 1; |
| 22137 | _tmp5_ = _param_index; |
| 22138 | _tmp6_ = _param_size; |
| 22139 | if (!(_tmp5_ < _tmp6_)) { |
| 22140 | break; |
| 22141 | } |
| 22142 | _tmp7_ = _param_list; |
| 22143 | _tmp8_ = bala_list_get (_tmp7_, _param_index); |
| 22144 | param = (BalaParameter*) _tmp8_; |
| 22145 | _tmp13_ = param; |
| 22146 | _tmp14_ = bala_parameter_get_captured (_tmp13_); |
| 22147 | _tmp15_ = _tmp14_; |
| 22148 | if (!_tmp15_) { |
| 22149 | BalaParameter* _tmp16_; |
| 22150 | gboolean _tmp17_; |
| 22151 | gboolean _tmp18_; |
| 22152 | _tmp16_ = param; |
| 22153 | _tmp17_ = bala_parameter_get_ellipsis (_tmp16_); |
| 22154 | _tmp18_ = _tmp17_; |
| 22155 | _tmp12_ = !_tmp18_; |
| 22156 | } else { |
| 22157 | _tmp12_ = FALSE(0); |
| 22158 | } |
| 22159 | if (_tmp12_) { |
| 22160 | BalaParameter* _tmp19_; |
| 22161 | gboolean _tmp20_; |
| 22162 | gboolean _tmp21_; |
| 22163 | _tmp19_ = param; |
| 22164 | _tmp20_ = bala_parameter_get_params_array (_tmp19_); |
| 22165 | _tmp21_ = _tmp20_; |
| 22166 | _tmp11_ = !_tmp21_; |
| 22167 | } else { |
| 22168 | _tmp11_ = FALSE(0); |
| 22169 | } |
| 22170 | if (_tmp11_) { |
| 22171 | BalaParameter* _tmp22_; |
| 22172 | BalaDataType* _tmp23_; |
| 22173 | BalaDataType* _tmp24_; |
| 22174 | _tmp22_ = param; |
| 22175 | _tmp23_ = bala_variable_get_variable_type ((BalaVariable*) _tmp22_); |
| 22176 | _tmp24_ = _tmp23_; |
| 22177 | _tmp10_ = bala_ccode_base_module_requires_destroy (_tmp24_); |
| 22178 | } else { |
| 22179 | _tmp10_ = FALSE(0); |
| 22180 | } |
| 22181 | if (_tmp10_) { |
| 22182 | BalaParameter* _tmp25_; |
| 22183 | BalaParameterDirection _tmp26_; |
| 22184 | BalaParameterDirection _tmp27_; |
| 22185 | _tmp25_ = param; |
| 22186 | _tmp26_ = bala_parameter_get_direction (_tmp25_); |
| 22187 | _tmp27_ = _tmp26_; |
| 22188 | _tmp9_ = _tmp27_ == BALA_PARAMETER_DIRECTION_IN; |
| 22189 | } else { |
| 22190 | _tmp9_ = FALSE(0); |
| 22191 | } |
| 22192 | if (_tmp9_) { |
| 22193 | BalaCCodeFunction* _tmp28_; |
| 22194 | BalaCCodeFunction* _tmp29_; |
| 22195 | BalaParameter* _tmp30_; |
| 22196 | BalaCCodeExpression* _tmp31_; |
| 22197 | BalaCCodeExpression* _tmp32_; |
| 22198 | _tmp28_ = bala_ccode_base_module_get_ccode (self); |
| 22199 | _tmp29_ = _tmp28_; |
| 22200 | _tmp30_ = param; |
| 22201 | _tmp31_ = bala_ccode_base_module_destroy_parameter (self, _tmp30_); |
| 22202 | _tmp32_ = _tmp31_; |
| 22203 | bala_ccode_function_add_expression (_tmp29_, _tmp32_); |
| 22204 | _bala_ccode_node_unref0 (_tmp32_)((_tmp32_ == ((void*)0)) ? ((void*)0) : (_tmp32_ = (bala_ccode_node_unref (_tmp32_), ((void*)0)))); |
| 22205 | } |
| 22206 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 22207 | } |
| 22208 | _bala_iterable_unref0 (_param_list)((_param_list == ((void*)0)) ? ((void*)0) : (_param_list = (bala_iterable_unref (_param_list), ((void*)0)))); |
| 22209 | } |
| 22210 | } |
| 22211 | |
| 22212 | void |
| 22213 | bala_ccode_base_module_append_out_param_free (BalaCCodeBaseModule* self, |
| 22214 | BalaMethod* m) |
| 22215 | { |
| 22216 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 22217 | if (m == NULL((void*)0)) { |
| 22218 | return; |
| 22219 | } |
| 22220 | { |
| 22221 | BalaList* _param_list = NULL((void*)0); |
| 22222 | BalaList* _tmp0_; |
| 22223 | BalaList* _tmp1_; |
| 22224 | gint _param_size = 0; |
| 22225 | BalaList* _tmp2_; |
| 22226 | gint _tmp3_; |
| 22227 | gint _tmp4_; |
| 22228 | gint _param_index = 0; |
| 22229 | _tmp0_ = bala_callable_get_parameters ((BalaCallable*) m); |
| 22230 | _tmp1_ = _bala_iterable_ref0 (_tmp0_); |
| 22231 | _param_list = _tmp1_; |
| 22232 | _tmp2_ = _param_list; |
| 22233 | _tmp3_ = bala_collection_get_size ((BalaCollection*) _tmp2_); |
| 22234 | _tmp4_ = _tmp3_; |
| 22235 | _param_size = _tmp4_; |
| 22236 | _param_index = -1; |
| 22237 | while (TRUE(!(0))) { |
| 22238 | gint _tmp5_; |
| 22239 | gint _tmp6_; |
| 22240 | BalaParameter* param = NULL((void*)0); |
| 22241 | BalaList* _tmp7_; |
| 22242 | gpointer _tmp8_; |
| 22243 | gboolean _tmp9_ = FALSE(0); |
| 22244 | BalaParameter* _tmp10_; |
| 22245 | BalaParameterDirection _tmp11_; |
| 22246 | BalaParameterDirection _tmp12_; |
| 22247 | _param_index = _param_index + 1; |
| 22248 | _tmp5_ = _param_index; |
| 22249 | _tmp6_ = _param_size; |
| 22250 | if (!(_tmp5_ < _tmp6_)) { |
| 22251 | break; |
| 22252 | } |
| 22253 | _tmp7_ = _param_list; |
| 22254 | _tmp8_ = bala_list_get (_tmp7_, _param_index); |
| 22255 | param = (BalaParameter*) _tmp8_; |
| 22256 | _tmp10_ = param; |
| 22257 | _tmp11_ = bala_parameter_get_direction (_tmp10_); |
| 22258 | _tmp12_ = _tmp11_; |
| 22259 | if (_tmp12_ == BALA_PARAMETER_DIRECTION_OUT) { |
| 22260 | BalaParameter* _tmp13_; |
| 22261 | BalaDataType* _tmp14_; |
| 22262 | BalaDataType* _tmp15_; |
| 22263 | _tmp13_ = param; |
| 22264 | _tmp14_ = bala_variable_get_variable_type ((BalaVariable*) _tmp13_); |
| 22265 | _tmp15_ = _tmp14_; |
| 22266 | _tmp9_ = bala_data_type_is_disposable (_tmp15_); |
| 22267 | } else { |
| 22268 | _tmp9_ = FALSE(0); |
| 22269 | } |
| 22270 | if (_tmp9_) { |
| 22271 | BalaCCodeFunction* _tmp16_; |
| 22272 | BalaCCodeFunction* _tmp17_; |
| 22273 | BalaParameter* _tmp18_; |
| 22274 | BalaCCodeExpression* _tmp19_; |
| 22275 | BalaCCodeExpression* _tmp20_; |
| 22276 | _tmp16_ = bala_ccode_base_module_get_ccode (self); |
| 22277 | _tmp17_ = _tmp16_; |
| 22278 | _tmp18_ = param; |
| 22279 | _tmp19_ = bala_ccode_base_module_destroy_parameter (self, _tmp18_); |
| 22280 | _tmp20_ = _tmp19_; |
| 22281 | bala_ccode_function_add_expression (_tmp17_, _tmp20_); |
| 22282 | _bala_ccode_node_unref0 (_tmp20_)((_tmp20_ == ((void*)0)) ? ((void*)0) : (_tmp20_ = (bala_ccode_node_unref (_tmp20_), ((void*)0)))); |
| 22283 | } |
| 22284 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 22285 | } |
| 22286 | _bala_iterable_unref0 (_param_list)((_param_list == ((void*)0)) ? ((void*)0) : (_param_list = (bala_iterable_unref (_param_list), ((void*)0)))); |
| 22287 | } |
| 22288 | } |
| 22289 | |
| 22290 | gboolean |
| 22291 | bala_ccode_base_module_variable_accessible_in_finally (BalaCCodeBaseModule* self, |
| 22292 | BalaLocalVariable* local) |
| 22293 | { |
| 22294 | BalaTryStatement* _tmp0_; |
| 22295 | BalaTryStatement* _tmp1_; |
| 22296 | BalaSymbol* sym = NULL((void*)0); |
| 22297 | BalaSymbol* _tmp2_; |
| 22298 | BalaSymbol* _tmp3_; |
| 22299 | BalaSymbol* _tmp4_; |
| 22300 | gboolean result = FALSE(0); |
| 22301 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 22302 | g_return_val_if_fail (local != NULL, FALSE)do { if ((local != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "local != NULL" ); return ((0)); } } while (0); |
| 22303 | _tmp0_ = bala_ccode_base_module_get_current_try (self); |
| 22304 | _tmp1_ = _tmp0_; |
| 22305 | if (_tmp1_ == NULL((void*)0)) { |
| 22306 | result = FALSE(0); |
| 22307 | return result; |
| 22308 | } |
| 22309 | _tmp2_ = bala_ccode_base_module_get_current_symbol (self); |
| 22310 | _tmp3_ = _tmp2_; |
| 22311 | _tmp4_ = _bala_code_node_ref0 (_tmp3_); |
| 22312 | sym = _tmp4_; |
| 22313 | while (TRUE(!(0))) { |
| 22314 | gboolean _tmp5_ = FALSE(0); |
| 22315 | gboolean _tmp6_ = FALSE(0); |
| 22316 | BalaSymbol* _tmp7_; |
| 22317 | gboolean _tmp16_ = FALSE(0); |
| 22318 | gboolean _tmp17_ = FALSE(0); |
| 22319 | BalaSymbol* _tmp18_; |
| 22320 | BalaCodeNode* _tmp19_; |
| 22321 | BalaCodeNode* _tmp20_; |
| 22322 | BalaSymbol* _tmp37_; |
| 22323 | BalaSymbol* _tmp38_; |
| 22324 | BalaSymbol* _tmp39_; |
| 22325 | BalaSymbol* _tmp40_; |
| 22326 | _tmp7_ = sym; |
| 22327 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, BALA_TYPE_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp7_); GType __t = ((bala_method_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 22328 | _tmp6_ = TRUE(!(0)); |
| 22329 | } else { |
| 22330 | BalaSymbol* _tmp8_; |
| 22331 | _tmp8_ = sym; |
| 22332 | _tmp6_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, BALA_TYPE_PROPERTY_ACCESSOR)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp8_); GType __t = ((bala_property_accessor_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 22333 | } |
| 22334 | if (!_tmp6_) { |
| 22335 | BalaSymbol* _tmp9_; |
| 22336 | BalaScope* _tmp10_; |
| 22337 | BalaScope* _tmp11_; |
| 22338 | const gchar* _tmp12_; |
| 22339 | const gchar* _tmp13_; |
| 22340 | BalaSymbol* _tmp14_; |
| 22341 | BalaSymbol* _tmp15_; |
| 22342 | _tmp9_ = sym; |
| 22343 | _tmp10_ = bala_symbol_get_scope (_tmp9_); |
| 22344 | _tmp11_ = _tmp10_; |
| 22345 | _tmp12_ = bala_symbol_get_name ((BalaSymbol*) local); |
| 22346 | _tmp13_ = _tmp12_; |
| 22347 | _tmp14_ = bala_scope_lookup (_tmp11_, _tmp13_); |
| 22348 | _tmp15_ = _tmp14_; |
| 22349 | _tmp5_ = _tmp15_ == NULL((void*)0); |
| 22350 | _bala_code_node_unref0 (_tmp15_)((_tmp15_ == ((void*)0)) ? ((void*)0) : (_tmp15_ = (bala_code_node_unref (_tmp15_), ((void*)0)))); |
| 22351 | } else { |
| 22352 | _tmp5_ = FALSE(0); |
| 22353 | } |
| 22354 | if (!_tmp5_) { |
| 22355 | break; |
| 22356 | } |
| 22357 | _tmp18_ = sym; |
| 22358 | _tmp19_ = bala_code_node_get_parent_node ((BalaCodeNode*) _tmp18_); |
| 22359 | _tmp20_ = _tmp19_; |
| 22360 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, BALA_TYPE_TRY_STATEMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp20_); GType __t = ((bala_try_statement_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 22361 | BalaSymbol* _tmp21_; |
| 22362 | BalaCodeNode* _tmp22_; |
| 22363 | BalaCodeNode* _tmp23_; |
| 22364 | BalaBlock* _tmp24_; |
| 22365 | BalaBlock* _tmp25_; |
| 22366 | _tmp21_ = sym; |
| 22367 | _tmp22_ = bala_code_node_get_parent_node ((BalaCodeNode*) _tmp21_); |
| 22368 | _tmp23_ = _tmp22_; |
| 22369 | _tmp24_ = bala_try_statement_get_finally_body (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, BALA_TYPE_TRY_STATEMENT, BalaTryStatement)(((BalaTryStatement*) g_type_check_instance_cast ((GTypeInstance *) (_tmp23_), ((bala_try_statement_get_type ())))))); |
| 22370 | _tmp25_ = _tmp24_; |
| 22371 | _tmp17_ = _tmp25_ != NULL((void*)0); |
| 22372 | } else { |
| 22373 | _tmp17_ = FALSE(0); |
| 22374 | } |
| 22375 | if (_tmp17_) { |
| 22376 | _tmp16_ = TRUE(!(0)); |
| 22377 | } else { |
| 22378 | gboolean _tmp26_ = FALSE(0); |
| 22379 | BalaSymbol* _tmp27_; |
| 22380 | BalaCodeNode* _tmp28_; |
| 22381 | BalaCodeNode* _tmp29_; |
| 22382 | _tmp27_ = sym; |
| 22383 | _tmp28_ = bala_code_node_get_parent_node ((BalaCodeNode*) _tmp27_); |
| 22384 | _tmp29_ = _tmp28_; |
| 22385 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp29_, BALA_TYPE_CATCH_CLAUSE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp29_); GType __t = ((bala_catch_clause_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 22386 | BalaSymbol* _tmp30_; |
| 22387 | BalaCodeNode* _tmp31_; |
| 22388 | BalaCodeNode* _tmp32_; |
| 22389 | BalaCodeNode* _tmp33_; |
| 22390 | BalaCodeNode* _tmp34_; |
| 22391 | BalaBlock* _tmp35_; |
| 22392 | BalaBlock* _tmp36_; |
| 22393 | _tmp30_ = sym; |
| 22394 | _tmp31_ = bala_code_node_get_parent_node ((BalaCodeNode*) _tmp30_); |
| 22395 | _tmp32_ = _tmp31_; |
| 22396 | _tmp33_ = bala_code_node_get_parent_node (_tmp32_); |
| 22397 | _tmp34_ = _tmp33_; |
| 22398 | _tmp35_ = bala_try_statement_get_finally_body (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, BALA_TYPE_TRY_STATEMENT, BalaTryStatement)(((BalaTryStatement*) g_type_check_instance_cast ((GTypeInstance *) (_tmp34_), ((bala_try_statement_get_type ())))))); |
| 22399 | _tmp36_ = _tmp35_; |
| 22400 | _tmp26_ = _tmp36_ != NULL((void*)0); |
| 22401 | } else { |
| 22402 | _tmp26_ = FALSE(0); |
| 22403 | } |
| 22404 | _tmp16_ = _tmp26_; |
| 22405 | } |
| 22406 | if (_tmp16_) { |
| 22407 | result = TRUE(!(0)); |
| 22408 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 22409 | return result; |
| 22410 | } |
| 22411 | _tmp37_ = sym; |
| 22412 | _tmp38_ = bala_symbol_get_parent_symbol (_tmp37_); |
| 22413 | _tmp39_ = _tmp38_; |
| 22414 | _tmp40_ = _bala_code_node_ref0 (_tmp39_); |
| 22415 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 22416 | sym = _tmp40_; |
| 22417 | } |
| 22418 | result = FALSE(0); |
| 22419 | _bala_code_node_unref0 (sym)((sym == ((void*)0)) ? ((void*)0) : (sym = (bala_code_node_unref (sym), ((void*)0)))); |
| 22420 | return result; |
| 22421 | } |
| 22422 | |
| 22423 | void |
| 22424 | bala_ccode_base_module_return_out_parameter (BalaCCodeBaseModule* self, |
| 22425 | BalaParameter* param) |
| 22426 | { |
| 22427 | BalaDelegateType* delegate_type = NULL((void*)0); |
| 22428 | BalaDataType* _tmp0_; |
| 22429 | BalaDataType* _tmp1_; |
| 22430 | BalaDelegateType* _tmp2_; |
| 22431 | BalaTargetValue* value = NULL((void*)0); |
| 22432 | BalaTargetValue* _tmp3_; |
| 22433 | gboolean old_coroutine = FALSE(0); |
| 22434 | BalaMethod* _tmp4_; |
| 22435 | BalaMethod* _tmp5_; |
| 22436 | BalaCCodeFunction* _tmp6_; |
| 22437 | BalaCCodeFunction* _tmp7_; |
| 22438 | BalaCCodeExpression* _tmp8_; |
| 22439 | BalaCCodeExpression* _tmp9_; |
| 22440 | BalaCCodeFunction* _tmp10_; |
| 22441 | BalaCCodeFunction* _tmp11_; |
| 22442 | BalaCCodeExpression* _tmp12_; |
| 22443 | BalaCCodeExpression* _tmp13_; |
| 22444 | BalaCCodeUnaryExpression* _tmp14_; |
| 22445 | BalaCCodeUnaryExpression* _tmp15_; |
| 22446 | BalaTargetValue* _tmp16_; |
| 22447 | BalaCCodeExpression* _tmp17_; |
| 22448 | gboolean _tmp18_ = FALSE(0); |
| 22449 | gboolean _tmp19_ = FALSE(0); |
| 22450 | BalaDataType* _tmp50_; |
| 22451 | BalaDataType* _tmp51_; |
| 22452 | BalaCCodeFunction* _tmp62_; |
| 22453 | BalaCCodeFunction* _tmp63_; |
| 22454 | BalaArrayType* array_type = NULL((void*)0); |
| 22455 | BalaDataType* _tmp64_; |
| 22456 | BalaDataType* _tmp65_; |
| 22457 | BalaArrayType* _tmp66_; |
| 22458 | gboolean _tmp67_ = FALSE(0); |
| 22459 | gboolean _tmp68_ = FALSE(0); |
| 22460 | BalaArrayType* _tmp69_; |
| 22461 | BalaMethod* _tmp96_; |
| 22462 | BalaMethod* _tmp97_; |
| 22463 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 22464 | g_return_if_fail (param != NULL)do { if ((param != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "param != NULL" ); return; } } while (0); |
| 22465 | _tmp0_ = bala_variable_get_variable_type ((BalaVariable*) param); |
| 22466 | _tmp1_ = _tmp0_; |
| 22467 | _tmp2_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaDelegateType*) _tmp1_) : NULL((void*)0)); |
| 22468 | delegate_type = _tmp2_; |
| 22469 | _tmp3_ = bala_ccode_base_module_get_parameter_cvalue (self, param); |
| 22470 | value = _tmp3_; |
| 22471 | old_coroutine = bala_ccode_base_module_is_in_coroutine (self); |
| 22472 | _tmp4_ = bala_ccode_base_module_get_current_method (self); |
| 22473 | _tmp5_ = _tmp4_; |
| 22474 | bala_method_set_coroutine (_tmp5_, FALSE(0)); |
| 22475 | _tmp6_ = bala_ccode_base_module_get_ccode (self); |
| 22476 | _tmp7_ = _tmp6_; |
| 22477 | _tmp8_ = bala_ccode_base_module_get_parameter_cexpression (self, param); |
| 22478 | _tmp9_ = _tmp8_; |
| 22479 | bala_ccode_function_open_if (_tmp7_, _tmp9_); |
| 22480 | _bala_ccode_node_unref0 (_tmp9_)((_tmp9_ == ((void*)0)) ? ((void*)0) : (_tmp9_ = (bala_ccode_node_unref (_tmp9_), ((void*)0)))); |
| 22481 | _tmp10_ = bala_ccode_base_module_get_ccode (self); |
| 22482 | _tmp11_ = _tmp10_; |
| 22483 | _tmp12_ = bala_ccode_base_module_get_parameter_cexpression (self, param); |
| 22484 | _tmp13_ = _tmp12_; |
| 22485 | _tmp14_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp13_); |
| 22486 | _tmp15_ = _tmp14_; |
| 22487 | _tmp16_ = value; |
| 22488 | _tmp17_ = bala_get_cvalue_ (_tmp16_); |
| 22489 | bala_ccode_function_add_assignment (_tmp11_, (BalaCCodeExpression*) _tmp15_, _tmp17_); |
| 22490 | _bala_ccode_node_unref0 (_tmp15_)((_tmp15_ == ((void*)0)) ? ((void*)0) : (_tmp15_ = (bala_ccode_node_unref (_tmp15_), ((void*)0)))); |
| 22491 | _bala_ccode_node_unref0 (_tmp13_)((_tmp13_ == ((void*)0)) ? ((void*)0) : (_tmp13_ = (bala_ccode_node_unref (_tmp13_), ((void*)0)))); |
| 22492 | if (bala_get_ccode_delegate_target ((BalaCodeNode*) param)) { |
| 22493 | BalaDelegateType* _tmp20_; |
| 22494 | _tmp20_ = delegate_type; |
| 22495 | _tmp19_ = _tmp20_ != NULL((void*)0); |
| 22496 | } else { |
| 22497 | _tmp19_ = FALSE(0); |
| 22498 | } |
| 22499 | if (_tmp19_) { |
| 22500 | BalaDelegateType* _tmp21_; |
| 22501 | BalaDelegate* _tmp22_; |
| 22502 | BalaDelegate* _tmp23_; |
| 22503 | gboolean _tmp24_; |
| 22504 | gboolean _tmp25_; |
| 22505 | _tmp21_ = delegate_type; |
| 22506 | _tmp22_ = bala_delegate_type_get_delegate_symbol (_tmp21_); |
| 22507 | _tmp23_ = _tmp22_; |
| 22508 | _tmp24_ = bala_delegate_get_has_target (_tmp23_); |
| 22509 | _tmp25_ = _tmp24_; |
| 22510 | _tmp18_ = _tmp25_; |
| 22511 | } else { |
| 22512 | _tmp18_ = FALSE(0); |
| 22513 | } |
| 22514 | if (_tmp18_) { |
| 22515 | BalaCCodeFunction* _tmp26_; |
| 22516 | BalaCCodeFunction* _tmp27_; |
| 22517 | gchar* _tmp28_; |
| 22518 | gchar* _tmp29_; |
| 22519 | BalaCCodeExpression* _tmp30_; |
| 22520 | BalaCCodeExpression* _tmp31_; |
| 22521 | BalaCCodeUnaryExpression* _tmp32_; |
| 22522 | BalaCCodeUnaryExpression* _tmp33_; |
| 22523 | BalaTargetValue* _tmp34_; |
| 22524 | BalaCCodeExpression* _tmp35_; |
| 22525 | BalaCCodeExpression* _tmp36_; |
| 22526 | BalaDelegateType* _tmp37_; |
| 22527 | _tmp26_ = bala_ccode_base_module_get_ccode (self); |
| 22528 | _tmp27_ = _tmp26_; |
| 22529 | _tmp28_ = bala_get_ccode_delegate_target_name ((BalaVariable*) param); |
| 22530 | _tmp29_ = _tmp28_; |
| 22531 | _tmp30_ = bala_ccode_base_module_get_cexpression (self, _tmp29_); |
| 22532 | _tmp31_ = _tmp30_; |
| 22533 | _tmp32_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp31_); |
| 22534 | _tmp33_ = _tmp32_; |
| 22535 | _tmp34_ = value; |
| 22536 | _tmp35_ = bala_ccode_base_module_get_delegate_target_cvalue (self, _tmp34_); |
| 22537 | _tmp36_ = _tmp35_; |
| 22538 | bala_ccode_function_add_assignment (_tmp27_, (BalaCCodeExpression*) _tmp33_, _tmp36_); |
| 22539 | _bala_ccode_node_unref0 (_tmp36_)((_tmp36_ == ((void*)0)) ? ((void*)0) : (_tmp36_ = (bala_ccode_node_unref (_tmp36_), ((void*)0)))); |
| 22540 | _bala_ccode_node_unref0 (_tmp33_)((_tmp33_ == ((void*)0)) ? ((void*)0) : (_tmp33_ = (bala_ccode_node_unref (_tmp33_), ((void*)0)))); |
| 22541 | _bala_ccode_node_unref0 (_tmp31_)((_tmp31_ == ((void*)0)) ? ((void*)0) : (_tmp31_ = (bala_ccode_node_unref (_tmp31_), ((void*)0)))); |
| 22542 | _g_free0 (_tmp29_)(_tmp29_ = (g_free (_tmp29_), ((void*)0))); |
| 22543 | _tmp37_ = delegate_type; |
| 22544 | if (bala_data_type_is_disposable ((BalaDataType*) _tmp37_)) { |
| 22545 | BalaCCodeFunction* _tmp38_; |
| 22546 | BalaCCodeFunction* _tmp39_; |
| 22547 | gchar* _tmp40_; |
| 22548 | gchar* _tmp41_; |
| 22549 | BalaCCodeExpression* _tmp42_; |
| 22550 | BalaCCodeExpression* _tmp43_; |
| 22551 | BalaCCodeUnaryExpression* _tmp44_; |
| 22552 | BalaCCodeUnaryExpression* _tmp45_; |
| 22553 | BalaTargetValue* _tmp46_; |
| 22554 | BalaTargetValue* _tmp47_; |
| 22555 | BalaCCodeExpression* _tmp48_; |
| 22556 | BalaCCodeExpression* _tmp49_; |
| 22557 | _tmp38_ = bala_ccode_base_module_get_ccode (self); |
| 22558 | _tmp39_ = _tmp38_; |
| 22559 | _tmp40_ = bala_get_ccode_delegate_target_destroy_notify_name ((BalaVariable*) param); |
| 22560 | _tmp41_ = _tmp40_; |
| 22561 | _tmp42_ = bala_ccode_base_module_get_cexpression (self, _tmp41_); |
| 22562 | _tmp43_ = _tmp42_; |
| 22563 | _tmp44_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp43_); |
| 22564 | _tmp45_ = _tmp44_; |
| 22565 | _tmp46_ = bala_ccode_base_module_get_parameter_cvalue (self, param); |
| 22566 | _tmp47_ = _tmp46_; |
| 22567 | _tmp48_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cvalue (self, _tmp47_); |
| 22568 | _tmp49_ = _tmp48_; |
| 22569 | bala_ccode_function_add_assignment (_tmp39_, (BalaCCodeExpression*) _tmp45_, _tmp49_); |
| 22570 | _bala_ccode_node_unref0 (_tmp49_)((_tmp49_ == ((void*)0)) ? ((void*)0) : (_tmp49_ = (bala_ccode_node_unref (_tmp49_), ((void*)0)))); |
| 22571 | _bala_target_value_unref0 (_tmp47_)((_tmp47_ == ((void*)0)) ? ((void*)0) : (_tmp47_ = (bala_target_value_unref (_tmp47_), ((void*)0)))); |
| 22572 | _bala_ccode_node_unref0 (_tmp45_)((_tmp45_ == ((void*)0)) ? ((void*)0) : (_tmp45_ = (bala_ccode_node_unref (_tmp45_), ((void*)0)))); |
| 22573 | _bala_ccode_node_unref0 (_tmp43_)((_tmp43_ == ((void*)0)) ? ((void*)0) : (_tmp43_ = (bala_ccode_node_unref (_tmp43_), ((void*)0)))); |
| 22574 | _g_free0 (_tmp41_)(_tmp41_ = (g_free (_tmp41_), ((void*)0))); |
| 22575 | } |
| 22576 | } |
| 22577 | _tmp50_ = bala_variable_get_variable_type ((BalaVariable*) param); |
| 22578 | _tmp51_ = _tmp50_; |
| 22579 | if (bala_data_type_is_disposable (_tmp51_)) { |
| 22580 | BalaCCodeFunction* _tmp52_; |
| 22581 | BalaCCodeFunction* _tmp53_; |
| 22582 | BalaMethod* _tmp54_; |
| 22583 | BalaMethod* _tmp55_; |
| 22584 | BalaCCodeFunction* _tmp56_; |
| 22585 | BalaCCodeFunction* _tmp57_; |
| 22586 | BalaCCodeExpression* _tmp58_; |
| 22587 | BalaCCodeExpression* _tmp59_; |
| 22588 | BalaMethod* _tmp60_; |
| 22589 | BalaMethod* _tmp61_; |
| 22590 | _tmp52_ = bala_ccode_base_module_get_ccode (self); |
| 22591 | _tmp53_ = _tmp52_; |
| 22592 | bala_ccode_function_add_else (_tmp53_); |
| 22593 | _tmp54_ = bala_ccode_base_module_get_current_method (self); |
| 22594 | _tmp55_ = _tmp54_; |
| 22595 | bala_method_set_coroutine (_tmp55_, old_coroutine); |
| 22596 | _tmp56_ = bala_ccode_base_module_get_ccode (self); |
| 22597 | _tmp57_ = _tmp56_; |
| 22598 | _tmp58_ = bala_ccode_base_module_destroy_parameter (self, param); |
| 22599 | _tmp59_ = _tmp58_; |
| 22600 | bala_ccode_function_add_expression (_tmp57_, _tmp59_); |
| 22601 | _bala_ccode_node_unref0 (_tmp59_)((_tmp59_ == ((void*)0)) ? ((void*)0) : (_tmp59_ = (bala_ccode_node_unref (_tmp59_), ((void*)0)))); |
| 22602 | _tmp60_ = bala_ccode_base_module_get_current_method (self); |
| 22603 | _tmp61_ = _tmp60_; |
| 22604 | bala_method_set_coroutine (_tmp61_, FALSE(0)); |
| 22605 | } |
| 22606 | _tmp62_ = bala_ccode_base_module_get_ccode (self); |
| 22607 | _tmp63_ = _tmp62_; |
| 22608 | bala_ccode_function_close (_tmp63_); |
| 22609 | _tmp64_ = bala_variable_get_variable_type ((BalaVariable*) param); |
| 22610 | _tmp65_ = _tmp64_; |
| 22611 | _tmp66_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp65_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp65_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) _tmp65_) : NULL((void*)0)); |
| 22612 | array_type = _tmp66_; |
| 22613 | _tmp69_ = array_type; |
| 22614 | if (_tmp69_ != NULL((void*)0)) { |
| 22615 | BalaArrayType* _tmp70_; |
| 22616 | gboolean _tmp71_; |
| 22617 | gboolean _tmp72_; |
| 22618 | _tmp70_ = array_type; |
| 22619 | _tmp71_ = bala_array_type_get_fixed_length (_tmp70_); |
| 22620 | _tmp72_ = _tmp71_; |
| 22621 | _tmp68_ = !_tmp72_; |
| 22622 | } else { |
| 22623 | _tmp68_ = FALSE(0); |
| 22624 | } |
| 22625 | if (_tmp68_) { |
| 22626 | _tmp67_ = bala_get_ccode_array_length ((BalaCodeNode*) param); |
| 22627 | } else { |
| 22628 | _tmp67_ = FALSE(0); |
| 22629 | } |
| 22630 | if (_tmp67_) { |
| 22631 | { |
| 22632 | gint dim = 0; |
| 22633 | dim = 1; |
| 22634 | { |
| 22635 | gboolean _tmp73_ = FALSE(0); |
| 22636 | _tmp73_ = TRUE(!(0)); |
| 22637 | while (TRUE(!(0))) { |
| 22638 | BalaArrayType* _tmp75_; |
| 22639 | gint _tmp76_; |
| 22640 | gint _tmp77_; |
| 22641 | gchar* length_cname = NULL((void*)0); |
| 22642 | gchar* _tmp78_; |
| 22643 | BalaCCodeFunction* _tmp79_; |
| 22644 | BalaCCodeFunction* _tmp80_; |
| 22645 | const gchar* _tmp81_; |
| 22646 | BalaCCodeExpression* _tmp82_; |
| 22647 | BalaCCodeExpression* _tmp83_; |
| 22648 | BalaCCodeFunction* _tmp84_; |
| 22649 | BalaCCodeFunction* _tmp85_; |
| 22650 | const gchar* _tmp86_; |
| 22651 | BalaCCodeExpression* _tmp87_; |
| 22652 | BalaCCodeExpression* _tmp88_; |
| 22653 | BalaCCodeUnaryExpression* _tmp89_; |
| 22654 | BalaCCodeUnaryExpression* _tmp90_; |
| 22655 | BalaTargetValue* _tmp91_; |
| 22656 | BalaCCodeExpression* _tmp92_; |
| 22657 | BalaCCodeExpression* _tmp93_; |
| 22658 | BalaCCodeFunction* _tmp94_; |
| 22659 | BalaCCodeFunction* _tmp95_; |
| 22660 | if (!_tmp73_) { |
| 22661 | gint _tmp74_; |
| 22662 | _tmp74_ = dim; |
| 22663 | dim = _tmp74_ + 1; |
| 22664 | } |
| 22665 | _tmp73_ = FALSE(0); |
| 22666 | _tmp75_ = array_type; |
| 22667 | _tmp76_ = bala_array_type_get_rank (_tmp75_); |
| 22668 | _tmp77_ = _tmp76_; |
| 22669 | if (!(dim <= _tmp77_)) { |
| 22670 | break; |
| 22671 | } |
| 22672 | _tmp78_ = bala_ccode_base_module_get_variable_array_length_cname (self, (BalaVariable*) param, dim); |
| 22673 | length_cname = _tmp78_; |
| 22674 | _tmp79_ = bala_ccode_base_module_get_ccode (self); |
| 22675 | _tmp80_ = _tmp79_; |
| 22676 | _tmp81_ = length_cname; |
| 22677 | _tmp82_ = bala_ccode_base_module_get_cexpression (self, _tmp81_); |
| 22678 | _tmp83_ = _tmp82_; |
| 22679 | bala_ccode_function_open_if (_tmp80_, _tmp83_); |
| 22680 | _bala_ccode_node_unref0 (_tmp83_)((_tmp83_ == ((void*)0)) ? ((void*)0) : (_tmp83_ = (bala_ccode_node_unref (_tmp83_), ((void*)0)))); |
| 22681 | _tmp84_ = bala_ccode_base_module_get_ccode (self); |
| 22682 | _tmp85_ = _tmp84_; |
| 22683 | _tmp86_ = length_cname; |
| 22684 | _tmp87_ = bala_ccode_base_module_get_cexpression (self, _tmp86_); |
| 22685 | _tmp88_ = _tmp87_; |
| 22686 | _tmp89_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp88_); |
| 22687 | _tmp90_ = _tmp89_; |
| 22688 | _tmp91_ = value; |
| 22689 | _tmp92_ = bala_ccode_base_module_get_array_length_cvalue (self, _tmp91_, dim); |
| 22690 | _tmp93_ = _tmp92_; |
| 22691 | bala_ccode_function_add_assignment (_tmp85_, (BalaCCodeExpression*) _tmp90_, _tmp93_); |
| 22692 | _bala_ccode_node_unref0 (_tmp93_)((_tmp93_ == ((void*)0)) ? ((void*)0) : (_tmp93_ = (bala_ccode_node_unref (_tmp93_), ((void*)0)))); |
| 22693 | _bala_ccode_node_unref0 (_tmp90_)((_tmp90_ == ((void*)0)) ? ((void*)0) : (_tmp90_ = (bala_ccode_node_unref (_tmp90_), ((void*)0)))); |
| 22694 | _bala_ccode_node_unref0 (_tmp88_)((_tmp88_ == ((void*)0)) ? ((void*)0) : (_tmp88_ = (bala_ccode_node_unref (_tmp88_), ((void*)0)))); |
| 22695 | _tmp94_ = bala_ccode_base_module_get_ccode (self); |
| 22696 | _tmp95_ = _tmp94_; |
| 22697 | bala_ccode_function_close (_tmp95_); |
| 22698 | _g_free0 (length_cname)(length_cname = (g_free (length_cname), ((void*)0))); |
| 22699 | } |
| 22700 | } |
| 22701 | } |
| 22702 | } |
| 22703 | _tmp96_ = bala_ccode_base_module_get_current_method (self); |
| 22704 | _tmp97_ = _tmp96_; |
| 22705 | bala_method_set_coroutine (_tmp97_, old_coroutine); |
| 22706 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 22707 | _bala_target_value_unref0 (value)((value == ((void*)0)) ? ((void*)0) : (value = (bala_target_value_unref (value), ((void*)0)))); |
| 22708 | _bala_code_node_unref0 (delegate_type)((delegate_type == ((void*)0)) ? ((void*)0) : (delegate_type = (bala_code_node_unref (delegate_type), ((void*)0)))); |
| 22709 | } |
| 22710 | |
| 22711 | static void |
| 22712 | bala_ccode_base_module_real_visit_return_statement (BalaCodeVisitor* base, |
| 22713 | BalaReturnStatement* stmt) |
| 22714 | { |
| 22715 | BalaCCodeBaseModule * self; |
| 22716 | BalaSymbol* return_expression_symbol = NULL((void*)0); |
| 22717 | BalaExpression* _tmp0_; |
| 22718 | BalaExpression* _tmp1_; |
| 22719 | gboolean _tmp14_ = FALSE(0); |
| 22720 | gboolean _tmp15_ = FALSE(0); |
| 22721 | gboolean _tmp16_ = FALSE(0); |
| 22722 | BalaMethod* _tmp17_; |
| 22723 | BalaMethod* _tmp18_; |
| 22724 | BalaExpression* _tmp120_; |
| 22725 | BalaExpression* _tmp121_; |
| 22726 | BalaMethod* _tmp134_; |
| 22727 | BalaMethod* _tmp135_; |
| 22728 | BalaSymbol* _tmp148_; |
| 22729 | BalaSymbol* _tmp149_; |
| 22730 | gboolean _tmp150_ = FALSE(0); |
| 22731 | BalaMethod* _tmp151_; |
| 22732 | BalaMethod* _tmp152_; |
| 22733 | gboolean _tmp172_ = FALSE(0); |
| 22734 | BalaMethod* _tmp173_; |
| 22735 | BalaMethod* _tmp174_; |
| 22736 | BalaSymbol* _tmp235_; |
| 22737 | self = (BalaCCodeBaseModule*) base; |
| 22738 | g_return_if_fail (stmt != NULL)do { if ((stmt != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "stmt != NULL" ); return; } } while (0); |
| 22739 | return_expression_symbol = NULL((void*)0); |
| 22740 | _tmp0_ = bala_return_statement_get_return_expression (stmt); |
| 22741 | _tmp1_ = _tmp0_; |
| 22742 | if (_tmp1_ != NULL((void*)0)) { |
| 22743 | BalaLocalVariable* local = NULL((void*)0); |
| 22744 | BalaExpression* _tmp2_; |
| 22745 | BalaExpression* _tmp3_; |
| 22746 | BalaSymbol* _tmp4_; |
| 22747 | BalaSymbol* _tmp5_; |
| 22748 | BalaLocalVariable* _tmp6_; |
| 22749 | gboolean _tmp7_ = FALSE(0); |
| 22750 | BalaLocalVariable* _tmp8_; |
| 22751 | _tmp2_ = bala_return_statement_get_return_expression (stmt); |
| 22752 | _tmp3_ = _tmp2_; |
| 22753 | _tmp4_ = bala_expression_get_symbol_reference (_tmp3_); |
| 22754 | _tmp5_ = _tmp4_; |
| 22755 | _tmp6_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, BALA_TYPE_LOCAL_VARIABLE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp5_); GType __t = ((bala_local_variable_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaLocalVariable*) _tmp5_) : NULL((void*)0)); |
| 22756 | local = _tmp6_; |
| 22757 | _tmp8_ = local; |
| 22758 | if (_tmp8_ != NULL((void*)0)) { |
| 22759 | BalaLocalVariable* _tmp9_; |
| 22760 | gboolean _tmp10_; |
| 22761 | gboolean _tmp11_; |
| 22762 | _tmp9_ = local; |
| 22763 | _tmp10_ = bala_symbol_get_active ((BalaSymbol*) _tmp9_); |
| 22764 | _tmp11_ = _tmp10_; |
| 22765 | _tmp7_ = !_tmp11_; |
| 22766 | } else { |
| 22767 | _tmp7_ = FALSE(0); |
| 22768 | } |
| 22769 | if (_tmp7_) { |
| 22770 | BalaLocalVariable* _tmp12_; |
| 22771 | BalaSymbol* _tmp13_; |
| 22772 | _tmp12_ = local; |
| 22773 | _tmp13_ = _bala_code_node_ref0 ((BalaSymbol*) _tmp12_); |
| 22774 | _bala_code_node_unref0 (return_expression_symbol)((return_expression_symbol == ((void*)0)) ? ((void*)0) : (return_expression_symbol = (bala_code_node_unref (return_expression_symbol), ((void*) 0)))); |
| 22775 | return_expression_symbol = _tmp13_; |
| 22776 | } |
| 22777 | _bala_code_node_unref0 (local)((local == ((void*)0)) ? ((void*)0) : (local = (bala_code_node_unref (local), ((void*)0)))); |
| 22778 | } |
| 22779 | _tmp17_ = bala_ccode_base_module_get_current_method (self); |
| 22780 | _tmp18_ = _tmp17_; |
| 22781 | if (_tmp18_ != NULL((void*)0)) { |
| 22782 | BalaMethod* _tmp19_; |
| 22783 | BalaMethod* _tmp20_; |
| 22784 | _tmp19_ = bala_ccode_base_module_get_current_method (self); |
| 22785 | _tmp20_ = _tmp19_; |
| 22786 | _tmp16_ = bala_get_ccode_array_length ((BalaCodeNode*) _tmp20_); |
| 22787 | } else { |
| 22788 | _tmp16_ = FALSE(0); |
| 22789 | } |
| 22790 | if (_tmp16_) { |
| 22791 | _tmp15_ = TRUE(!(0)); |
| 22792 | } else { |
| 22793 | gboolean _tmp21_ = FALSE(0); |
| 22794 | BalaPropertyAccessor* _tmp22_; |
| 22795 | BalaPropertyAccessor* _tmp23_; |
| 22796 | _tmp22_ = bala_ccode_base_module_get_current_property_accessor (self); |
| 22797 | _tmp23_ = _tmp22_; |
| 22798 | if (_tmp23_ != NULL((void*)0)) { |
| 22799 | BalaPropertyAccessor* _tmp24_; |
| 22800 | BalaPropertyAccessor* _tmp25_; |
| 22801 | _tmp24_ = bala_ccode_base_module_get_current_property_accessor (self); |
| 22802 | _tmp25_ = _tmp24_; |
| 22803 | _tmp21_ = bala_get_ccode_array_length ((BalaCodeNode*) _tmp25_); |
| 22804 | } else { |
| 22805 | _tmp21_ = FALSE(0); |
| 22806 | } |
| 22807 | _tmp15_ = _tmp21_; |
| 22808 | } |
| 22809 | if (_tmp15_) { |
| 22810 | BalaDataType* _tmp26_; |
| 22811 | BalaDataType* _tmp27_; |
| 22812 | _tmp26_ = bala_ccode_base_module_get_current_return_type (self); |
| 22813 | _tmp27_ = _tmp26_; |
| 22814 | _tmp14_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp27_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp27_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 22815 | } else { |
| 22816 | _tmp14_ = FALSE(0); |
| 22817 | } |
| 22818 | if (_tmp14_) { |
| 22819 | BalaTargetValue* temp_value = NULL((void*)0); |
| 22820 | BalaExpression* _tmp28_; |
| 22821 | BalaExpression* _tmp29_; |
| 22822 | BalaTargetValue* _tmp30_; |
| 22823 | BalaTargetValue* _tmp31_; |
| 22824 | BalaTargetValue* _tmp32_; |
| 22825 | BalaArrayType* array_type = NULL((void*)0); |
| 22826 | BalaDataType* _tmp33_; |
| 22827 | BalaDataType* _tmp34_; |
| 22828 | BalaArrayType* _tmp35_; |
| 22829 | BalaExpression* _tmp62_; |
| 22830 | BalaExpression* _tmp63_; |
| 22831 | BalaTargetValue* _tmp64_; |
| 22832 | _tmp28_ = bala_return_statement_get_return_expression (stmt); |
| 22833 | _tmp29_ = _tmp28_; |
| 22834 | _tmp30_ = bala_expression_get_target_value (_tmp29_); |
| 22835 | _tmp31_ = _tmp30_; |
| 22836 | _tmp32_ = bala_ccode_base_module_store_temp_value (self, _tmp31_, (BalaCodeNode*) stmt, NULL((void*)0)); |
| 22837 | temp_value = _tmp32_; |
| 22838 | _tmp33_ = bala_ccode_base_module_get_current_return_type (self); |
| 22839 | _tmp34_ = _tmp33_; |
| 22840 | _tmp35_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp34_), ((bala_array_type_get_type ())))))); |
| 22841 | array_type = _tmp35_; |
| 22842 | { |
| 22843 | gint dim = 0; |
| 22844 | dim = 1; |
| 22845 | { |
| 22846 | gboolean _tmp36_ = FALSE(0); |
| 22847 | _tmp36_ = TRUE(!(0)); |
| 22848 | while (TRUE(!(0))) { |
| 22849 | BalaArrayType* _tmp38_; |
| 22850 | gint _tmp39_; |
| 22851 | gint _tmp40_; |
| 22852 | BalaCCodeExpression* len_l = NULL((void*)0); |
| 22853 | gchar* _tmp41_; |
| 22854 | gchar* _tmp42_; |
| 22855 | BalaCCodeExpression* _tmp43_; |
| 22856 | BalaCCodeExpression* _tmp44_; |
| 22857 | BalaCCodeExpression* len_r = NULL((void*)0); |
| 22858 | BalaTargetValue* _tmp45_; |
| 22859 | BalaCCodeExpression* _tmp46_; |
| 22860 | if (!_tmp36_) { |
| 22861 | gint _tmp37_; |
| 22862 | _tmp37_ = dim; |
| 22863 | dim = _tmp37_ + 1; |
| 22864 | } |
| 22865 | _tmp36_ = FALSE(0); |
| 22866 | _tmp38_ = array_type; |
| 22867 | _tmp39_ = bala_array_type_get_rank (_tmp38_); |
| 22868 | _tmp40_ = _tmp39_; |
| 22869 | if (!(dim <= _tmp40_)) { |
| 22870 | break; |
| 22871 | } |
| 22872 | _tmp41_ = bala_ccode_base_module_get_array_length_cname (self, "result", dim); |
| 22873 | _tmp42_ = _tmp41_; |
| 22874 | _tmp43_ = bala_ccode_base_module_get_cexpression (self, _tmp42_); |
| 22875 | _tmp44_ = _tmp43_; |
| 22876 | _g_free0 (_tmp42_)(_tmp42_ = (g_free (_tmp42_), ((void*)0))); |
| 22877 | len_l = _tmp44_; |
| 22878 | _tmp45_ = temp_value; |
| 22879 | _tmp46_ = bala_ccode_base_module_get_array_length_cvalue (self, _tmp45_, dim); |
| 22880 | len_r = _tmp46_; |
| 22881 | if (!bala_ccode_base_module_is_in_coroutine (self)) { |
| 22882 | BalaCCodeFunction* _tmp47_; |
| 22883 | BalaCCodeFunction* _tmp48_; |
| 22884 | BalaCCodeExpression* _tmp49_; |
| 22885 | BalaCCodeExpression* _tmp50_; |
| 22886 | BalaCCodeUnaryExpression* _tmp51_; |
| 22887 | BalaCCodeFunction* _tmp52_; |
| 22888 | BalaCCodeFunction* _tmp53_; |
| 22889 | BalaCCodeExpression* _tmp54_; |
| 22890 | BalaCCodeExpression* _tmp55_; |
| 22891 | BalaCCodeFunction* _tmp56_; |
| 22892 | BalaCCodeFunction* _tmp57_; |
| 22893 | _tmp47_ = bala_ccode_base_module_get_ccode (self); |
| 22894 | _tmp48_ = _tmp47_; |
| 22895 | _tmp49_ = len_l; |
| 22896 | bala_ccode_function_open_if (_tmp48_, _tmp49_); |
| 22897 | _tmp50_ = len_l; |
| 22898 | _tmp51_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp50_); |
| 22899 | _bala_ccode_node_unref0 (len_l)((len_l == ((void*)0)) ? ((void*)0) : (len_l = (bala_ccode_node_unref (len_l), ((void*)0)))); |
| 22900 | len_l = (BalaCCodeExpression*) _tmp51_; |
| 22901 | _tmp52_ = bala_ccode_base_module_get_ccode (self); |
| 22902 | _tmp53_ = _tmp52_; |
| 22903 | _tmp54_ = len_l; |
| 22904 | _tmp55_ = len_r; |
| 22905 | bala_ccode_function_add_assignment (_tmp53_, _tmp54_, _tmp55_); |
| 22906 | _tmp56_ = bala_ccode_base_module_get_ccode (self); |
| 22907 | _tmp57_ = _tmp56_; |
| 22908 | bala_ccode_function_close (_tmp57_); |
| 22909 | } else { |
| 22910 | BalaCCodeFunction* _tmp58_; |
| 22911 | BalaCCodeFunction* _tmp59_; |
| 22912 | BalaCCodeExpression* _tmp60_; |
| 22913 | BalaCCodeExpression* _tmp61_; |
| 22914 | _tmp58_ = bala_ccode_base_module_get_ccode (self); |
| 22915 | _tmp59_ = _tmp58_; |
| 22916 | _tmp60_ = len_l; |
| 22917 | _tmp61_ = len_r; |
| 22918 | bala_ccode_function_add_assignment (_tmp59_, _tmp60_, _tmp61_); |
| 22919 | } |
| 22920 | _bala_ccode_node_unref0 (len_r)((len_r == ((void*)0)) ? ((void*)0) : (len_r = (bala_ccode_node_unref (len_r), ((void*)0)))); |
| 22921 | _bala_ccode_node_unref0 (len_l)((len_l == ((void*)0)) ? ((void*)0) : (len_l = (bala_ccode_node_unref (len_l), ((void*)0)))); |
| 22922 | } |
| 22923 | } |
| 22924 | } |
| 22925 | _tmp62_ = bala_return_statement_get_return_expression (stmt); |
| 22926 | _tmp63_ = _tmp62_; |
| 22927 | _tmp64_ = temp_value; |
| 22928 | bala_expression_set_target_value (_tmp63_, _tmp64_); |
| 22929 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 22930 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 22931 | } else { |
| 22932 | gboolean _tmp65_ = FALSE(0); |
| 22933 | gboolean _tmp66_ = FALSE(0); |
| 22934 | gboolean _tmp67_ = FALSE(0); |
| 22935 | BalaMethod* _tmp68_; |
| 22936 | BalaMethod* _tmp69_; |
| 22937 | _tmp68_ = bala_ccode_base_module_get_current_method (self); |
| 22938 | _tmp69_ = _tmp68_; |
| 22939 | if (_tmp69_ != NULL((void*)0)) { |
| 22940 | BalaMethod* _tmp70_; |
| 22941 | BalaMethod* _tmp71_; |
| 22942 | _tmp70_ = bala_ccode_base_module_get_current_method (self); |
| 22943 | _tmp71_ = _tmp70_; |
| 22944 | _tmp67_ = bala_get_ccode_delegate_target ((BalaCodeNode*) _tmp71_); |
| 22945 | } else { |
| 22946 | _tmp67_ = FALSE(0); |
| 22947 | } |
| 22948 | if (_tmp67_) { |
| 22949 | _tmp66_ = TRUE(!(0)); |
| 22950 | } else { |
| 22951 | gboolean _tmp72_ = FALSE(0); |
| 22952 | BalaPropertyAccessor* _tmp73_; |
| 22953 | BalaPropertyAccessor* _tmp74_; |
| 22954 | _tmp73_ = bala_ccode_base_module_get_current_property_accessor (self); |
| 22955 | _tmp74_ = _tmp73_; |
| 22956 | if (_tmp74_ != NULL((void*)0)) { |
| 22957 | BalaPropertyAccessor* _tmp75_; |
| 22958 | BalaPropertyAccessor* _tmp76_; |
| 22959 | _tmp75_ = bala_ccode_base_module_get_current_property_accessor (self); |
| 22960 | _tmp76_ = _tmp75_; |
| 22961 | _tmp72_ = bala_get_ccode_delegate_target ((BalaCodeNode*) _tmp76_); |
| 22962 | } else { |
| 22963 | _tmp72_ = FALSE(0); |
| 22964 | } |
| 22965 | _tmp66_ = _tmp72_; |
| 22966 | } |
| 22967 | if (_tmp66_) { |
| 22968 | BalaDataType* _tmp77_; |
| 22969 | BalaDataType* _tmp78_; |
| 22970 | _tmp77_ = bala_ccode_base_module_get_current_return_type (self); |
| 22971 | _tmp78_ = _tmp77_; |
| 22972 | _tmp65_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp78_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp78_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 22973 | } else { |
| 22974 | _tmp65_ = FALSE(0); |
| 22975 | } |
| 22976 | if (_tmp65_) { |
| 22977 | BalaDelegateType* delegate_type = NULL((void*)0); |
| 22978 | BalaDataType* _tmp79_; |
| 22979 | BalaDataType* _tmp80_; |
| 22980 | BalaDelegateType* _tmp81_; |
| 22981 | BalaDelegateType* _tmp82_; |
| 22982 | BalaDelegate* _tmp83_; |
| 22983 | BalaDelegate* _tmp84_; |
| 22984 | gboolean _tmp85_; |
| 22985 | gboolean _tmp86_; |
| 22986 | _tmp79_ = bala_ccode_base_module_get_current_return_type (self); |
| 22987 | _tmp80_ = _tmp79_; |
| 22988 | _tmp81_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp80_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp80_), ((bala_delegate_type_get_type ())))))); |
| 22989 | delegate_type = _tmp81_; |
| 22990 | _tmp82_ = delegate_type; |
| 22991 | _tmp83_ = bala_delegate_type_get_delegate_symbol (_tmp82_); |
| 22992 | _tmp84_ = _tmp83_; |
| 22993 | _tmp85_ = bala_delegate_get_has_target (_tmp84_); |
| 22994 | _tmp86_ = _tmp85_; |
| 22995 | if (_tmp86_) { |
| 22996 | BalaTargetValue* temp_value = NULL((void*)0); |
| 22997 | BalaExpression* _tmp87_; |
| 22998 | BalaExpression* _tmp88_; |
| 22999 | BalaTargetValue* _tmp89_; |
| 23000 | BalaTargetValue* _tmp90_; |
| 23001 | BalaTargetValue* _tmp91_; |
| 23002 | BalaCCodeExpression* target_l = NULL((void*)0); |
| 23003 | gchar* _tmp92_; |
| 23004 | gchar* _tmp93_; |
| 23005 | BalaCCodeExpression* _tmp94_; |
| 23006 | BalaCCodeExpression* _tmp95_; |
| 23007 | BalaCCodeExpression* target_r = NULL((void*)0); |
| 23008 | BalaTargetValue* _tmp98_; |
| 23009 | BalaCCodeExpression* _tmp99_; |
| 23010 | BalaCCodeFunction* _tmp100_; |
| 23011 | BalaCCodeFunction* _tmp101_; |
| 23012 | BalaCCodeExpression* _tmp102_; |
| 23013 | BalaCCodeExpression* _tmp103_; |
| 23014 | BalaDelegateType* _tmp104_; |
| 23015 | BalaExpression* _tmp117_; |
| 23016 | BalaExpression* _tmp118_; |
| 23017 | BalaTargetValue* _tmp119_; |
| 23018 | _tmp87_ = bala_return_statement_get_return_expression (stmt); |
| 23019 | _tmp88_ = _tmp87_; |
| 23020 | _tmp89_ = bala_expression_get_target_value (_tmp88_); |
| 23021 | _tmp90_ = _tmp89_; |
| 23022 | _tmp91_ = bala_ccode_base_module_store_temp_value (self, _tmp90_, (BalaCodeNode*) stmt, NULL((void*)0)); |
| 23023 | temp_value = _tmp91_; |
| 23024 | _tmp92_ = bala_ccode_base_module_get_delegate_target_cname (self, "result"); |
| 23025 | _tmp93_ = _tmp92_; |
| 23026 | _tmp94_ = bala_ccode_base_module_get_cexpression (self, _tmp93_); |
| 23027 | _tmp95_ = _tmp94_; |
| 23028 | _g_free0 (_tmp93_)(_tmp93_ = (g_free (_tmp93_), ((void*)0))); |
| 23029 | target_l = _tmp95_; |
| 23030 | if (!bala_ccode_base_module_is_in_coroutine (self)) { |
| 23031 | BalaCCodeExpression* _tmp96_; |
| 23032 | BalaCCodeUnaryExpression* _tmp97_; |
| 23033 | _tmp96_ = target_l; |
| 23034 | _tmp97_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp96_); |
| 23035 | _bala_ccode_node_unref0 (target_l)((target_l == ((void*)0)) ? ((void*)0) : (target_l = (bala_ccode_node_unref (target_l), ((void*)0)))); |
| 23036 | target_l = (BalaCCodeExpression*) _tmp97_; |
| 23037 | } |
| 23038 | _tmp98_ = temp_value; |
| 23039 | _tmp99_ = bala_ccode_base_module_get_delegate_target_cvalue (self, _tmp98_); |
| 23040 | target_r = _tmp99_; |
| 23041 | _tmp100_ = bala_ccode_base_module_get_ccode (self); |
| 23042 | _tmp101_ = _tmp100_; |
| 23043 | _tmp102_ = target_l; |
| 23044 | _tmp103_ = target_r; |
| 23045 | bala_ccode_function_add_assignment (_tmp101_, _tmp102_, _tmp103_); |
| 23046 | _tmp104_ = delegate_type; |
| 23047 | if (bala_data_type_is_disposable ((BalaDataType*) _tmp104_)) { |
| 23048 | BalaCCodeExpression* target_l_destroy_notify = NULL((void*)0); |
| 23049 | gchar* _tmp105_; |
| 23050 | gchar* _tmp106_; |
| 23051 | BalaCCodeExpression* _tmp107_; |
| 23052 | BalaCCodeExpression* _tmp108_; |
| 23053 | BalaCCodeExpression* target_r_destroy_notify = NULL((void*)0); |
| 23054 | BalaTargetValue* _tmp111_; |
| 23055 | BalaCCodeExpression* _tmp112_; |
| 23056 | BalaCCodeFunction* _tmp113_; |
| 23057 | BalaCCodeFunction* _tmp114_; |
| 23058 | BalaCCodeExpression* _tmp115_; |
| 23059 | BalaCCodeExpression* _tmp116_; |
| 23060 | _tmp105_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cname (self, "result"); |
| 23061 | _tmp106_ = _tmp105_; |
| 23062 | _tmp107_ = bala_ccode_base_module_get_cexpression (self, _tmp106_); |
| 23063 | _tmp108_ = _tmp107_; |
| 23064 | _g_free0 (_tmp106_)(_tmp106_ = (g_free (_tmp106_), ((void*)0))); |
| 23065 | target_l_destroy_notify = _tmp108_; |
| 23066 | if (!bala_ccode_base_module_is_in_coroutine (self)) { |
| 23067 | BalaCCodeExpression* _tmp109_; |
| 23068 | BalaCCodeUnaryExpression* _tmp110_; |
| 23069 | _tmp109_ = target_l_destroy_notify; |
| 23070 | _tmp110_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp109_); |
| 23071 | _bala_ccode_node_unref0 (target_l_destroy_notify)((target_l_destroy_notify == ((void*)0)) ? ((void*)0) : (target_l_destroy_notify = (bala_ccode_node_unref (target_l_destroy_notify), ((void*) 0)))); |
| 23072 | target_l_destroy_notify = (BalaCCodeExpression*) _tmp110_; |
| 23073 | } |
| 23074 | _tmp111_ = temp_value; |
| 23075 | _tmp112_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cvalue (self, _tmp111_); |
| 23076 | target_r_destroy_notify = _tmp112_; |
| 23077 | _tmp113_ = bala_ccode_base_module_get_ccode (self); |
| 23078 | _tmp114_ = _tmp113_; |
| 23079 | _tmp115_ = target_l_destroy_notify; |
| 23080 | _tmp116_ = target_r_destroy_notify; |
| 23081 | bala_ccode_function_add_assignment (_tmp114_, _tmp115_, _tmp116_); |
| 23082 | _bala_ccode_node_unref0 (target_r_destroy_notify)((target_r_destroy_notify == ((void*)0)) ? ((void*)0) : (target_r_destroy_notify = (bala_ccode_node_unref (target_r_destroy_notify), ((void*) 0)))); |
| 23083 | _bala_ccode_node_unref0 (target_l_destroy_notify)((target_l_destroy_notify == ((void*)0)) ? ((void*)0) : (target_l_destroy_notify = (bala_ccode_node_unref (target_l_destroy_notify), ((void*) 0)))); |
| 23084 | } |
| 23085 | _tmp117_ = bala_return_statement_get_return_expression (stmt); |
| 23086 | _tmp118_ = _tmp117_; |
| 23087 | _tmp119_ = temp_value; |
| 23088 | bala_expression_set_target_value (_tmp118_, _tmp119_); |
| 23089 | _bala_ccode_node_unref0 (target_r)((target_r == ((void*)0)) ? ((void*)0) : (target_r = (bala_ccode_node_unref (target_r), ((void*)0)))); |
| 23090 | _bala_ccode_node_unref0 (target_l)((target_l == ((void*)0)) ? ((void*)0) : (target_l = (bala_ccode_node_unref (target_l), ((void*)0)))); |
| 23091 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 23092 | } |
| 23093 | _bala_code_node_unref0 (delegate_type)((delegate_type == ((void*)0)) ? ((void*)0) : (delegate_type = (bala_code_node_unref (delegate_type), ((void*)0)))); |
| 23094 | } |
| 23095 | } |
| 23096 | _tmp120_ = bala_return_statement_get_return_expression (stmt); |
| 23097 | _tmp121_ = _tmp120_; |
| 23098 | if (_tmp121_ != NULL((void*)0)) { |
| 23099 | BalaCCodeExpression* result_lhs = NULL((void*)0); |
| 23100 | BalaCCodeExpression* _tmp122_; |
| 23101 | gboolean _tmp123_ = FALSE(0); |
| 23102 | BalaDataType* _tmp124_; |
| 23103 | BalaDataType* _tmp125_; |
| 23104 | BalaCCodeFunction* _tmp128_; |
| 23105 | BalaCCodeFunction* _tmp129_; |
| 23106 | BalaCCodeExpression* _tmp130_; |
| 23107 | BalaExpression* _tmp131_; |
| 23108 | BalaExpression* _tmp132_; |
| 23109 | BalaCCodeExpression* _tmp133_; |
| 23110 | _tmp122_ = bala_ccode_base_module_get_cexpression (self, "result"); |
| 23111 | result_lhs = _tmp122_; |
| 23112 | _tmp124_ = bala_ccode_base_module_get_current_return_type (self); |
| 23113 | _tmp125_ = _tmp124_; |
| 23114 | if (bala_data_type_is_real_non_null_struct_type (_tmp125_)) { |
| 23115 | _tmp123_ = !bala_ccode_base_module_is_in_coroutine (self); |
| 23116 | } else { |
| 23117 | _tmp123_ = FALSE(0); |
| 23118 | } |
| 23119 | if (_tmp123_) { |
| 23120 | BalaCCodeExpression* _tmp126_; |
| 23121 | BalaCCodeUnaryExpression* _tmp127_; |
| 23122 | _tmp126_ = result_lhs; |
| 23123 | _tmp127_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp126_); |
| 23124 | _bala_ccode_node_unref0 (result_lhs)((result_lhs == ((void*)0)) ? ((void*)0) : (result_lhs = (bala_ccode_node_unref (result_lhs), ((void*)0)))); |
| 23125 | result_lhs = (BalaCCodeExpression*) _tmp127_; |
| 23126 | } |
| 23127 | _tmp128_ = bala_ccode_base_module_get_ccode (self); |
| 23128 | _tmp129_ = _tmp128_; |
| 23129 | _tmp130_ = result_lhs; |
| 23130 | _tmp131_ = bala_return_statement_get_return_expression (stmt); |
| 23131 | _tmp132_ = _tmp131_; |
| 23132 | _tmp133_ = bala_get_cvalue (_tmp132_); |
| 23133 | bala_ccode_function_add_assignment (_tmp129_, _tmp130_, _tmp133_); |
| 23134 | _bala_ccode_node_unref0 (result_lhs)((result_lhs == ((void*)0)) ? ((void*)0) : (result_lhs = (bala_ccode_node_unref (result_lhs), ((void*)0)))); |
| 23135 | } |
| 23136 | _tmp134_ = bala_ccode_base_module_get_current_method (self); |
| 23137 | _tmp135_ = _tmp134_; |
| 23138 | if (_tmp135_ != NULL((void*)0)) { |
| 23139 | { |
| 23140 | BalaList* _postcondition_list = NULL((void*)0); |
| 23141 | BalaMethod* _tmp136_; |
| 23142 | BalaMethod* _tmp137_; |
| 23143 | BalaList* _tmp138_; |
| 23144 | BalaList* _tmp139_; |
| 23145 | gint _postcondition_size = 0; |
| 23146 | BalaList* _tmp140_; |
| 23147 | gint _tmp141_; |
| 23148 | gint _tmp142_; |
| 23149 | gint _postcondition_index = 0; |
| 23150 | _tmp136_ = bala_ccode_base_module_get_current_method (self); |
| 23151 | _tmp137_ = _tmp136_; |
| 23152 | _tmp138_ = bala_method_get_postconditions (_tmp137_); |
| 23153 | _tmp139_ = _bala_iterable_ref0 (_tmp138_); |
| 23154 | _postcondition_list = _tmp139_; |
| 23155 | _tmp140_ = _postcondition_list; |
| 23156 | _tmp141_ = bala_collection_get_size ((BalaCollection*) _tmp140_); |
| 23157 | _tmp142_ = _tmp141_; |
| 23158 | _postcondition_size = _tmp142_; |
| 23159 | _postcondition_index = -1; |
| 23160 | while (TRUE(!(0))) { |
| 23161 | gint _tmp143_; |
| 23162 | gint _tmp144_; |
| 23163 | BalaExpression* postcondition = NULL((void*)0); |
| 23164 | BalaList* _tmp145_; |
| 23165 | gpointer _tmp146_; |
| 23166 | BalaExpression* _tmp147_; |
| 23167 | _postcondition_index = _postcondition_index + 1; |
| 23168 | _tmp143_ = _postcondition_index; |
| 23169 | _tmp144_ = _postcondition_size; |
| 23170 | if (!(_tmp143_ < _tmp144_)) { |
| 23171 | break; |
| 23172 | } |
| 23173 | _tmp145_ = _postcondition_list; |
| 23174 | _tmp146_ = bala_list_get (_tmp145_, _postcondition_index); |
| 23175 | postcondition = (BalaExpression*) _tmp146_; |
| 23176 | _tmp147_ = postcondition; |
| 23177 | bala_ccode_base_module_create_postcondition_statement (self, _tmp147_); |
| 23178 | _bala_code_node_unref0 (postcondition)((postcondition == ((void*)0)) ? ((void*)0) : (postcondition = (bala_code_node_unref (postcondition), ((void*)0)))); |
| 23179 | } |
| 23180 | _bala_iterable_unref0 (_postcondition_list)((_postcondition_list == ((void*)0)) ? ((void*)0) : (_postcondition_list = (bala_iterable_unref (_postcondition_list), ((void*)0)))); |
| 23181 | } |
| 23182 | } |
| 23183 | _tmp148_ = bala_ccode_base_module_get_current_symbol (self); |
| 23184 | _tmp149_ = _tmp148_; |
| 23185 | bala_ccode_base_module_append_local_free (self, _tmp149_, NULL((void*)0), NULL((void*)0)); |
| 23186 | _tmp151_ = bala_ccode_base_module_get_current_method (self); |
| 23187 | _tmp152_ = _tmp151_; |
| 23188 | if (_tmp152_ != NULL((void*)0)) { |
| 23189 | BalaMethod* _tmp153_; |
| 23190 | BalaMethod* _tmp154_; |
| 23191 | gboolean _tmp155_; |
| 23192 | gboolean _tmp156_; |
| 23193 | _tmp153_ = bala_ccode_base_module_get_current_method (self); |
| 23194 | _tmp154_ = _tmp153_; |
| 23195 | _tmp155_ = bala_method_get_coroutine (_tmp154_); |
| 23196 | _tmp156_ = _tmp155_; |
| 23197 | _tmp150_ = !_tmp156_; |
| 23198 | } else { |
| 23199 | _tmp150_ = FALSE(0); |
| 23200 | } |
| 23201 | if (_tmp150_) { |
| 23202 | { |
| 23203 | BalaList* _param_list = NULL((void*)0); |
| 23204 | BalaMethod* _tmp157_; |
| 23205 | BalaMethod* _tmp158_; |
| 23206 | BalaList* _tmp159_; |
| 23207 | BalaList* _tmp160_; |
| 23208 | gint _param_size = 0; |
| 23209 | BalaList* _tmp161_; |
| 23210 | gint _tmp162_; |
| 23211 | gint _tmp163_; |
| 23212 | gint _param_index = 0; |
| 23213 | _tmp157_ = bala_ccode_base_module_get_current_method (self); |
| 23214 | _tmp158_ = _tmp157_; |
| 23215 | _tmp159_ = bala_callable_get_parameters ((BalaCallable*) _tmp158_); |
| 23216 | _tmp160_ = _bala_iterable_ref0 (_tmp159_); |
| 23217 | _param_list = _tmp160_; |
| 23218 | _tmp161_ = _param_list; |
| 23219 | _tmp162_ = bala_collection_get_size ((BalaCollection*) _tmp161_); |
| 23220 | _tmp163_ = _tmp162_; |
| 23221 | _param_size = _tmp163_; |
| 23222 | _param_index = -1; |
| 23223 | while (TRUE(!(0))) { |
| 23224 | gint _tmp164_; |
| 23225 | gint _tmp165_; |
| 23226 | BalaParameter* param = NULL((void*)0); |
| 23227 | BalaList* _tmp166_; |
| 23228 | gpointer _tmp167_; |
| 23229 | BalaParameter* _tmp168_; |
| 23230 | BalaParameterDirection _tmp169_; |
| 23231 | BalaParameterDirection _tmp170_; |
| 23232 | BalaParameter* _tmp171_; |
| 23233 | _param_index = _param_index + 1; |
| 23234 | _tmp164_ = _param_index; |
| 23235 | _tmp165_ = _param_size; |
| 23236 | if (!(_tmp164_ < _tmp165_)) { |
| 23237 | break; |
| 23238 | } |
| 23239 | _tmp166_ = _param_list; |
| 23240 | _tmp167_ = bala_list_get (_tmp166_, _param_index); |
| 23241 | param = (BalaParameter*) _tmp167_; |
| 23242 | _tmp168_ = param; |
| 23243 | _tmp169_ = bala_parameter_get_direction (_tmp168_); |
| 23244 | _tmp170_ = _tmp169_; |
| 23245 | if (_tmp170_ != BALA_PARAMETER_DIRECTION_OUT) { |
| 23246 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 23247 | continue; |
| 23248 | } |
| 23249 | _tmp171_ = param; |
| 23250 | bala_ccode_base_module_return_out_parameter (self, _tmp171_); |
| 23251 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 23252 | } |
| 23253 | _bala_iterable_unref0 (_param_list)((_param_list == ((void*)0)) ? ((void*)0) : (_param_list = (bala_iterable_unref (_param_list), ((void*)0)))); |
| 23254 | } |
| 23255 | } |
| 23256 | _tmp173_ = bala_ccode_base_module_get_current_method (self); |
| 23257 | _tmp174_ = _tmp173_; |
| 23258 | if (_tmp174_ != NULL((void*)0)) { |
| 23259 | BalaMethod* _tmp175_; |
| 23260 | BalaMethod* _tmp176_; |
| 23261 | BalaAttribute* _tmp177_; |
| 23262 | _tmp175_ = bala_ccode_base_module_get_current_method (self); |
| 23263 | _tmp176_ = _tmp175_; |
| 23264 | _tmp177_ = bala_code_node_get_attribute ((BalaCodeNode*) _tmp176_, "Profile"); |
| 23265 | _tmp172_ = _tmp177_ != NULL((void*)0); |
| 23266 | } else { |
| 23267 | _tmp172_ = FALSE(0); |
| 23268 | } |
| 23269 | if (_tmp172_) { |
| 23270 | gchar* prefix = NULL((void*)0); |
| 23271 | BalaMethod* _tmp178_; |
| 23272 | BalaMethod* _tmp179_; |
| 23273 | gchar* _tmp180_; |
| 23274 | gchar* _tmp181_; |
| 23275 | gchar* _tmp182_; |
| 23276 | gchar* _tmp183_; |
| 23277 | BalaCCodeIdentifier* level = NULL((void*)0); |
| 23278 | const gchar* _tmp184_; |
| 23279 | gchar* _tmp185_; |
| 23280 | gchar* _tmp186_; |
| 23281 | BalaCCodeIdentifier* _tmp187_; |
| 23282 | BalaCCodeIdentifier* _tmp188_; |
| 23283 | BalaCCodeFunction* _tmp189_; |
| 23284 | BalaCCodeFunction* _tmp190_; |
| 23285 | BalaCCodeIdentifier* _tmp191_; |
| 23286 | BalaCCodeUnaryExpression* _tmp192_; |
| 23287 | BalaCCodeUnaryExpression* _tmp193_; |
| 23288 | BalaCCodeUnaryExpression* _tmp194_; |
| 23289 | BalaCCodeUnaryExpression* _tmp195_; |
| 23290 | BalaCCodeIdentifier* timer = NULL((void*)0); |
| 23291 | const gchar* _tmp196_; |
| 23292 | gchar* _tmp197_; |
| 23293 | gchar* _tmp198_; |
| 23294 | BalaCCodeIdentifier* _tmp199_; |
| 23295 | BalaCCodeIdentifier* _tmp200_; |
| 23296 | BalaCCodeFunctionCall* stop_call = NULL((void*)0); |
| 23297 | BalaCCodeIdentifier* _tmp201_; |
| 23298 | BalaCCodeIdentifier* _tmp202_; |
| 23299 | BalaCCodeFunctionCall* _tmp203_; |
| 23300 | BalaCCodeFunctionCall* _tmp204_; |
| 23301 | BalaCCodeFunctionCall* _tmp205_; |
| 23302 | BalaCCodeIdentifier* _tmp206_; |
| 23303 | BalaCCodeFunction* _tmp207_; |
| 23304 | BalaCCodeFunction* _tmp208_; |
| 23305 | BalaCCodeFunctionCall* _tmp209_; |
| 23306 | BalaCCodeFunction* _tmp210_; |
| 23307 | BalaCCodeFunction* _tmp211_; |
| 23308 | _tmp178_ = bala_ccode_base_module_get_current_method (self); |
| 23309 | _tmp179_ = _tmp178_; |
| 23310 | _tmp180_ = bala_get_ccode_real_name ((BalaSymbol*) _tmp179_); |
| 23311 | _tmp181_ = _tmp180_; |
| 23312 | _tmp182_ = g_strdup_printf ("_bala_prof_%s", _tmp181_); |
| 23313 | _tmp183_ = _tmp182_; |
| 23314 | _g_free0 (_tmp181_)(_tmp181_ = (g_free (_tmp181_), ((void*)0))); |
| 23315 | prefix = _tmp183_; |
| 23316 | _tmp184_ = prefix; |
| 23317 | _tmp185_ = g_strconcat (_tmp184_, "_level", NULL((void*)0)); |
| 23318 | _tmp186_ = _tmp185_; |
| 23319 | _tmp187_ = bala_ccode_identifier_new (_tmp186_); |
| 23320 | _tmp188_ = _tmp187_; |
| 23321 | _g_free0 (_tmp186_)(_tmp186_ = (g_free (_tmp186_), ((void*)0))); |
| 23322 | level = _tmp188_; |
| 23323 | _tmp189_ = bala_ccode_base_module_get_ccode (self); |
| 23324 | _tmp190_ = _tmp189_; |
| 23325 | _tmp191_ = level; |
| 23326 | _tmp192_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_PREFIX_DECREMENT, (BalaCCodeExpression*) _tmp191_); |
| 23327 | _tmp193_ = _tmp192_; |
| 23328 | _tmp194_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_LOGICAL_NEGATION, (BalaCCodeExpression*) _tmp193_); |
| 23329 | _tmp195_ = _tmp194_; |
| 23330 | bala_ccode_function_open_if (_tmp190_, (BalaCCodeExpression*) _tmp195_); |
| 23331 | _bala_ccode_node_unref0 (_tmp195_)((_tmp195_ == ((void*)0)) ? ((void*)0) : (_tmp195_ = (bala_ccode_node_unref (_tmp195_), ((void*)0)))); |
| 23332 | _bala_ccode_node_unref0 (_tmp193_)((_tmp193_ == ((void*)0)) ? ((void*)0) : (_tmp193_ = (bala_ccode_node_unref (_tmp193_), ((void*)0)))); |
| 23333 | _tmp196_ = prefix; |
| 23334 | _tmp197_ = g_strconcat (_tmp196_, "_timer", NULL((void*)0)); |
| 23335 | _tmp198_ = _tmp197_; |
| 23336 | _tmp199_ = bala_ccode_identifier_new (_tmp198_); |
| 23337 | _tmp200_ = _tmp199_; |
| 23338 | _g_free0 (_tmp198_)(_tmp198_ = (g_free (_tmp198_), ((void*)0))); |
| 23339 | timer = _tmp200_; |
| 23340 | _tmp201_ = bala_ccode_identifier_new ("g_timer_stop"); |
| 23341 | _tmp202_ = _tmp201_; |
| 23342 | _tmp203_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp202_); |
| 23343 | _tmp204_ = _tmp203_; |
| 23344 | _bala_ccode_node_unref0 (_tmp202_)((_tmp202_ == ((void*)0)) ? ((void*)0) : (_tmp202_ = (bala_ccode_node_unref (_tmp202_), ((void*)0)))); |
| 23345 | stop_call = _tmp204_; |
| 23346 | _tmp205_ = stop_call; |
| 23347 | _tmp206_ = timer; |
| 23348 | bala_ccode_function_call_add_argument (_tmp205_, (BalaCCodeExpression*) _tmp206_); |
| 23349 | _tmp207_ = bala_ccode_base_module_get_ccode (self); |
| 23350 | _tmp208_ = _tmp207_; |
| 23351 | _tmp209_ = stop_call; |
| 23352 | bala_ccode_function_add_expression (_tmp208_, (BalaCCodeExpression*) _tmp209_); |
| 23353 | _tmp210_ = bala_ccode_base_module_get_ccode (self); |
| 23354 | _tmp211_ = _tmp210_; |
| 23355 | bala_ccode_function_close (_tmp211_); |
| 23356 | _bala_ccode_node_unref0 (stop_call)((stop_call == ((void*)0)) ? ((void*)0) : (stop_call = (bala_ccode_node_unref (stop_call), ((void*)0)))); |
| 23357 | _bala_ccode_node_unref0 (timer)((timer == ((void*)0)) ? ((void*)0) : (timer = (bala_ccode_node_unref (timer), ((void*)0)))); |
| 23358 | _bala_ccode_node_unref0 (level)((level == ((void*)0)) ? ((void*)0) : (level = (bala_ccode_node_unref (level), ((void*)0)))); |
| 23359 | _g_free0 (prefix)(prefix = (g_free (prefix), ((void*)0))); |
| 23360 | } |
| 23361 | if (bala_ccode_base_module_is_in_constructor (self)) { |
| 23362 | BalaCCodeFunction* _tmp212_; |
| 23363 | BalaCCodeFunction* _tmp213_; |
| 23364 | BalaCCodeIdentifier* _tmp214_; |
| 23365 | BalaCCodeIdentifier* _tmp215_; |
| 23366 | _tmp212_ = bala_ccode_base_module_get_ccode (self); |
| 23367 | _tmp213_ = _tmp212_; |
| 23368 | _tmp214_ = bala_ccode_identifier_new ("obj"); |
| 23369 | _tmp215_ = _tmp214_; |
| 23370 | bala_ccode_function_add_return (_tmp213_, (BalaCCodeExpression*) _tmp215_); |
| 23371 | _bala_ccode_node_unref0 (_tmp215_)((_tmp215_ == ((void*)0)) ? ((void*)0) : (_tmp215_ = (bala_ccode_node_unref (_tmp215_), ((void*)0)))); |
| 23372 | } else { |
| 23373 | if (bala_ccode_base_module_is_in_destructor (self)) { |
| 23374 | BalaCCodeFunction* _tmp216_; |
| 23375 | BalaCCodeFunction* _tmp217_; |
| 23376 | _tmp216_ = bala_ccode_base_module_get_ccode (self); |
| 23377 | _tmp217_ = _tmp216_; |
| 23378 | bala_ccode_function_add_goto (_tmp217_, "_return"); |
| 23379 | } else { |
| 23380 | if (bala_ccode_base_module_is_in_coroutine (self)) { |
| 23381 | } else { |
| 23382 | BalaMethod* _tmp218_; |
| 23383 | BalaMethod* _tmp219_; |
| 23384 | _tmp218_ = bala_ccode_base_module_get_current_method (self); |
| 23385 | _tmp219_ = _tmp218_; |
| 23386 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp219_, BALA_TYPE_CREATION_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp219_); GType __t = ((bala_creation_method_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 23387 | BalaCCodeFunction* _tmp220_; |
| 23388 | BalaCCodeFunction* _tmp221_; |
| 23389 | BalaCCodeIdentifier* _tmp222_; |
| 23390 | BalaCCodeIdentifier* _tmp223_; |
| 23391 | _tmp220_ = bala_ccode_base_module_get_ccode (self); |
| 23392 | _tmp221_ = _tmp220_; |
| 23393 | _tmp222_ = bala_ccode_identifier_new ("self"); |
| 23394 | _tmp223_ = _tmp222_; |
| 23395 | bala_ccode_function_add_return (_tmp221_, (BalaCCodeExpression*) _tmp223_); |
| 23396 | _bala_ccode_node_unref0 (_tmp223_)((_tmp223_ == ((void*)0)) ? ((void*)0) : (_tmp223_ = (bala_ccode_node_unref (_tmp223_), ((void*)0)))); |
| 23397 | } else { |
| 23398 | gboolean _tmp224_ = FALSE(0); |
| 23399 | BalaDataType* _tmp225_; |
| 23400 | BalaDataType* _tmp226_; |
| 23401 | _tmp225_ = bala_ccode_base_module_get_current_return_type (self); |
| 23402 | _tmp226_ = _tmp225_; |
| 23403 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp226_, BALA_TYPE_VOID_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp226_); GType __t = ((bala_void_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 23404 | _tmp224_ = TRUE(!(0)); |
| 23405 | } else { |
| 23406 | BalaDataType* _tmp227_; |
| 23407 | BalaDataType* _tmp228_; |
| 23408 | _tmp227_ = bala_ccode_base_module_get_current_return_type (self); |
| 23409 | _tmp228_ = _tmp227_; |
| 23410 | _tmp224_ = bala_data_type_is_real_non_null_struct_type (_tmp228_); |
| 23411 | } |
| 23412 | if (_tmp224_) { |
| 23413 | BalaCCodeFunction* _tmp229_; |
| 23414 | BalaCCodeFunction* _tmp230_; |
| 23415 | _tmp229_ = bala_ccode_base_module_get_ccode (self); |
| 23416 | _tmp230_ = _tmp229_; |
| 23417 | bala_ccode_function_add_return (_tmp230_, NULL((void*)0)); |
| 23418 | } else { |
| 23419 | BalaCCodeFunction* _tmp231_; |
| 23420 | BalaCCodeFunction* _tmp232_; |
| 23421 | BalaCCodeIdentifier* _tmp233_; |
| 23422 | BalaCCodeIdentifier* _tmp234_; |
| 23423 | _tmp231_ = bala_ccode_base_module_get_ccode (self); |
| 23424 | _tmp232_ = _tmp231_; |
| 23425 | _tmp233_ = bala_ccode_identifier_new ("result"); |
| 23426 | _tmp234_ = _tmp233_; |
| 23427 | bala_ccode_function_add_return (_tmp232_, (BalaCCodeExpression*) _tmp234_); |
| 23428 | _bala_ccode_node_unref0 (_tmp234_)((_tmp234_ == ((void*)0)) ? ((void*)0) : (_tmp234_ = (bala_ccode_node_unref (_tmp234_), ((void*)0)))); |
| 23429 | } |
| 23430 | } |
| 23431 | } |
| 23432 | } |
| 23433 | } |
| 23434 | _tmp235_ = return_expression_symbol; |
| 23435 | if (_tmp235_ != NULL((void*)0)) { |
| 23436 | BalaSymbol* _tmp236_; |
| 23437 | _tmp236_ = return_expression_symbol; |
| 23438 | bala_symbol_set_active (_tmp236_, TRUE(!(0))); |
| 23439 | } |
| 23440 | bala_ccode_base_module_set_current_method_return (self, TRUE(!(0))); |
| 23441 | _bala_code_node_unref0 (return_expression_symbol)((return_expression_symbol == ((void*)0)) ? ((void*)0) : (return_expression_symbol = (bala_code_node_unref (return_expression_symbol), ((void*) 0)))); |
| 23442 | } |
| 23443 | |
| 23444 | static gchar* |
| 23445 | string_replace (const gchar* self, |
| 23446 | const gchar* old, |
| 23447 | const gchar* replacement) |
| 23448 | { |
| 23449 | gboolean _tmp0_ = FALSE(0); |
| 23450 | gboolean _tmp1_ = FALSE(0); |
| 23451 | GError* _inner_error0_ = NULL((void*)0); |
| 23452 | gchar* result = NULL((void*)0); |
| 23453 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 23454 | g_return_val_if_fail (old != NULL, NULL)do { if ((old != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "old != NULL") ; return (((void*)0)); } } while (0); |
| 23455 | g_return_val_if_fail (replacement != NULL, NULL)do { if ((replacement != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "replacement != NULL" ); return (((void*)0)); } } while (0); |
| 23456 | if ((*((gchar*) self)) == '\0') { |
| 23457 | _tmp1_ = TRUE(!(0)); |
| 23458 | } else { |
| 23459 | _tmp1_ = (*((gchar*) old)) == '\0'; |
| 23460 | } |
| 23461 | if (_tmp1_) { |
| 23462 | _tmp0_ = TRUE(!(0)); |
| 23463 | } else { |
| 23464 | _tmp0_ = g_strcmp0 (old, replacement) == 0; |
| 23465 | } |
| 23466 | if (_tmp0_) { |
| 23467 | gchar* _tmp2_; |
| 23468 | _tmp2_ = g_strdup (self); |
| 23469 | result = _tmp2_; |
| 23470 | return result; |
| 23471 | } |
| 23472 | { |
| 23473 | GRegex* regex = NULL((void*)0); |
| 23474 | gchar* _tmp3_; |
| 23475 | gchar* _tmp4_; |
| 23476 | GRegex* _tmp5_; |
| 23477 | GRegex* _tmp6_; |
| 23478 | gchar* _tmp7_ = NULL((void*)0); |
| 23479 | GRegex* _tmp8_; |
| 23480 | gchar* _tmp9_; |
| 23481 | gchar* _tmp10_; |
| 23482 | _tmp3_ = g_regex_escape_string (old, -1); |
| 23483 | _tmp4_ = _tmp3_; |
| 23484 | _tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_); |
| 23485 | _tmp6_ = _tmp5_; |
| 23486 | _g_free0 (_tmp4_)(_tmp4_ = (g_free (_tmp4_), ((void*)0))); |
| 23487 | regex = _tmp6_; |
| 23488 | if (G_UNLIKELY (_inner_error0_ != NULL)(_inner_error0_ != ((void*)0))) { |
| 23489 | _g_free0 (_tmp7_)(_tmp7_ = (g_free (_tmp7_), ((void*)0))); |
| 23490 | _g_regex_unref0 (regex)((regex == ((void*)0)) ? ((void*)0) : (regex = (g_regex_unref (regex), ((void*)0)))); |
| 23491 | if (_inner_error0_->domain == G_REGEX_ERRORg_regex_error_quark ()) { |
| 23492 | goto __catch0_g_regex_error; |
| 23493 | } |
| 23494 | g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__"balaccodebasemodule.c", __LINE__23494, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code); |
| 23495 | g_clear_error (&_inner_error0_); |
| 23496 | return NULL((void*)0); |
| 23497 | } |
| 23498 | _tmp8_ = regex; |
| 23499 | _tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_); |
| 23500 | _tmp7_ = _tmp9_; |
| 23501 | if (G_UNLIKELY (_inner_error0_ != NULL)(_inner_error0_ != ((void*)0))) { |
| 23502 | _g_free0 (_tmp7_)(_tmp7_ = (g_free (_tmp7_), ((void*)0))); |
| 23503 | _g_regex_unref0 (regex)((regex == ((void*)0)) ? ((void*)0) : (regex = (g_regex_unref (regex), ((void*)0)))); |
| 23504 | if (_inner_error0_->domain == G_REGEX_ERRORg_regex_error_quark ()) { |
| 23505 | goto __catch0_g_regex_error; |
| 23506 | } |
| 23507 | g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__"balaccodebasemodule.c", __LINE__23507, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code); |
| 23508 | g_clear_error (&_inner_error0_); |
| 23509 | return NULL((void*)0); |
| 23510 | } |
| 23511 | _tmp10_ = _tmp7_; |
| 23512 | _tmp7_ = NULL((void*)0); |
| 23513 | result = _tmp10_; |
| 23514 | _g_free0 (_tmp7_)(_tmp7_ = (g_free (_tmp7_), ((void*)0))); |
| 23515 | _g_regex_unref0 (regex)((regex == ((void*)0)) ? ((void*)0) : (regex = (g_regex_unref (regex), ((void*)0)))); |
| 23516 | return result; |
| 23517 | } |
| 23518 | goto __finally0; |
| 23519 | __catch0_g_regex_error: |
| 23520 | { |
| 23521 | g_clear_error (&_inner_error0_); |
| 23522 | g_assert_not_reached ()do { g_assertion_message_expr ("bala-ccodegen", "balaccodebasemodule.c" , 23522, ((const char*) (__func__)), ((void*)0)); } while (0); |
| 23523 | } |
| 23524 | __finally0: |
| 23525 | g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__"balaccodebasemodule.c", __LINE__23525, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code); |
| 23526 | g_clear_error (&_inner_error0_); |
| 23527 | return NULL((void*)0); |
| 23528 | } |
| 23529 | |
| 23530 | gchar* |
| 23531 | bala_ccode_base_module_get_symbol_lock_name (BalaCCodeBaseModule* self, |
| 23532 | const gchar* symname) |
| 23533 | { |
| 23534 | gchar* _tmp0_; |
| 23535 | gchar* _tmp1_; |
| 23536 | gchar* _tmp2_; |
| 23537 | gchar* _tmp3_; |
| 23538 | gchar* result = NULL((void*)0); |
| 23539 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 23540 | g_return_val_if_fail (symname != NULL, NULL)do { if ((symname != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "symname != NULL" ); return (((void*)0)); } } while (0); |
| 23541 | _tmp0_ = string_replace (symname, "-", "_"); |
| 23542 | _tmp1_ = _tmp0_; |
| 23543 | _tmp2_ = g_strdup_printf ("__lock_%s", _tmp1_); |
| 23544 | _tmp3_ = _tmp2_; |
| 23545 | _g_free0 (_tmp1_)(_tmp1_ = (g_free (_tmp1_), ((void*)0))); |
| 23546 | result = _tmp3_; |
| 23547 | return result; |
| 23548 | } |
| 23549 | |
| 23550 | static BalaCCodeExpression* |
| 23551 | bala_ccode_base_module_get_lock_expression (BalaCCodeBaseModule* self, |
| 23552 | BalaStatement* stmt, |
| 23553 | BalaExpression* resource) |
| 23554 | { |
| 23555 | BalaCCodeExpression* l = NULL((void*)0); |
| 23556 | BalaExpression* inner_node = NULL((void*)0); |
| 23557 | BalaExpression* _tmp0_; |
| 23558 | BalaExpression* _tmp1_; |
| 23559 | BalaExpression* _tmp2_; |
| 23560 | BalaSymbol* member = NULL((void*)0); |
| 23561 | BalaSymbol* _tmp3_; |
| 23562 | BalaSymbol* _tmp4_; |
| 23563 | BalaSymbol* _tmp5_; |
| 23564 | BalaTypeSymbol* parent = NULL((void*)0); |
| 23565 | BalaSymbol* _tmp6_; |
| 23566 | BalaSymbol* _tmp7_; |
| 23567 | BalaSymbol* _tmp8_; |
| 23568 | BalaSymbol* _tmp9_; |
| 23569 | BalaTypeSymbol* _tmp10_; |
| 23570 | BalaSymbol* _tmp11_; |
| 23571 | BalaCCodeExpression* result = NULL((void*)0); |
| 23572 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 23573 | g_return_val_if_fail (stmt != NULL, NULL)do { if ((stmt != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "stmt != NULL" ); return (((void*)0)); } } while (0); |
| 23574 | g_return_val_if_fail (resource != NULL, NULL)do { if ((resource != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "resource != NULL" ); return (((void*)0)); } } while (0); |
| 23575 | l = NULL((void*)0); |
| 23576 | _tmp0_ = bala_member_access_get_inner (G_TYPE_CHECK_INSTANCE_CAST (resource, BALA_TYPE_MEMBER_ACCESS, BalaMemberAccess)(((BalaMemberAccess*) g_type_check_instance_cast ((GTypeInstance *) (resource), ((bala_member_access_get_type ())))))); |
| 23577 | _tmp1_ = _tmp0_; |
| 23578 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 23579 | inner_node = _tmp2_; |
| 23580 | _tmp3_ = bala_expression_get_symbol_reference (resource); |
| 23581 | _tmp4_ = _tmp3_; |
| 23582 | _tmp5_ = _bala_code_node_ref0 (_tmp4_); |
| 23583 | member = _tmp5_; |
| 23584 | _tmp6_ = bala_expression_get_symbol_reference (resource); |
| 23585 | _tmp7_ = _tmp6_; |
| 23586 | _tmp8_ = bala_symbol_get_parent_symbol (_tmp7_); |
| 23587 | _tmp9_ = _tmp8_; |
| 23588 | _tmp10_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp9_), ((bala_typesymbol_get_type ())))))); |
| 23589 | parent = _tmp10_; |
| 23590 | _tmp11_ = member; |
| 23591 | if (bala_symbol_is_instance_member (_tmp11_)) { |
| 23592 | BalaExpression* _tmp12_; |
| 23593 | BalaCCodeExpression* _tmp24_; |
| 23594 | BalaCCodeMemberAccess* _tmp25_; |
| 23595 | BalaCCodeMemberAccess* _tmp26_; |
| 23596 | BalaSymbol* _tmp27_; |
| 23597 | gchar* _tmp28_; |
| 23598 | gchar* _tmp29_; |
| 23599 | gchar* _tmp30_; |
| 23600 | gchar* _tmp31_; |
| 23601 | BalaCCodeMemberAccess* _tmp32_; |
| 23602 | _tmp12_ = inner_node; |
| 23603 | if (_tmp12_ == NULL((void*)0)) { |
| 23604 | BalaCCodeIdentifier* _tmp13_; |
| 23605 | _tmp13_ = bala_ccode_identifier_new ("self"); |
| 23606 | _bala_ccode_node_unref0 (l)((l == ((void*)0)) ? ((void*)0) : (l = (bala_ccode_node_unref (l), ((void*)0)))); |
| 23607 | l = (BalaCCodeExpression*) _tmp13_; |
| 23608 | } else { |
| 23609 | BalaTypeSymbol* _tmp14_; |
| 23610 | BalaTypeSymbol* _tmp15_; |
| 23611 | BalaTypeSymbol* _tmp16_; |
| 23612 | _tmp14_ = parent; |
| 23613 | _tmp15_ = bala_ccode_base_module_get_current_type_symbol (self); |
| 23614 | _tmp16_ = _tmp15_; |
| 23615 | if (_tmp14_ != _tmp16_) { |
| 23616 | BalaExpression* _tmp17_; |
| 23617 | BalaCCodeExpression* _tmp18_; |
| 23618 | BalaTypeSymbol* _tmp19_; |
| 23619 | BalaCCodeFunctionCall* _tmp20_; |
| 23620 | _tmp17_ = inner_node; |
| 23621 | _tmp18_ = bala_get_cvalue (_tmp17_); |
| 23622 | _tmp19_ = parent; |
| 23623 | _tmp20_ = bala_ccode_base_module_generate_instance_cast (self, _tmp18_, _tmp19_); |
| 23624 | _bala_ccode_node_unref0 (l)((l == ((void*)0)) ? ((void*)0) : (l = (bala_ccode_node_unref (l), ((void*)0)))); |
| 23625 | l = (BalaCCodeExpression*) _tmp20_; |
| 23626 | } else { |
| 23627 | BalaExpression* _tmp21_; |
| 23628 | BalaCCodeExpression* _tmp22_; |
| 23629 | BalaCCodeExpression* _tmp23_; |
| 23630 | _tmp21_ = inner_node; |
| 23631 | _tmp22_ = bala_get_cvalue (_tmp21_); |
| 23632 | _tmp23_ = _bala_ccode_node_ref0 (_tmp22_); |
| 23633 | _bala_ccode_node_unref0 (l)((l == ((void*)0)) ? ((void*)0) : (l = (bala_ccode_node_unref (l), ((void*)0)))); |
| 23634 | l = _tmp23_; |
| 23635 | } |
| 23636 | } |
| 23637 | _tmp24_ = l; |
| 23638 | _tmp25_ = bala_ccode_member_access_new_pointer (_tmp24_, "priv"); |
| 23639 | _tmp26_ = _tmp25_; |
| 23640 | _tmp27_ = member; |
| 23641 | _tmp28_ = bala_get_ccode_name ((BalaCodeNode*) _tmp27_); |
| 23642 | _tmp29_ = _tmp28_; |
| 23643 | _tmp30_ = bala_ccode_base_module_get_symbol_lock_name (self, _tmp29_); |
| 23644 | _tmp31_ = _tmp30_; |
| 23645 | _tmp32_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp26_, _tmp31_); |
| 23646 | _bala_ccode_node_unref0 (l)((l == ((void*)0)) ? ((void*)0) : (l = (bala_ccode_node_unref (l), ((void*)0)))); |
| 23647 | l = (BalaCCodeExpression*) _tmp32_; |
| 23648 | _g_free0 (_tmp31_)(_tmp31_ = (g_free (_tmp31_), ((void*)0))); |
| 23649 | _g_free0 (_tmp29_)(_tmp29_ = (g_free (_tmp29_), ((void*)0))); |
| 23650 | _bala_ccode_node_unref0 (_tmp26_)((_tmp26_ == ((void*)0)) ? ((void*)0) : (_tmp26_ = (bala_ccode_node_unref (_tmp26_), ((void*)0)))); |
| 23651 | } else { |
| 23652 | BalaSymbol* _tmp33_; |
| 23653 | _tmp33_ = member; |
| 23654 | if (bala_symbol_is_class_member (_tmp33_)) { |
| 23655 | BalaCCodeExpression* klass = NULL((void*)0); |
| 23656 | BalaDataType* _tmp34_; |
| 23657 | BalaCCodeFunctionCall* get_class_private_call = NULL((void*)0); |
| 23658 | BalaTypeSymbol* _tmp45_; |
| 23659 | gchar* _tmp46_; |
| 23660 | gchar* _tmp47_; |
| 23661 | BalaCCodeIdentifier* _tmp48_; |
| 23662 | BalaCCodeIdentifier* _tmp49_; |
| 23663 | BalaCCodeFunctionCall* _tmp50_; |
| 23664 | BalaCCodeFunctionCall* _tmp51_; |
| 23665 | BalaCCodeFunctionCall* _tmp52_; |
| 23666 | BalaCCodeExpression* _tmp53_; |
| 23667 | BalaCCodeFunctionCall* _tmp54_; |
| 23668 | BalaSymbol* _tmp55_; |
| 23669 | gchar* _tmp56_; |
| 23670 | gchar* _tmp57_; |
| 23671 | gchar* _tmp58_; |
| 23672 | gchar* _tmp59_; |
| 23673 | BalaCCodeMemberAccess* _tmp60_; |
| 23674 | _tmp34_ = bala_ccode_base_module_get_this_type (self); |
| 23675 | if (_tmp34_ != NULL((void*)0)) { |
| 23676 | BalaCCodeFunctionCall* k = NULL((void*)0); |
| 23677 | BalaCCodeIdentifier* _tmp35_; |
| 23678 | BalaCCodeIdentifier* _tmp36_; |
| 23679 | BalaCCodeFunctionCall* _tmp37_; |
| 23680 | BalaCCodeFunctionCall* _tmp38_; |
| 23681 | BalaCCodeFunctionCall* _tmp39_; |
| 23682 | BalaCCodeIdentifier* _tmp40_; |
| 23683 | BalaCCodeIdentifier* _tmp41_; |
| 23684 | BalaCCodeFunctionCall* _tmp42_; |
| 23685 | BalaCCodeExpression* _tmp43_; |
| 23686 | _tmp35_ = bala_ccode_identifier_new ("G_OBJECT_GET_CLASS"); |
| 23687 | _tmp36_ = _tmp35_; |
| 23688 | _tmp37_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp36_); |
| 23689 | _tmp38_ = _tmp37_; |
| 23690 | _bala_ccode_node_unref0 (_tmp36_)((_tmp36_ == ((void*)0)) ? ((void*)0) : (_tmp36_ = (bala_ccode_node_unref (_tmp36_), ((void*)0)))); |
| 23691 | k = _tmp38_; |
| 23692 | _tmp39_ = k; |
| 23693 | _tmp40_ = bala_ccode_identifier_new ("self"); |
| 23694 | _tmp41_ = _tmp40_; |
| 23695 | bala_ccode_function_call_add_argument (_tmp39_, (BalaCCodeExpression*) _tmp41_); |
| 23696 | _bala_ccode_node_unref0 (_tmp41_)((_tmp41_ == ((void*)0)) ? ((void*)0) : (_tmp41_ = (bala_ccode_node_unref (_tmp41_), ((void*)0)))); |
| 23697 | _tmp42_ = k; |
| 23698 | _tmp43_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp42_); |
| 23699 | _bala_ccode_node_unref0 (klass)((klass == ((void*)0)) ? ((void*)0) : (klass = (bala_ccode_node_unref (klass), ((void*)0)))); |
| 23700 | klass = _tmp43_; |
| 23701 | _bala_ccode_node_unref0 (k)((k == ((void*)0)) ? ((void*)0) : (k = (bala_ccode_node_unref (k), ((void*)0)))); |
| 23702 | } else { |
| 23703 | BalaCCodeIdentifier* _tmp44_; |
| 23704 | _tmp44_ = bala_ccode_identifier_new ("klass"); |
| 23705 | _bala_ccode_node_unref0 (klass)((klass == ((void*)0)) ? ((void*)0) : (klass = (bala_ccode_node_unref (klass), ((void*)0)))); |
| 23706 | klass = (BalaCCodeExpression*) _tmp44_; |
| 23707 | } |
| 23708 | _tmp45_ = parent; |
| 23709 | _tmp46_ = bala_get_ccode_class_get_private_function (G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp45_), ((bala_class_get_type ())))))); |
| 23710 | _tmp47_ = _tmp46_; |
| 23711 | _tmp48_ = bala_ccode_identifier_new (_tmp47_); |
| 23712 | _tmp49_ = _tmp48_; |
| 23713 | _tmp50_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp49_); |
| 23714 | _tmp51_ = _tmp50_; |
| 23715 | _bala_ccode_node_unref0 (_tmp49_)((_tmp49_ == ((void*)0)) ? ((void*)0) : (_tmp49_ = (bala_ccode_node_unref (_tmp49_), ((void*)0)))); |
| 23716 | _g_free0 (_tmp47_)(_tmp47_ = (g_free (_tmp47_), ((void*)0))); |
| 23717 | get_class_private_call = _tmp51_; |
| 23718 | _tmp52_ = get_class_private_call; |
| 23719 | _tmp53_ = klass; |
| 23720 | bala_ccode_function_call_add_argument (_tmp52_, _tmp53_); |
| 23721 | _tmp54_ = get_class_private_call; |
| 23722 | _tmp55_ = member; |
| 23723 | _tmp56_ = bala_get_ccode_name ((BalaCodeNode*) _tmp55_); |
| 23724 | _tmp57_ = _tmp56_; |
| 23725 | _tmp58_ = bala_ccode_base_module_get_symbol_lock_name (self, _tmp57_); |
| 23726 | _tmp59_ = _tmp58_; |
| 23727 | _tmp60_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp54_, _tmp59_); |
| 23728 | _bala_ccode_node_unref0 (l)((l == ((void*)0)) ? ((void*)0) : (l = (bala_ccode_node_unref (l), ((void*)0)))); |
| 23729 | l = (BalaCCodeExpression*) _tmp60_; |
| 23730 | _g_free0 (_tmp59_)(_tmp59_ = (g_free (_tmp59_), ((void*)0))); |
| 23731 | _g_free0 (_tmp57_)(_tmp57_ = (g_free (_tmp57_), ((void*)0))); |
| 23732 | _bala_ccode_node_unref0 (get_class_private_call)((get_class_private_call == ((void*)0)) ? ((void*)0) : (get_class_private_call = (bala_ccode_node_unref (get_class_private_call), ((void*)0 )))); |
| 23733 | _bala_ccode_node_unref0 (klass)((klass == ((void*)0)) ? ((void*)0) : (klass = (bala_ccode_node_unref (klass), ((void*)0)))); |
| 23734 | } else { |
| 23735 | gchar* lock_name = NULL((void*)0); |
| 23736 | BalaTypeSymbol* _tmp61_; |
| 23737 | gchar* _tmp62_; |
| 23738 | gchar* _tmp63_; |
| 23739 | BalaSymbol* _tmp64_; |
| 23740 | gchar* _tmp65_; |
| 23741 | gchar* _tmp66_; |
| 23742 | gchar* _tmp67_; |
| 23743 | gchar* _tmp68_; |
| 23744 | const gchar* _tmp69_; |
| 23745 | gchar* _tmp70_; |
| 23746 | gchar* _tmp71_; |
| 23747 | BalaCCodeIdentifier* _tmp72_; |
| 23748 | _tmp61_ = parent; |
| 23749 | _tmp62_ = bala_get_ccode_lower_case_name ((BalaCodeNode*) _tmp61_, NULL((void*)0)); |
| 23750 | _tmp63_ = _tmp62_; |
| 23751 | _tmp64_ = member; |
| 23752 | _tmp65_ = bala_get_ccode_name ((BalaCodeNode*) _tmp64_); |
| 23753 | _tmp66_ = _tmp65_; |
| 23754 | _tmp67_ = g_strdup_printf ("%s_%s", _tmp63_, _tmp66_); |
| 23755 | _tmp68_ = _tmp67_; |
| 23756 | _g_free0 (_tmp66_)(_tmp66_ = (g_free (_tmp66_), ((void*)0))); |
| 23757 | _g_free0 (_tmp63_)(_tmp63_ = (g_free (_tmp63_), ((void*)0))); |
| 23758 | lock_name = _tmp68_; |
| 23759 | _tmp69_ = lock_name; |
| 23760 | _tmp70_ = bala_ccode_base_module_get_symbol_lock_name (self, _tmp69_); |
| 23761 | _tmp71_ = _tmp70_; |
| 23762 | _tmp72_ = bala_ccode_identifier_new (_tmp71_); |
| 23763 | _bala_ccode_node_unref0 (l)((l == ((void*)0)) ? ((void*)0) : (l = (bala_ccode_node_unref (l), ((void*)0)))); |
| 23764 | l = (BalaCCodeExpression*) _tmp72_; |
| 23765 | _g_free0 (_tmp71_)(_tmp71_ = (g_free (_tmp71_), ((void*)0))); |
| 23766 | _g_free0 (lock_name)(lock_name = (g_free (lock_name), ((void*)0))); |
| 23767 | } |
| 23768 | } |
| 23769 | result = l; |
| 23770 | _bala_code_node_unref0 (parent)((parent == ((void*)0)) ? ((void*)0) : (parent = (bala_code_node_unref (parent), ((void*)0)))); |
| 23771 | _bala_code_node_unref0 (member)((member == ((void*)0)) ? ((void*)0) : (member = (bala_code_node_unref (member), ((void*)0)))); |
| 23772 | _bala_code_node_unref0 (inner_node)((inner_node == ((void*)0)) ? ((void*)0) : (inner_node = (bala_code_node_unref (inner_node), ((void*)0)))); |
| 23773 | return result; |
| 23774 | } |
| 23775 | |
| 23776 | static void |
| 23777 | bala_ccode_base_module_real_visit_lock_statement (BalaCodeVisitor* base, |
| 23778 | BalaLockStatement* stmt) |
| 23779 | { |
| 23780 | BalaCCodeBaseModule * self; |
| 23781 | BalaCCodeExpression* l = NULL((void*)0); |
| 23782 | BalaExpression* _tmp0_; |
| 23783 | BalaExpression* _tmp1_; |
| 23784 | BalaCCodeExpression* _tmp2_; |
| 23785 | BalaCCodeFunctionCall* fc = NULL((void*)0); |
| 23786 | BalaStruct* _tmp3_; |
| 23787 | BalaScope* _tmp4_; |
| 23788 | BalaScope* _tmp5_; |
| 23789 | BalaSymbol* _tmp6_; |
| 23790 | BalaSymbol* _tmp7_; |
| 23791 | gchar* _tmp8_; |
| 23792 | gchar* _tmp9_; |
| 23793 | BalaCCodeIdentifier* _tmp10_; |
| 23794 | BalaCCodeIdentifier* _tmp11_; |
| 23795 | BalaCCodeFunctionCall* _tmp12_; |
| 23796 | BalaCCodeFunctionCall* _tmp13_; |
| 23797 | BalaCCodeUnaryExpression* _tmp14_; |
| 23798 | BalaCCodeUnaryExpression* _tmp15_; |
| 23799 | BalaCCodeFunction* _tmp16_; |
| 23800 | BalaCCodeFunction* _tmp17_; |
| 23801 | self = (BalaCCodeBaseModule*) base; |
| 23802 | g_return_if_fail (stmt != NULL)do { if ((stmt != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "stmt != NULL" ); return; } } while (0); |
| 23803 | _tmp0_ = bala_lock_statement_get_resource (stmt); |
| 23804 | _tmp1_ = _tmp0_; |
| 23805 | _tmp2_ = bala_ccode_base_module_get_lock_expression (self, (BalaStatement*) stmt, _tmp1_); |
| 23806 | l = _tmp2_; |
| 23807 | _tmp3_ = self->mutex_type; |
| 23808 | _tmp4_ = bala_symbol_get_scope ((BalaSymbol*) _tmp3_); |
| 23809 | _tmp5_ = _tmp4_; |
| 23810 | _tmp6_ = bala_scope_lookup (_tmp5_, "lock"); |
| 23811 | _tmp7_ = _tmp6_; |
| 23812 | _tmp8_ = bala_get_ccode_name ((BalaCodeNode*) _tmp7_); |
| 23813 | _tmp9_ = _tmp8_; |
| 23814 | _tmp10_ = bala_ccode_identifier_new (_tmp9_); |
| 23815 | _tmp11_ = _tmp10_; |
| 23816 | _tmp12_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp11_); |
| 23817 | _tmp13_ = _tmp12_; |
| 23818 | _bala_ccode_node_unref0 (_tmp11_)((_tmp11_ == ((void*)0)) ? ((void*)0) : (_tmp11_ = (bala_ccode_node_unref (_tmp11_), ((void*)0)))); |
| 23819 | _g_free0 (_tmp9_)(_tmp9_ = (g_free (_tmp9_), ((void*)0))); |
| 23820 | _bala_code_node_unref0 (_tmp7_)((_tmp7_ == ((void*)0)) ? ((void*)0) : (_tmp7_ = (bala_code_node_unref (_tmp7_), ((void*)0)))); |
| 23821 | fc = _tmp13_; |
| 23822 | _tmp14_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, l); |
| 23823 | _tmp15_ = _tmp14_; |
| 23824 | bala_ccode_function_call_add_argument (fc, (BalaCCodeExpression*) _tmp15_); |
| 23825 | _bala_ccode_node_unref0 (_tmp15_)((_tmp15_ == ((void*)0)) ? ((void*)0) : (_tmp15_ = (bala_ccode_node_unref (_tmp15_), ((void*)0)))); |
| 23826 | _tmp16_ = bala_ccode_base_module_get_ccode (self); |
| 23827 | _tmp17_ = _tmp16_; |
| 23828 | bala_ccode_function_add_expression (_tmp17_, (BalaCCodeExpression*) fc); |
| 23829 | _bala_ccode_node_unref0 (fc)((fc == ((void*)0)) ? ((void*)0) : (fc = (bala_ccode_node_unref (fc), ((void*)0)))); |
| 23830 | _bala_ccode_node_unref0 (l)((l == ((void*)0)) ? ((void*)0) : (l = (bala_ccode_node_unref (l), ((void*)0)))); |
| 23831 | } |
| 23832 | |
| 23833 | static void |
| 23834 | bala_ccode_base_module_real_visit_unlock_statement (BalaCodeVisitor* base, |
| 23835 | BalaUnlockStatement* stmt) |
| 23836 | { |
| 23837 | BalaCCodeBaseModule * self; |
| 23838 | BalaCCodeExpression* l = NULL((void*)0); |
| 23839 | BalaExpression* _tmp0_; |
| 23840 | BalaExpression* _tmp1_; |
| 23841 | BalaCCodeExpression* _tmp2_; |
| 23842 | BalaCCodeFunctionCall* fc = NULL((void*)0); |
| 23843 | BalaStruct* _tmp3_; |
| 23844 | BalaScope* _tmp4_; |
| 23845 | BalaScope* _tmp5_; |
| 23846 | BalaSymbol* _tmp6_; |
| 23847 | BalaSymbol* _tmp7_; |
| 23848 | gchar* _tmp8_; |
| 23849 | gchar* _tmp9_; |
| 23850 | BalaCCodeIdentifier* _tmp10_; |
| 23851 | BalaCCodeIdentifier* _tmp11_; |
| 23852 | BalaCCodeFunctionCall* _tmp12_; |
| 23853 | BalaCCodeFunctionCall* _tmp13_; |
| 23854 | BalaCCodeUnaryExpression* _tmp14_; |
| 23855 | BalaCCodeUnaryExpression* _tmp15_; |
| 23856 | BalaCCodeFunction* _tmp16_; |
| 23857 | BalaCCodeFunction* _tmp17_; |
| 23858 | self = (BalaCCodeBaseModule*) base; |
| 23859 | g_return_if_fail (stmt != NULL)do { if ((stmt != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "stmt != NULL" ); return; } } while (0); |
| 23860 | _tmp0_ = bala_unlock_statement_get_resource (stmt); |
| 23861 | _tmp1_ = _tmp0_; |
| 23862 | _tmp2_ = bala_ccode_base_module_get_lock_expression (self, (BalaStatement*) stmt, _tmp1_); |
| 23863 | l = _tmp2_; |
| 23864 | _tmp3_ = self->mutex_type; |
| 23865 | _tmp4_ = bala_symbol_get_scope ((BalaSymbol*) _tmp3_); |
| 23866 | _tmp5_ = _tmp4_; |
| 23867 | _tmp6_ = bala_scope_lookup (_tmp5_, "unlock"); |
| 23868 | _tmp7_ = _tmp6_; |
| 23869 | _tmp8_ = bala_get_ccode_name ((BalaCodeNode*) _tmp7_); |
| 23870 | _tmp9_ = _tmp8_; |
| 23871 | _tmp10_ = bala_ccode_identifier_new (_tmp9_); |
| 23872 | _tmp11_ = _tmp10_; |
| 23873 | _tmp12_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp11_); |
| 23874 | _tmp13_ = _tmp12_; |
| 23875 | _bala_ccode_node_unref0 (_tmp11_)((_tmp11_ == ((void*)0)) ? ((void*)0) : (_tmp11_ = (bala_ccode_node_unref (_tmp11_), ((void*)0)))); |
| 23876 | _g_free0 (_tmp9_)(_tmp9_ = (g_free (_tmp9_), ((void*)0))); |
| 23877 | _bala_code_node_unref0 (_tmp7_)((_tmp7_ == ((void*)0)) ? ((void*)0) : (_tmp7_ = (bala_code_node_unref (_tmp7_), ((void*)0)))); |
| 23878 | fc = _tmp13_; |
| 23879 | _tmp14_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, l); |
| 23880 | _tmp15_ = _tmp14_; |
| 23881 | bala_ccode_function_call_add_argument (fc, (BalaCCodeExpression*) _tmp15_); |
| 23882 | _bala_ccode_node_unref0 (_tmp15_)((_tmp15_ == ((void*)0)) ? ((void*)0) : (_tmp15_ = (bala_ccode_node_unref (_tmp15_), ((void*)0)))); |
| 23883 | _tmp16_ = bala_ccode_base_module_get_ccode (self); |
| 23884 | _tmp17_ = _tmp16_; |
| 23885 | bala_ccode_function_add_expression (_tmp17_, (BalaCCodeExpression*) fc); |
| 23886 | _bala_ccode_node_unref0 (fc)((fc == ((void*)0)) ? ((void*)0) : (fc = (bala_ccode_node_unref (fc), ((void*)0)))); |
| 23887 | _bala_ccode_node_unref0 (l)((l == ((void*)0)) ? ((void*)0) : (l = (bala_ccode_node_unref (l), ((void*)0)))); |
| 23888 | } |
| 23889 | |
| 23890 | static void |
| 23891 | bala_ccode_base_module_real_visit_delete_statement (BalaCodeVisitor* base, |
| 23892 | BalaDeleteStatement* stmt) |
| 23893 | { |
| 23894 | BalaCCodeBaseModule * self; |
| 23895 | BalaDataType* type = NULL((void*)0); |
| 23896 | BalaExpression* _tmp0_; |
| 23897 | BalaExpression* _tmp1_; |
| 23898 | BalaDataType* _tmp2_; |
| 23899 | BalaDataType* _tmp3_; |
| 23900 | BalaPointerType* pointer_type = NULL((void*)0); |
| 23901 | BalaDataType* _tmp4_; |
| 23902 | gboolean _tmp5_ = FALSE(0); |
| 23903 | gboolean _tmp6_ = FALSE(0); |
| 23904 | BalaPointerType* _tmp7_; |
| 23905 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 23906 | BalaDataType* _tmp21_; |
| 23907 | BalaCCodeExpression* _tmp22_; |
| 23908 | BalaCCodeExpression* _tmp23_; |
| 23909 | BalaCCodeFunctionCall* _tmp24_; |
| 23910 | BalaCCodeFunctionCall* _tmp25_; |
| 23911 | BalaExpression* _tmp26_; |
| 23912 | BalaExpression* _tmp27_; |
| 23913 | BalaCCodeExpression* _tmp28_; |
| 23914 | BalaCCodeFunction* _tmp29_; |
| 23915 | BalaCCodeFunction* _tmp30_; |
| 23916 | self = (BalaCCodeBaseModule*) base; |
| 23917 | g_return_if_fail (stmt != NULL)do { if ((stmt != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "stmt != NULL" ); return; } } while (0); |
| 23918 | _tmp0_ = bala_delete_statement_get_expression (stmt); |
| 23919 | _tmp1_ = _tmp0_; |
| 23920 | _tmp2_ = bala_expression_get_value_type (_tmp1_); |
| 23921 | _tmp3_ = _tmp2_; |
| 23922 | type = _tmp3_; |
| 23923 | _tmp4_ = type; |
| 23924 | pointer_type = G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, BALA_TYPE_POINTER_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp4_); GType __t = ((bala_pointer_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaPointerType*) _tmp4_) : NULL((void*)0); |
| 23925 | _tmp7_ = pointer_type; |
| 23926 | if (_tmp7_ != NULL((void*)0)) { |
| 23927 | BalaPointerType* _tmp8_; |
| 23928 | BalaDataType* _tmp9_; |
| 23929 | BalaDataType* _tmp10_; |
| 23930 | BalaTypeSymbol* _tmp11_; |
| 23931 | BalaTypeSymbol* _tmp12_; |
| 23932 | _tmp8_ = pointer_type; |
| 23933 | _tmp9_ = bala_pointer_type_get_base_type (_tmp8_); |
| 23934 | _tmp10_ = _tmp9_; |
| 23935 | _tmp11_ = bala_data_type_get_type_symbol (_tmp10_); |
| 23936 | _tmp12_ = _tmp11_; |
| 23937 | _tmp6_ = _tmp12_ != NULL((void*)0); |
| 23938 | } else { |
| 23939 | _tmp6_ = FALSE(0); |
| 23940 | } |
| 23941 | if (_tmp6_) { |
| 23942 | BalaPointerType* _tmp13_; |
| 23943 | BalaDataType* _tmp14_; |
| 23944 | BalaDataType* _tmp15_; |
| 23945 | BalaTypeSymbol* _tmp16_; |
| 23946 | BalaTypeSymbol* _tmp17_; |
| 23947 | _tmp13_ = pointer_type; |
| 23948 | _tmp14_ = bala_pointer_type_get_base_type (_tmp13_); |
| 23949 | _tmp15_ = _tmp14_; |
| 23950 | _tmp16_ = bala_data_type_get_type_symbol (_tmp15_); |
| 23951 | _tmp17_ = _tmp16_; |
| 23952 | _tmp5_ = bala_typesymbol_is_reference_type (_tmp17_); |
| 23953 | } else { |
| 23954 | _tmp5_ = FALSE(0); |
| 23955 | } |
| 23956 | if (_tmp5_) { |
| 23957 | BalaPointerType* _tmp18_; |
| 23958 | BalaDataType* _tmp19_; |
| 23959 | BalaDataType* _tmp20_; |
| 23960 | _tmp18_ = pointer_type; |
| 23961 | _tmp19_ = bala_pointer_type_get_base_type (_tmp18_); |
| 23962 | _tmp20_ = _tmp19_; |
| 23963 | type = _tmp20_; |
| 23964 | } |
| 23965 | _tmp21_ = type; |
| 23966 | _tmp22_ = bala_ccode_base_module_get_destroy_func_expression (self, _tmp21_, FALSE(0)); |
| 23967 | _tmp23_ = _tmp22_; |
| 23968 | _tmp24_ = bala_ccode_function_call_new (_tmp23_); |
| 23969 | _tmp25_ = _tmp24_; |
| 23970 | _bala_ccode_node_unref0 (_tmp23_)((_tmp23_ == ((void*)0)) ? ((void*)0) : (_tmp23_ = (bala_ccode_node_unref (_tmp23_), ((void*)0)))); |
| 23971 | ccall = _tmp25_; |
| 23972 | _tmp26_ = bala_delete_statement_get_expression (stmt); |
| 23973 | _tmp27_ = _tmp26_; |
| 23974 | _tmp28_ = bala_get_cvalue (_tmp27_); |
| 23975 | bala_ccode_function_call_add_argument (ccall, _tmp28_); |
| 23976 | _tmp29_ = bala_ccode_base_module_get_ccode (self); |
| 23977 | _tmp30_ = _tmp29_; |
| 23978 | bala_ccode_function_add_expression (_tmp30_, (BalaCCodeExpression*) ccall); |
| 23979 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 23980 | } |
| 23981 | |
| 23982 | static gboolean |
| 23983 | bala_ccode_base_module_is_compact_class_destructor_call (BalaExpression* expr) |
| 23984 | { |
| 23985 | BalaClass* cl = NULL((void*)0); |
| 23986 | BalaDataType* _tmp0_; |
| 23987 | BalaDataType* _tmp1_; |
| 23988 | BalaTypeSymbol* _tmp2_; |
| 23989 | BalaTypeSymbol* _tmp3_; |
| 23990 | gboolean _tmp4_ = FALSE(0); |
| 23991 | gboolean _tmp5_ = FALSE(0); |
| 23992 | BalaClass* _tmp6_; |
| 23993 | gboolean result = FALSE(0); |
| 23994 | g_return_val_if_fail (expr != NULL, FALSE)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return ((0)); } } while (0); |
| 23995 | _tmp0_ = bala_expression_get_value_type (expr); |
| 23996 | _tmp1_ = _tmp0_; |
| 23997 | _tmp2_ = bala_data_type_get_type_symbol (_tmp1_); |
| 23998 | _tmp3_ = _tmp2_; |
| 23999 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp3_) : NULL((void*)0); |
| 24000 | _tmp6_ = cl; |
| 24001 | if (_tmp6_ != NULL((void*)0)) { |
| 24002 | BalaClass* _tmp7_; |
| 24003 | gboolean _tmp8_; |
| 24004 | gboolean _tmp9_; |
| 24005 | _tmp7_ = cl; |
| 24006 | _tmp8_ = bala_class_get_is_compact (_tmp7_); |
| 24007 | _tmp9_ = _tmp8_; |
| 24008 | _tmp5_ = _tmp9_; |
| 24009 | } else { |
| 24010 | _tmp5_ = FALSE(0); |
| 24011 | } |
| 24012 | if (_tmp5_) { |
| 24013 | BalaCodeNode* _tmp10_; |
| 24014 | BalaCodeNode* _tmp11_; |
| 24015 | _tmp10_ = bala_code_node_get_parent_node ((BalaCodeNode*) expr); |
| 24016 | _tmp11_ = _tmp10_; |
| 24017 | _tmp4_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, BALA_TYPE_MEMBER_ACCESS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp11_); GType __t = ((bala_member_access_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 24018 | } else { |
| 24019 | _tmp4_ = FALSE(0); |
| 24020 | } |
| 24021 | if (_tmp4_) { |
| 24022 | BalaMethodType* mt = NULL((void*)0); |
| 24023 | BalaCodeNode* _tmp12_; |
| 24024 | BalaCodeNode* _tmp13_; |
| 24025 | BalaDataType* _tmp14_; |
| 24026 | BalaDataType* _tmp15_; |
| 24027 | gboolean _tmp16_ = FALSE(0); |
| 24028 | gboolean _tmp17_ = FALSE(0); |
| 24029 | BalaMethodType* _tmp18_; |
| 24030 | _tmp12_ = bala_code_node_get_parent_node ((BalaCodeNode*) expr); |
| 24031 | _tmp13_ = _tmp12_; |
| 24032 | _tmp14_ = bala_expression_get_value_type ((BalaExpression*) G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, BALA_TYPE_MEMBER_ACCESS, BalaMemberAccess)(((BalaMemberAccess*) g_type_check_instance_cast ((GTypeInstance *) (_tmp13_), ((bala_member_access_get_type ())))))); |
| 24033 | _tmp15_ = _tmp14_; |
| 24034 | mt = G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, BALA_TYPE_METHOD_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp15_); GType __t = ((bala_method_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaMethodType*) _tmp15_) : NULL((void*)0); |
| 24035 | _tmp18_ = mt; |
| 24036 | if (_tmp18_ != NULL((void*)0)) { |
| 24037 | BalaMethodType* _tmp19_; |
| 24038 | BalaMethod* _tmp20_; |
| 24039 | BalaMethod* _tmp21_; |
| 24040 | _tmp19_ = mt; |
| 24041 | _tmp20_ = bala_method_type_get_method_symbol (_tmp19_); |
| 24042 | _tmp21_ = _tmp20_; |
| 24043 | _tmp17_ = _tmp21_ != NULL((void*)0); |
| 24044 | } else { |
| 24045 | _tmp17_ = FALSE(0); |
| 24046 | } |
| 24047 | if (_tmp17_) { |
| 24048 | BalaMethodType* _tmp22_; |
| 24049 | BalaMethod* _tmp23_; |
| 24050 | BalaMethod* _tmp24_; |
| 24051 | BalaAttribute* _tmp25_; |
| 24052 | _tmp22_ = mt; |
| 24053 | _tmp23_ = bala_method_type_get_method_symbol (_tmp22_); |
| 24054 | _tmp24_ = _tmp23_; |
| 24055 | _tmp25_ = bala_code_node_get_attribute ((BalaCodeNode*) _tmp24_, "DestroysInstance"); |
| 24056 | _tmp16_ = _tmp25_ != NULL((void*)0); |
| 24057 | } else { |
| 24058 | _tmp16_ = FALSE(0); |
| 24059 | } |
| 24060 | if (_tmp16_) { |
| 24061 | result = TRUE(!(0)); |
| 24062 | return result; |
| 24063 | } |
| 24064 | } |
| 24065 | result = FALSE(0); |
| 24066 | return result; |
| 24067 | } |
| 24068 | |
| 24069 | static void |
| 24070 | bala_ccode_base_module_real_visit_expression (BalaCodeVisitor* base, |
| 24071 | BalaExpression* expr) |
| 24072 | { |
| 24073 | BalaCCodeBaseModule * self; |
| 24074 | gboolean _tmp0_ = FALSE(0); |
| 24075 | BalaCCodeExpression* _tmp1_; |
| 24076 | self = (BalaCCodeBaseModule*) base; |
| 24077 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 24078 | _tmp1_ = bala_get_cvalue (expr); |
| 24079 | if (_tmp1_ != NULL((void*)0)) { |
| 24080 | gboolean _tmp2_; |
| 24081 | gboolean _tmp3_; |
| 24082 | _tmp2_ = bala_expression_get_lvalue (expr); |
| 24083 | _tmp3_ = _tmp2_; |
| 24084 | _tmp0_ = !_tmp3_; |
| 24085 | } else { |
| 24086 | _tmp0_ = FALSE(0); |
| 24087 | } |
| 24088 | if (_tmp0_) { |
| 24089 | gboolean _tmp4_ = FALSE(0); |
| 24090 | BalaDataType* _tmp5_; |
| 24091 | BalaDataType* _tmp6_; |
| 24092 | BalaDataType* _tmp37_; |
| 24093 | BalaDataType* _tmp38_; |
| 24094 | BalaTargetValue* _tmp49_; |
| 24095 | BalaTargetValue* _tmp50_; |
| 24096 | gboolean _tmp51_ = FALSE(0); |
| 24097 | BalaDataType* _tmp52_; |
| 24098 | BalaDataType* _tmp53_; |
| 24099 | gboolean _tmp70_ = FALSE(0); |
| 24100 | BalaDataType* _tmp71_; |
| 24101 | BalaDataType* _tmp72_; |
| 24102 | _tmp5_ = bala_expression_get_formal_value_type (expr); |
| 24103 | _tmp6_ = _tmp5_; |
| 24104 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp6_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 24105 | BalaDataType* _tmp7_; |
| 24106 | BalaDataType* _tmp8_; |
| 24107 | _tmp7_ = bala_expression_get_value_type (expr); |
| 24108 | _tmp8_ = _tmp7_; |
| 24109 | _tmp4_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp8_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 24110 | } else { |
| 24111 | _tmp4_ = FALSE(0); |
| 24112 | } |
| 24113 | if (_tmp4_) { |
| 24114 | BalaTypeParameter* type_parameter = NULL((void*)0); |
| 24115 | BalaDataType* _tmp9_; |
| 24116 | BalaDataType* _tmp10_; |
| 24117 | BalaTypeParameter* _tmp11_; |
| 24118 | BalaTypeParameter* _tmp12_; |
| 24119 | BalaTypeParameter* _tmp13_; |
| 24120 | BalaStruct* st = NULL((void*)0); |
| 24121 | BalaTypeParameter* _tmp14_; |
| 24122 | BalaSymbol* _tmp15_; |
| 24123 | BalaSymbol* _tmp16_; |
| 24124 | BalaSymbol* _tmp17_; |
| 24125 | BalaSymbol* _tmp18_; |
| 24126 | BalaStruct* _tmp19_; |
| 24127 | gboolean _tmp20_ = FALSE(0); |
| 24128 | BalaTypeParameter* _tmp21_; |
| 24129 | BalaSymbol* _tmp22_; |
| 24130 | BalaSymbol* _tmp23_; |
| 24131 | BalaTypeSymbol* _tmp24_; |
| 24132 | _tmp9_ = bala_expression_get_formal_value_type (expr); |
| 24133 | _tmp10_ = _tmp9_; |
| 24134 | _tmp11_ = bala_generic_type_get_type_parameter (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, BALA_TYPE_GENERIC_TYPE, BalaGenericType)(((BalaGenericType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp10_), ((bala_generic_type_get_type ())))))); |
| 24135 | _tmp12_ = _tmp11_; |
| 24136 | _tmp13_ = _bala_code_node_ref0 (_tmp12_); |
| 24137 | type_parameter = _tmp13_; |
| 24138 | _tmp14_ = type_parameter; |
| 24139 | _tmp15_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp14_); |
| 24140 | _tmp16_ = _tmp15_; |
| 24141 | _tmp17_ = bala_symbol_get_parent_symbol (_tmp16_); |
| 24142 | _tmp18_ = _tmp17_; |
| 24143 | _tmp19_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp18_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp18_) : NULL((void*)0)); |
| 24144 | st = _tmp19_; |
| 24145 | _tmp21_ = type_parameter; |
| 24146 | _tmp22_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp21_); |
| 24147 | _tmp23_ = _tmp22_; |
| 24148 | _tmp24_ = self->garray_type; |
| 24149 | if (_tmp23_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, BALA_TYPE_SYMBOL, BalaSymbol)(((BalaSymbol*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp24_), ((bala_symbol_get_type ())))))) { |
| 24150 | gboolean _tmp25_ = FALSE(0); |
| 24151 | BalaStruct* _tmp26_; |
| 24152 | _tmp26_ = st; |
| 24153 | if (_tmp26_ == NULL((void*)0)) { |
| 24154 | _tmp25_ = TRUE(!(0)); |
| 24155 | } else { |
| 24156 | BalaStruct* _tmp27_; |
| 24157 | gchar* _tmp28_; |
| 24158 | gchar* _tmp29_; |
| 24159 | _tmp27_ = st; |
| 24160 | _tmp28_ = bala_get_ccode_name ((BalaCodeNode*) _tmp27_); |
| 24161 | _tmp29_ = _tmp28_; |
| 24162 | _tmp25_ = g_strcmp0 (_tmp29_, "va_list") != 0; |
| 24163 | _g_free0 (_tmp29_)(_tmp29_ = (g_free (_tmp29_), ((void*)0))); |
| 24164 | } |
| 24165 | _tmp20_ = _tmp25_; |
| 24166 | } else { |
| 24167 | _tmp20_ = FALSE(0); |
| 24168 | } |
| 24169 | if (_tmp20_) { |
| 24170 | BalaCCodeExpression* _tmp30_; |
| 24171 | BalaDataType* _tmp31_; |
| 24172 | BalaDataType* _tmp32_; |
| 24173 | BalaCCodeExpression* _tmp33_; |
| 24174 | BalaCCodeExpression* _tmp34_; |
| 24175 | BalaTargetValue* _tmp35_; |
| 24176 | BalaTargetValue* _tmp36_; |
| 24177 | _tmp30_ = bala_get_cvalue (expr); |
| 24178 | _tmp31_ = bala_expression_get_value_type (expr); |
| 24179 | _tmp32_ = _tmp31_; |
| 24180 | _tmp33_ = bala_ccode_base_module_convert_from_generic_pointer (self, _tmp30_, _tmp32_); |
| 24181 | _tmp34_ = _tmp33_; |
| 24182 | bala_set_cvalue (expr, _tmp34_); |
| 24183 | _bala_ccode_node_unref0 (_tmp34_)((_tmp34_ == ((void*)0)) ? ((void*)0) : (_tmp34_ = (bala_ccode_node_unref (_tmp34_), ((void*)0)))); |
| 24184 | _tmp35_ = bala_expression_get_target_value (expr); |
| 24185 | _tmp36_ = _tmp35_; |
| 24186 | G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp36_), ((bala_glib_value_get_type ())))))->lvalue = FALSE(0); |
| 24187 | } |
| 24188 | _bala_code_node_unref0 (st)((st == ((void*)0)) ? ((void*)0) : (st = (bala_code_node_unref (st), ((void*)0)))); |
| 24189 | _bala_code_node_unref0 (type_parameter)((type_parameter == ((void*)0)) ? ((void*)0) : (type_parameter = (bala_code_node_unref (type_parameter), ((void*)0)))); |
| 24190 | } |
| 24191 | _tmp37_ = bala_expression_get_value_type (expr); |
| 24192 | _tmp38_ = _tmp37_; |
| 24193 | if (_tmp38_ != NULL((void*)0)) { |
| 24194 | BalaTargetValue* _tmp39_; |
| 24195 | BalaTargetValue* _tmp40_; |
| 24196 | BalaDataType* _tmp41_; |
| 24197 | BalaDataType* _tmp42_; |
| 24198 | BalaTargetValue* _tmp43_; |
| 24199 | BalaTargetValue* _tmp44_; |
| 24200 | BalaDataType* _tmp45_; |
| 24201 | BalaDataType* _tmp46_; |
| 24202 | BalaTargetValue* _tmp47_; |
| 24203 | BalaTargetValue* _tmp48_; |
| 24204 | _tmp39_ = bala_expression_get_target_value (expr); |
| 24205 | _tmp40_ = _tmp39_; |
| 24206 | _tmp41_ = bala_expression_get_value_type (expr); |
| 24207 | _tmp42_ = _tmp41_; |
| 24208 | bala_target_value_set_value_type (_tmp40_, _tmp42_); |
| 24209 | _tmp43_ = bala_expression_get_target_value (expr); |
| 24210 | _tmp44_ = _tmp43_; |
| 24211 | _tmp45_ = bala_expression_get_target_type (expr); |
| 24212 | _tmp46_ = _tmp45_; |
| 24213 | _tmp47_ = bala_ccode_base_module_transform_value (self, _tmp44_, _tmp46_, (BalaCodeNode*) expr); |
| 24214 | _tmp48_ = _tmp47_; |
| 24215 | bala_expression_set_target_value (expr, _tmp48_); |
| 24216 | _bala_target_value_unref0 (_tmp48_)((_tmp48_ == ((void*)0)) ? ((void*)0) : (_tmp48_ = (bala_target_value_unref (_tmp48_), ((void*)0)))); |
| 24217 | } |
| 24218 | _tmp49_ = bala_expression_get_target_value (expr); |
| 24219 | _tmp50_ = _tmp49_; |
| 24220 | if (_tmp50_ == NULL((void*)0)) { |
| 24221 | return; |
| 24222 | } |
| 24223 | _tmp52_ = bala_expression_get_formal_target_type (expr); |
| 24224 | _tmp53_ = _tmp52_; |
| 24225 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp53_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp53_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 24226 | BalaDataType* _tmp54_; |
| 24227 | BalaDataType* _tmp55_; |
| 24228 | _tmp54_ = bala_expression_get_target_type (expr); |
| 24229 | _tmp55_ = _tmp54_; |
| 24230 | _tmp51_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp55_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp55_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 24231 | } else { |
| 24232 | _tmp51_ = FALSE(0); |
| 24233 | } |
| 24234 | if (_tmp51_) { |
| 24235 | BalaDataType* _tmp56_; |
| 24236 | BalaDataType* _tmp57_; |
| 24237 | BalaTypeParameter* _tmp58_; |
| 24238 | BalaTypeParameter* _tmp59_; |
| 24239 | BalaSymbol* _tmp60_; |
| 24240 | BalaSymbol* _tmp61_; |
| 24241 | BalaTypeSymbol* _tmp62_; |
| 24242 | _tmp56_ = bala_expression_get_formal_target_type (expr); |
| 24243 | _tmp57_ = _tmp56_; |
| 24244 | _tmp58_ = bala_generic_type_get_type_parameter (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, BALA_TYPE_GENERIC_TYPE, BalaGenericType)(((BalaGenericType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp57_), ((bala_generic_type_get_type ())))))); |
| 24245 | _tmp59_ = _tmp58_; |
| 24246 | _tmp60_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp59_); |
| 24247 | _tmp61_ = _tmp60_; |
| 24248 | _tmp62_ = self->garray_type; |
| 24249 | if (_tmp61_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, BALA_TYPE_SYMBOL, BalaSymbol)(((BalaSymbol*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp62_), ((bala_symbol_get_type ())))))) { |
| 24250 | BalaCCodeExpression* _tmp63_; |
| 24251 | BalaDataType* _tmp64_; |
| 24252 | BalaDataType* _tmp65_; |
| 24253 | BalaCCodeExpression* _tmp66_; |
| 24254 | BalaCCodeExpression* _tmp67_; |
| 24255 | BalaTargetValue* _tmp68_; |
| 24256 | BalaTargetValue* _tmp69_; |
| 24257 | _tmp63_ = bala_get_cvalue (expr); |
| 24258 | _tmp64_ = bala_expression_get_target_type (expr); |
| 24259 | _tmp65_ = _tmp64_; |
| 24260 | _tmp66_ = bala_ccode_base_module_convert_to_generic_pointer (self, _tmp63_, _tmp65_); |
| 24261 | _tmp67_ = _tmp66_; |
| 24262 | bala_set_cvalue (expr, _tmp67_); |
| 24263 | _bala_ccode_node_unref0 (_tmp67_)((_tmp67_ == ((void*)0)) ? ((void*)0) : (_tmp67_ = (bala_ccode_node_unref (_tmp67_), ((void*)0)))); |
| 24264 | _tmp68_ = bala_expression_get_target_value (expr); |
| 24265 | _tmp69_ = _tmp68_; |
| 24266 | G_TYPE_CHECK_INSTANCE_CAST (_tmp69_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp69_), ((bala_glib_value_get_type ())))))->lvalue = FALSE(0); |
| 24267 | } |
| 24268 | } |
| 24269 | _tmp71_ = bala_expression_get_value_type (expr); |
| 24270 | _tmp72_ = _tmp71_; |
| 24271 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp72_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp72_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 24272 | BalaDataType* _tmp73_; |
| 24273 | BalaDataType* _tmp74_; |
| 24274 | gboolean _tmp75_; |
| 24275 | gboolean _tmp76_; |
| 24276 | _tmp73_ = bala_expression_get_value_type (expr); |
| 24277 | _tmp74_ = _tmp73_; |
| 24278 | _tmp75_ = bala_data_type_get_nullable (_tmp74_); |
| 24279 | _tmp76_ = _tmp75_; |
| 24280 | _tmp70_ = !_tmp76_; |
| 24281 | } else { |
| 24282 | _tmp70_ = FALSE(0); |
| 24283 | } |
| 24284 | if (!_tmp70_) { |
| 24285 | BalaTargetValue* _tmp77_; |
| 24286 | BalaTargetValue* _tmp78_; |
| 24287 | _tmp77_ = bala_expression_get_target_value (expr); |
| 24288 | _tmp78_ = _tmp77_; |
| 24289 | G_TYPE_CHECK_INSTANCE_CAST (_tmp78_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp78_), ((bala_glib_value_get_type ())))))->non_null = bala_expression_is_non_null (expr); |
| 24290 | } |
| 24291 | } else { |
| 24292 | gboolean _tmp79_ = FALSE(0); |
| 24293 | BalaDataType* _tmp80_; |
| 24294 | BalaDataType* _tmp81_; |
| 24295 | _tmp80_ = bala_expression_get_value_type (expr); |
| 24296 | _tmp81_ = _tmp80_; |
| 24297 | if (_tmp81_ != NULL((void*)0)) { |
| 24298 | _tmp79_ = bala_ccode_base_module_is_compact_class_destructor_call (expr); |
| 24299 | } else { |
| 24300 | _tmp79_ = FALSE(0); |
| 24301 | } |
| 24302 | if (_tmp79_) { |
| 24303 | BalaTargetValue* temp_value = NULL((void*)0); |
| 24304 | BalaTargetValue* _tmp82_; |
| 24305 | BalaTargetValue* _tmp83_; |
| 24306 | BalaTargetValue* _tmp84_; |
| 24307 | BalaCCodeFunction* _tmp85_; |
| 24308 | BalaCCodeFunction* _tmp86_; |
| 24309 | BalaCCodeExpression* _tmp87_; |
| 24310 | BalaCCodeConstant* _tmp88_; |
| 24311 | BalaCCodeConstant* _tmp89_; |
| 24312 | BalaTargetValue* _tmp90_; |
| 24313 | _tmp82_ = bala_expression_get_target_value (expr); |
| 24314 | _tmp83_ = _tmp82_; |
| 24315 | _tmp84_ = bala_ccode_base_module_store_temp_value (self, _tmp83_, (BalaCodeNode*) expr, NULL((void*)0)); |
| 24316 | temp_value = _tmp84_; |
| 24317 | _tmp85_ = bala_ccode_base_module_get_ccode (self); |
| 24318 | _tmp86_ = _tmp85_; |
| 24319 | _tmp87_ = bala_get_cvalue (expr); |
| 24320 | _tmp88_ = bala_ccode_constant_new ("NULL"); |
| 24321 | _tmp89_ = _tmp88_; |
| 24322 | bala_ccode_function_add_assignment (_tmp86_, _tmp87_, (BalaCCodeExpression*) _tmp89_); |
| 24323 | _bala_ccode_node_unref0 (_tmp89_)((_tmp89_ == ((void*)0)) ? ((void*)0) : (_tmp89_ = (bala_ccode_node_unref (_tmp89_), ((void*)0)))); |
| 24324 | _tmp90_ = temp_value; |
| 24325 | bala_expression_set_target_value (expr, _tmp90_); |
| 24326 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 24327 | } |
| 24328 | } |
| 24329 | } |
| 24330 | |
| 24331 | static void |
| 24332 | bala_ccode_base_module_real_visit_boolean_literal (BalaCodeVisitor* base, |
| 24333 | BalaBooleanLiteral* expr) |
| 24334 | { |
| 24335 | BalaCCodeBaseModule * self; |
| 24336 | gboolean _tmp0_; |
| 24337 | gboolean _tmp1_; |
| 24338 | BalaCCodeExpression* _tmp2_; |
| 24339 | BalaCCodeExpression* _tmp3_; |
| 24340 | self = (BalaCCodeBaseModule*) base; |
| 24341 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 24342 | _tmp0_ = bala_boolean_literal_get_value (expr); |
| 24343 | _tmp1_ = _tmp0_; |
| 24344 | _tmp2_ = bala_ccode_base_module_get_boolean_cconstant (self, _tmp1_); |
| 24345 | _tmp3_ = _tmp2_; |
| 24346 | bala_set_cvalue ((BalaExpression*) expr, _tmp3_); |
| 24347 | _bala_ccode_node_unref0 (_tmp3_)((_tmp3_ == ((void*)0)) ? ((void*)0) : (_tmp3_ = (bala_ccode_node_unref (_tmp3_), ((void*)0)))); |
| 24348 | } |
| 24349 | |
| 24350 | static void |
| 24351 | bala_ccode_base_module_real_visit_character_literal (BalaCodeVisitor* base, |
| 24352 | BalaCharacterLiteral* expr) |
| 24353 | { |
| 24354 | BalaCCodeBaseModule * self; |
| 24355 | gboolean _tmp0_ = FALSE(0); |
| 24356 | self = (BalaCCodeBaseModule*) base; |
| 24357 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 24358 | if (bala_character_literal_get_char (expr) >= ((gunichar) 0x20)) { |
| 24359 | _tmp0_ = bala_character_literal_get_char (expr) < ((gunichar) 0x80); |
| 24360 | } else { |
| 24361 | _tmp0_ = FALSE(0); |
| 24362 | } |
| 24363 | if (_tmp0_) { |
| 24364 | const gchar* _tmp1_; |
| 24365 | const gchar* _tmp2_; |
| 24366 | BalaCCodeConstant* _tmp3_; |
| 24367 | BalaCCodeConstant* _tmp4_; |
| 24368 | _tmp1_ = bala_character_literal_get_value (expr); |
| 24369 | _tmp2_ = _tmp1_; |
| 24370 | _tmp3_ = bala_ccode_constant_new (_tmp2_); |
| 24371 | _tmp4_ = _tmp3_; |
| 24372 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp4_); |
| 24373 | _bala_ccode_node_unref0 (_tmp4_)((_tmp4_ == ((void*)0)) ? ((void*)0) : (_tmp4_ = (bala_ccode_node_unref (_tmp4_), ((void*)0)))); |
| 24374 | } else { |
| 24375 | gchar* _tmp5_; |
| 24376 | gchar* _tmp6_; |
| 24377 | BalaCCodeConstant* _tmp7_; |
| 24378 | BalaCCodeConstant* _tmp8_; |
| 24379 | _tmp5_ = g_strdup_printf ("%uU", (guint) bala_character_literal_get_char (expr)); |
| 24380 | _tmp6_ = _tmp5_; |
| 24381 | _tmp7_ = bala_ccode_constant_new (_tmp6_); |
| 24382 | _tmp8_ = _tmp7_; |
| 24383 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp8_); |
| 24384 | _bala_ccode_node_unref0 (_tmp8_)((_tmp8_ == ((void*)0)) ? ((void*)0) : (_tmp8_ = (bala_ccode_node_unref (_tmp8_), ((void*)0)))); |
| 24385 | _g_free0 (_tmp6_)(_tmp6_ = (g_free (_tmp6_), ((void*)0))); |
| 24386 | } |
| 24387 | } |
| 24388 | |
| 24389 | static void |
| 24390 | bala_ccode_base_module_real_visit_integer_literal (BalaCodeVisitor* base, |
| 24391 | BalaIntegerLiteral* expr) |
| 24392 | { |
| 24393 | BalaCCodeBaseModule * self; |
| 24394 | const gchar* _tmp0_; |
| 24395 | const gchar* _tmp1_; |
| 24396 | const gchar* _tmp2_; |
| 24397 | const gchar* _tmp3_; |
| 24398 | gchar* _tmp4_; |
| 24399 | gchar* _tmp5_; |
| 24400 | BalaCCodeConstant* _tmp6_; |
| 24401 | BalaCCodeConstant* _tmp7_; |
| 24402 | self = (BalaCCodeBaseModule*) base; |
| 24403 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 24404 | _tmp0_ = bala_integer_literal_get_value (expr); |
| 24405 | _tmp1_ = _tmp0_; |
| 24406 | _tmp2_ = bala_integer_literal_get_type_suffix (expr); |
| 24407 | _tmp3_ = _tmp2_; |
| 24408 | _tmp4_ = g_strconcat (_tmp1_, _tmp3_, NULL((void*)0)); |
| 24409 | _tmp5_ = _tmp4_; |
| 24410 | _tmp6_ = bala_ccode_constant_new (_tmp5_); |
| 24411 | _tmp7_ = _tmp6_; |
| 24412 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp7_); |
| 24413 | _bala_ccode_node_unref0 (_tmp7_)((_tmp7_ == ((void*)0)) ? ((void*)0) : (_tmp7_ = (bala_ccode_node_unref (_tmp7_), ((void*)0)))); |
| 24414 | _g_free0 (_tmp5_)(_tmp5_ = (g_free (_tmp5_), ((void*)0))); |
| 24415 | } |
| 24416 | |
| 24417 | static glong |
| 24418 | string_strnlen (gchar* str, |
| 24419 | glong maxlen) |
| 24420 | { |
| 24421 | gchar* end = NULL((void*)0); |
| 24422 | gchar* _tmp0_; |
| 24423 | gchar* _tmp1_; |
| 24424 | glong result = 0L; |
| 24425 | _tmp0_ = memchr (str, 0, (gsize) maxlen); |
| 24426 | end = _tmp0_; |
| 24427 | _tmp1_ = end; |
| 24428 | if (_tmp1_ == NULL((void*)0)) { |
| 24429 | result = maxlen; |
| 24430 | return result; |
| 24431 | } else { |
| 24432 | gchar* _tmp2_; |
| 24433 | _tmp2_ = end; |
| 24434 | result = (glong) (_tmp2_ - str); |
| 24435 | return result; |
| 24436 | } |
| 24437 | } |
| 24438 | |
| 24439 | static gchar* |
| 24440 | string_substring (const gchar* self, |
| 24441 | glong offset, |
| 24442 | glong len) |
| 24443 | { |
| 24444 | glong string_length = 0L; |
| 24445 | gboolean _tmp0_ = FALSE(0); |
| 24446 | gchar* _tmp3_; |
| 24447 | gchar* result = NULL((void*)0); |
| 24448 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 24449 | if (offset >= ((glong) 0)) { |
| 24450 | _tmp0_ = len >= ((glong) 0); |
| 24451 | } else { |
| 24452 | _tmp0_ = FALSE(0); |
| 24453 | } |
| 24454 | if (_tmp0_) { |
| 24455 | string_length = string_strnlen ((gchar*) self, offset + len); |
| 24456 | } else { |
| 24457 | gint _tmp1_; |
| 24458 | gint _tmp2_; |
| 24459 | _tmp1_ = strlen (self); |
| 24460 | _tmp2_ = _tmp1_; |
| 24461 | string_length = (glong) _tmp2_; |
| 24462 | } |
| 24463 | if (offset < ((glong) 0)) { |
| 24464 | offset = string_length + offset; |
| 24465 | g_return_val_if_fail (offset >= ((glong) 0), NULL)do { if ((offset >= ((glong) 0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "offset >= ((glong) 0)" ); return (((void*)0)); } } while (0); |
| 24466 | } else { |
| 24467 | g_return_val_if_fail (offset <= string_length, NULL)do { if ((offset <= string_length)) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "offset <= string_length" ); return (((void*)0)); } } while (0); |
| 24468 | } |
| 24469 | if (len < ((glong) 0)) { |
| 24470 | len = string_length - offset; |
| 24471 | } |
| 24472 | g_return_val_if_fail ((offset + len) <= string_length, NULL)do { if (((offset + len) <= string_length)) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "(offset + len) <= string_length" ); return (((void*)0)); } } while (0); |
| 24473 | _tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len); |
| 24474 | result = _tmp3_; |
| 24475 | return result; |
| 24476 | } |
| 24477 | |
| 24478 | static gboolean |
| 24479 | string_contains (const gchar* self, |
| 24480 | const gchar* needle) |
| 24481 | { |
| 24482 | gchar* _tmp0_; |
| 24483 | gboolean result = FALSE(0); |
| 24484 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 24485 | g_return_val_if_fail (needle != NULL, FALSE)do { if ((needle != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "needle != NULL" ); return ((0)); } } while (0); |
| 24486 | _tmp0_ = strstr ((gchar*) self, (gchar*) needle); |
| 24487 | result = _tmp0_ != NULL((void*)0); |
| 24488 | return result; |
| 24489 | } |
| 24490 | |
| 24491 | static void |
| 24492 | bala_ccode_base_module_real_visit_real_literal (BalaCodeVisitor* base, |
| 24493 | BalaRealLiteral* expr) |
| 24494 | { |
| 24495 | BalaCCodeBaseModule * self; |
| 24496 | gchar* c_literal = NULL((void*)0); |
| 24497 | const gchar* _tmp0_; |
| 24498 | const gchar* _tmp1_; |
| 24499 | gchar* _tmp2_; |
| 24500 | gboolean _tmp3_ = FALSE(0); |
| 24501 | const gchar* _tmp4_; |
| 24502 | gboolean _tmp11_ = FALSE(0); |
| 24503 | gboolean _tmp12_ = FALSE(0); |
| 24504 | const gchar* _tmp13_; |
| 24505 | const gchar* _tmp28_; |
| 24506 | BalaCCodeConstant* _tmp29_; |
| 24507 | BalaCCodeConstant* _tmp30_; |
| 24508 | self = (BalaCCodeBaseModule*) base; |
Value stored to 'self' is never read | |
| 24509 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 24510 | _tmp0_ = bala_real_literal_get_value (expr); |
| 24511 | _tmp1_ = _tmp0_; |
| 24512 | _tmp2_ = g_strdup (_tmp1_); |
| 24513 | c_literal = _tmp2_; |
| 24514 | _tmp4_ = c_literal; |
| 24515 | if (g_str_has_suffix (_tmp4_, "d")) { |
| 24516 | _tmp3_ = TRUE(!(0)); |
| 24517 | } else { |
| 24518 | const gchar* _tmp5_; |
| 24519 | _tmp5_ = c_literal; |
| 24520 | _tmp3_ = g_str_has_suffix (_tmp5_, "D"); |
| 24521 | } |
| 24522 | if (_tmp3_) { |
| 24523 | const gchar* _tmp6_; |
| 24524 | const gchar* _tmp7_; |
| 24525 | gint _tmp8_; |
| 24526 | gint _tmp9_; |
| 24527 | gchar* _tmp10_; |
| 24528 | _tmp6_ = c_literal; |
| 24529 | _tmp7_ = c_literal; |
| 24530 | _tmp8_ = strlen (_tmp7_); |
| 24531 | _tmp9_ = _tmp8_; |
| 24532 | _tmp10_ = string_substring (_tmp6_, (glong) 0, (glong) (_tmp9_ - 1)); |
| 24533 | _g_free0 (c_literal)(c_literal = (g_free (c_literal), ((void*)0))); |
| 24534 | c_literal = _tmp10_; |
| 24535 | } |
| 24536 | _tmp13_ = c_literal; |
| 24537 | if (string_contains (_tmp13_, ".")) { |
| 24538 | _tmp12_ = TRUE(!(0)); |
| 24539 | } else { |
| 24540 | const gchar* _tmp14_; |
| 24541 | _tmp14_ = c_literal; |
| 24542 | _tmp12_ = string_contains (_tmp14_, "e"); |
| 24543 | } |
| 24544 | if (_tmp12_) { |
| 24545 | _tmp11_ = TRUE(!(0)); |
| 24546 | } else { |
| 24547 | const gchar* _tmp15_; |
| 24548 | _tmp15_ = c_literal; |
| 24549 | _tmp11_ = string_contains (_tmp15_, "E"); |
| 24550 | } |
| 24551 | if (!_tmp11_) { |
| 24552 | gboolean _tmp16_ = FALSE(0); |
| 24553 | const gchar* _tmp17_; |
| 24554 | _tmp17_ = c_literal; |
| 24555 | if (string_contains (_tmp17_, "f")) { |
| 24556 | _tmp16_ = TRUE(!(0)); |
| 24557 | } else { |
| 24558 | const gchar* _tmp18_; |
| 24559 | _tmp18_ = c_literal; |
| 24560 | _tmp16_ = string_contains (_tmp18_, "F"); |
| 24561 | } |
| 24562 | if (_tmp16_) { |
| 24563 | const gchar* _tmp19_; |
| 24564 | const gchar* _tmp20_; |
| 24565 | gint _tmp21_; |
| 24566 | gint _tmp22_; |
| 24567 | gchar* _tmp23_; |
| 24568 | gchar* _tmp24_; |
| 24569 | gchar* _tmp25_; |
| 24570 | _tmp19_ = c_literal; |
| 24571 | _tmp20_ = c_literal; |
| 24572 | _tmp21_ = strlen (_tmp20_); |
| 24573 | _tmp22_ = _tmp21_; |
| 24574 | _tmp23_ = string_substring (_tmp19_, (glong) 0, (glong) (_tmp22_ - 1)); |
| 24575 | _tmp24_ = _tmp23_; |
| 24576 | _tmp25_ = g_strconcat (_tmp24_, ".f", NULL((void*)0)); |
| 24577 | _g_free0 (c_literal)(c_literal = (g_free (c_literal), ((void*)0))); |
| 24578 | c_literal = _tmp25_; |
| 24579 | _g_free0 (_tmp24_)(_tmp24_ = (g_free (_tmp24_), ((void*)0))); |
| 24580 | } else { |
| 24581 | const gchar* _tmp26_; |
| 24582 | gchar* _tmp27_; |
| 24583 | _tmp26_ = c_literal; |
| 24584 | _tmp27_ = g_strconcat (_tmp26_, ".", NULL((void*)0)); |
| 24585 | _g_free0 (c_literal)(c_literal = (g_free (c_literal), ((void*)0))); |
| 24586 | c_literal = _tmp27_; |
| 24587 | } |
| 24588 | } |
| 24589 | _tmp28_ = c_literal; |
| 24590 | _tmp29_ = bala_ccode_constant_new (_tmp28_); |
| 24591 | _tmp30_ = _tmp29_; |
| 24592 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp30_); |
| 24593 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 24594 | _g_free0 (c_literal)(c_literal = (g_free (c_literal), ((void*)0))); |
| 24595 | } |
| 24596 | |
| 24597 | static void |
| 24598 | bala_ccode_base_module_real_visit_string_literal (BalaCodeVisitor* base, |
| 24599 | BalaStringLiteral* expr) |
| 24600 | { |
| 24601 | BalaCCodeBaseModule * self; |
| 24602 | const gchar* _tmp0_; |
| 24603 | const gchar* _tmp1_; |
| 24604 | gchar* _tmp2_; |
| 24605 | gchar* _tmp3_; |
| 24606 | BalaCCodeConstant* _tmp4_; |
| 24607 | BalaCCodeConstant* _tmp5_; |
| 24608 | gboolean _tmp6_; |
| 24609 | gboolean _tmp7_; |
| 24610 | self = (BalaCCodeBaseModule*) base; |
| 24611 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 24612 | _tmp0_ = bala_string_literal_get_value (expr); |
| 24613 | _tmp1_ = _tmp0_; |
| 24614 | _tmp2_ = string_replace (_tmp1_, "\n", "\\n"); |
| 24615 | _tmp3_ = _tmp2_; |
| 24616 | _tmp4_ = bala_ccode_constant_new_string (_tmp3_); |
| 24617 | _tmp5_ = _tmp4_; |
| 24618 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp5_); |
| 24619 | _bala_ccode_node_unref0 (_tmp5_)((_tmp5_ == ((void*)0)) ? ((void*)0) : (_tmp5_ = (bala_ccode_node_unref (_tmp5_), ((void*)0)))); |
| 24620 | _g_free0 (_tmp3_)(_tmp3_ = (g_free (_tmp3_), ((void*)0))); |
| 24621 | _tmp6_ = bala_string_literal_get_translate (expr); |
| 24622 | _tmp7_ = _tmp6_; |
| 24623 | if (_tmp7_) { |
| 24624 | BalaCCodeFunctionCall* translate = NULL((void*)0); |
| 24625 | BalaCCodeIdentifier* _tmp8_; |
| 24626 | BalaCCodeIdentifier* _tmp9_; |
| 24627 | BalaCCodeFunctionCall* _tmp10_; |
| 24628 | BalaCCodeFunctionCall* _tmp11_; |
| 24629 | BalaCCodeFunctionCall* _tmp12_; |
| 24630 | BalaCCodeExpression* _tmp13_; |
| 24631 | BalaCCodeFunctionCall* _tmp14_; |
| 24632 | _tmp8_ = bala_ccode_identifier_new ("_"); |
| 24633 | _tmp9_ = _tmp8_; |
| 24634 | _tmp10_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp9_); |
| 24635 | _tmp11_ = _tmp10_; |
| 24636 | _bala_ccode_node_unref0 (_tmp9_)((_tmp9_ == ((void*)0)) ? ((void*)0) : (_tmp9_ = (bala_ccode_node_unref (_tmp9_), ((void*)0)))); |
| 24637 | translate = _tmp11_; |
| 24638 | _tmp12_ = translate; |
| 24639 | _tmp13_ = bala_get_cvalue ((BalaExpression*) expr); |
| 24640 | bala_ccode_function_call_add_argument (_tmp12_, _tmp13_); |
| 24641 | _tmp14_ = translate; |
| 24642 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp14_); |
| 24643 | _bala_ccode_node_unref0 (translate)((translate == ((void*)0)) ? ((void*)0) : (translate = (bala_ccode_node_unref (translate), ((void*)0)))); |
| 24644 | } |
| 24645 | } |
| 24646 | |
| 24647 | static void |
| 24648 | bala_ccode_base_module_real_visit_regex_literal (BalaCodeVisitor* base, |
| 24649 | BalaRegexLiteral* expr) |
| 24650 | { |
| 24651 | BalaCCodeBaseModule * self; |
| 24652 | gchar** parts = NULL((void*)0); |
| 24653 | const gchar* _tmp0_; |
| 24654 | const gchar* _tmp1_; |
| 24655 | gchar** _tmp2_; |
| 24656 | gchar** _tmp3_; |
| 24657 | gint parts_length1; |
| 24658 | gint _parts_size_; |
| 24659 | gchar* re = NULL((void*)0); |
| 24660 | gchar** _tmp4_; |
| 24661 | gint _tmp4__length1; |
| 24662 | const gchar* _tmp5_; |
| 24663 | gchar* _tmp6_; |
| 24664 | gchar* flags = NULL((void*)0); |
| 24665 | gchar* _tmp7_; |
| 24666 | gchar** _tmp8_; |
| 24667 | gint _tmp8__length1; |
| 24668 | const gchar* _tmp9_; |
| 24669 | gchar** _tmp12_; |
| 24670 | gint _tmp12__length1; |
| 24671 | const gchar* _tmp13_; |
| 24672 | gchar** _tmp16_; |
| 24673 | gint _tmp16__length1; |
| 24674 | const gchar* _tmp17_; |
| 24675 | gchar** _tmp20_; |
| 24676 | gint _tmp20__length1; |
| 24677 | const gchar* _tmp21_; |
| 24678 | BalaCCodeDeclaration* _cdecl_ = NULL((void*)0); |
| 24679 | BalaCCodeDeclaration* _tmp24_; |
| 24680 | gchar* cname = NULL((void*)0); |
| 24681 | gchar* _tmp25_; |
| 24682 | gint _tmp90_; |
| 24683 | BalaCCodeDeclaration* _tmp91_; |
| 24684 | const gchar* _tmp92_; |
| 24685 | gchar* _tmp93_; |
| 24686 | gchar* _tmp94_; |
| 24687 | BalaCCodeVariableDeclarator* _tmp95_; |
| 24688 | BalaCCodeVariableDeclarator* _tmp96_; |
| 24689 | BalaCCodeDeclaration* _tmp97_; |
| 24690 | BalaCCodeConstant* regex_const = NULL((void*)0); |
| 24691 | const gchar* _tmp98_; |
| 24692 | const gchar* _tmp99_; |
| 24693 | const gchar* _tmp100_; |
| 24694 | gchar* _tmp101_; |
| 24695 | gchar* _tmp102_; |
| 24696 | BalaCCodeConstant* _tmp103_; |
| 24697 | BalaCCodeConstant* _tmp104_; |
| 24698 | BalaCCodeFile* _tmp105_; |
| 24699 | BalaCCodeDeclaration* _tmp106_; |
| 24700 | self = (BalaCCodeBaseModule*) base; |
| 24701 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 24702 | _tmp0_ = bala_regex_literal_get_value (expr); |
| 24703 | _tmp1_ = _tmp0_; |
| 24704 | _tmp3_ = _tmp2_ = g_strsplit (_tmp1_, "/", 3); |
| 24705 | parts = _tmp3_; |
| 24706 | parts_length1 = _bala_array_length (_tmp2_); |
| 24707 | _parts_size_ = parts_length1; |
| 24708 | _tmp4_ = parts; |
| 24709 | _tmp4__length1 = parts_length1; |
| 24710 | _tmp5_ = _tmp4_[2]; |
| 24711 | _tmp6_ = g_strescape (_tmp5_, ""); |
| 24712 | re = _tmp6_; |
| 24713 | _tmp7_ = g_strdup ("0"); |
| 24714 | flags = _tmp7_; |
| 24715 | _tmp8_ = parts; |
| 24716 | _tmp8__length1 = parts_length1; |
| 24717 | _tmp9_ = _tmp8_[1]; |
| 24718 | if (string_contains (_tmp9_, "i")) { |
| 24719 | const gchar* _tmp10_; |
| 24720 | gchar* _tmp11_; |
| 24721 | _tmp10_ = flags; |
| 24722 | _tmp11_ = g_strconcat (_tmp10_, " | G_REGEX_CASELESS", NULL((void*)0)); |
| 24723 | _g_free0 (flags)(flags = (g_free (flags), ((void*)0))); |
| 24724 | flags = _tmp11_; |
| 24725 | } |
| 24726 | _tmp12_ = parts; |
| 24727 | _tmp12__length1 = parts_length1; |
| 24728 | _tmp13_ = _tmp12_[1]; |
| 24729 | if (string_contains (_tmp13_, "m")) { |
| 24730 | const gchar* _tmp14_; |
| 24731 | gchar* _tmp15_; |
| 24732 | _tmp14_ = flags; |
| 24733 | _tmp15_ = g_strconcat (_tmp14_, " | G_REGEX_MULTILINE", NULL((void*)0)); |
| 24734 | _g_free0 (flags)(flags = (g_free (flags), ((void*)0))); |
| 24735 | flags = _tmp15_; |
| 24736 | } |
| 24737 | _tmp16_ = parts; |
| 24738 | _tmp16__length1 = parts_length1; |
| 24739 | _tmp17_ = _tmp16_[1]; |
| 24740 | if (string_contains (_tmp17_, "s")) { |
| 24741 | const gchar* _tmp18_; |
| 24742 | gchar* _tmp19_; |
| 24743 | _tmp18_ = flags; |
| 24744 | _tmp19_ = g_strconcat (_tmp18_, " | G_REGEX_DOTALL", NULL((void*)0)); |
| 24745 | _g_free0 (flags)(flags = (g_free (flags), ((void*)0))); |
| 24746 | flags = _tmp19_; |
| 24747 | } |
| 24748 | _tmp20_ = parts; |
| 24749 | _tmp20__length1 = parts_length1; |
| 24750 | _tmp21_ = _tmp20_[1]; |
| 24751 | if (string_contains (_tmp21_, "x")) { |
| 24752 | const gchar* _tmp22_; |
| 24753 | gchar* _tmp23_; |
| 24754 | _tmp22_ = flags; |
| 24755 | _tmp23_ = g_strconcat (_tmp22_, " | G_REGEX_EXTENDED", NULL((void*)0)); |
| 24756 | _g_free0 (flags)(flags = (g_free (flags), ((void*)0))); |
| 24757 | flags = _tmp23_; |
| 24758 | } |
| 24759 | _tmp24_ = bala_ccode_declaration_new ("GRegex*"); |
| 24760 | _cdecl_ = _tmp24_; |
| 24761 | _tmp25_ = g_strdup_printf ("_tmp_regex_%d", self->next_regex_id); |
| 24762 | cname = _tmp25_; |
| 24763 | if (self->next_regex_id == 0) { |
| 24764 | BalaCCodeFunction* fun = NULL((void*)0); |
| 24765 | BalaCCodeFunction* _tmp26_; |
| 24766 | BalaCCodeFunction* _tmp27_; |
| 24767 | BalaCCodeFunction* _tmp28_; |
| 24768 | BalaCCodeParameter* _tmp29_; |
| 24769 | BalaCCodeParameter* _tmp30_; |
| 24770 | BalaCCodeFunction* _tmp31_; |
| 24771 | BalaCCodeParameter* _tmp32_; |
| 24772 | BalaCCodeParameter* _tmp33_; |
| 24773 | BalaCCodeFunction* _tmp34_; |
| 24774 | BalaCCodeParameter* _tmp35_; |
| 24775 | BalaCCodeParameter* _tmp36_; |
| 24776 | BalaCCodeFunction* _tmp37_; |
| 24777 | BalaCCodeFunctionCall* once_enter_call = NULL((void*)0); |
| 24778 | BalaCCodeIdentifier* _tmp38_; |
| 24779 | BalaCCodeIdentifier* _tmp39_; |
| 24780 | BalaCCodeFunctionCall* _tmp40_; |
| 24781 | BalaCCodeFunctionCall* _tmp41_; |
| 24782 | BalaCCodeFunctionCall* _tmp42_; |
| 24783 | BalaCCodeConstant* _tmp43_; |
| 24784 | BalaCCodeConstant* _tmp44_; |
| 24785 | BalaCCodeFunction* _tmp45_; |
| 24786 | BalaCCodeFunction* _tmp46_; |
| 24787 | BalaCCodeFunctionCall* _tmp47_; |
| 24788 | BalaCCodeFunctionCall* regex_new_call = NULL((void*)0); |
| 24789 | BalaCCodeIdentifier* _tmp48_; |
| 24790 | BalaCCodeIdentifier* _tmp49_; |
| 24791 | BalaCCodeFunctionCall* _tmp50_; |
| 24792 | BalaCCodeFunctionCall* _tmp51_; |
| 24793 | BalaCCodeFunctionCall* _tmp52_; |
| 24794 | BalaCCodeConstant* _tmp53_; |
| 24795 | BalaCCodeConstant* _tmp54_; |
| 24796 | BalaCCodeFunctionCall* _tmp55_; |
| 24797 | BalaCCodeConstant* _tmp56_; |
| 24798 | BalaCCodeConstant* _tmp57_; |
| 24799 | BalaCCodeFunctionCall* _tmp58_; |
| 24800 | BalaCCodeConstant* _tmp59_; |
| 24801 | BalaCCodeConstant* _tmp60_; |
| 24802 | BalaCCodeFunctionCall* _tmp61_; |
| 24803 | BalaCCodeConstant* _tmp62_; |
| 24804 | BalaCCodeConstant* _tmp63_; |
| 24805 | BalaCCodeFunction* _tmp64_; |
| 24806 | BalaCCodeFunction* _tmp65_; |
| 24807 | BalaCCodeIdentifier* _tmp66_; |
| 24808 | BalaCCodeIdentifier* _tmp67_; |
| 24809 | BalaCCodeFunctionCall* _tmp68_; |
| 24810 | BalaCCodeFunctionCall* once_leave_call = NULL((void*)0); |
| 24811 | BalaCCodeIdentifier* _tmp69_; |
| 24812 | BalaCCodeIdentifier* _tmp70_; |
| 24813 | BalaCCodeFunctionCall* _tmp71_; |
| 24814 | BalaCCodeFunctionCall* _tmp72_; |
| 24815 | BalaCCodeFunctionCall* _tmp73_; |
| 24816 | BalaCCodeConstant* _tmp74_; |
| 24817 | BalaCCodeConstant* _tmp75_; |
| 24818 | BalaCCodeFunctionCall* _tmp76_; |
| 24819 | BalaCCodeConstant* _tmp77_; |
| 24820 | BalaCCodeConstant* _tmp78_; |
| 24821 | BalaCCodeFunction* _tmp79_; |
| 24822 | BalaCCodeFunction* _tmp80_; |
| 24823 | BalaCCodeFunctionCall* _tmp81_; |
| 24824 | BalaCCodeFunction* _tmp82_; |
| 24825 | BalaCCodeFunction* _tmp83_; |
| 24826 | BalaCCodeFunction* _tmp84_; |
| 24827 | BalaCCodeFunction* _tmp85_; |
| 24828 | BalaCCodeIdentifier* _tmp86_; |
| 24829 | BalaCCodeIdentifier* _tmp87_; |
| 24830 | BalaCCodeFile* _tmp88_; |
| 24831 | BalaCCodeFunction* _tmp89_; |
| 24832 | _tmp26_ = bala_ccode_function_new ("_thread_safe_regex_init", "GRegex*"); |
| 24833 | fun = _tmp26_; |
| 24834 | _tmp27_ = fun; |
| 24835 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp27_, BALA_CCODE_MODIFIERS_STATIC | BALA_CCODE_MODIFIERS_INLINE); |
| 24836 | _tmp28_ = fun; |
| 24837 | _tmp29_ = bala_ccode_parameter_new ("re", "GRegex**"); |
| 24838 | _tmp30_ = _tmp29_; |
| 24839 | bala_ccode_function_add_parameter (_tmp28_, _tmp30_); |
| 24840 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 24841 | _tmp31_ = fun; |
| 24842 | _tmp32_ = bala_ccode_parameter_new ("pattern", "const gchar *"); |
| 24843 | _tmp33_ = _tmp32_; |
| 24844 | bala_ccode_function_add_parameter (_tmp31_, _tmp33_); |
| 24845 | _bala_ccode_node_unref0 (_tmp33_)((_tmp33_ == ((void*)0)) ? ((void*)0) : (_tmp33_ = (bala_ccode_node_unref (_tmp33_), ((void*)0)))); |
| 24846 | _tmp34_ = fun; |
| 24847 | _tmp35_ = bala_ccode_parameter_new ("compile_flags", "GRegexCompileFlags"); |
| 24848 | _tmp36_ = _tmp35_; |
| 24849 | bala_ccode_function_add_parameter (_tmp34_, _tmp36_); |
| 24850 | _bala_ccode_node_unref0 (_tmp36_)((_tmp36_ == ((void*)0)) ? ((void*)0) : (_tmp36_ = (bala_ccode_node_unref (_tmp36_), ((void*)0)))); |
| 24851 | _tmp37_ = fun; |
| 24852 | bala_ccode_base_module_push_function (self, _tmp37_); |
| 24853 | _tmp38_ = bala_ccode_identifier_new ("g_once_init_enter"); |
| 24854 | _tmp39_ = _tmp38_; |
| 24855 | _tmp40_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp39_); |
| 24856 | _tmp41_ = _tmp40_; |
| 24857 | _bala_ccode_node_unref0 (_tmp39_)((_tmp39_ == ((void*)0)) ? ((void*)0) : (_tmp39_ = (bala_ccode_node_unref (_tmp39_), ((void*)0)))); |
| 24858 | once_enter_call = _tmp41_; |
| 24859 | _tmp42_ = once_enter_call; |
| 24860 | _tmp43_ = bala_ccode_constant_new ("(volatile gsize*) re"); |
| 24861 | _tmp44_ = _tmp43_; |
| 24862 | bala_ccode_function_call_add_argument (_tmp42_, (BalaCCodeExpression*) _tmp44_); |
| 24863 | _bala_ccode_node_unref0 (_tmp44_)((_tmp44_ == ((void*)0)) ? ((void*)0) : (_tmp44_ = (bala_ccode_node_unref (_tmp44_), ((void*)0)))); |
| 24864 | _tmp45_ = bala_ccode_base_module_get_ccode (self); |
| 24865 | _tmp46_ = _tmp45_; |
| 24866 | _tmp47_ = once_enter_call; |
| 24867 | bala_ccode_function_open_if (_tmp46_, (BalaCCodeExpression*) _tmp47_); |
| 24868 | _tmp48_ = bala_ccode_identifier_new ("g_regex_new"); |
| 24869 | _tmp49_ = _tmp48_; |
| 24870 | _tmp50_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp49_); |
| 24871 | _tmp51_ = _tmp50_; |
| 24872 | _bala_ccode_node_unref0 (_tmp49_)((_tmp49_ == ((void*)0)) ? ((void*)0) : (_tmp49_ = (bala_ccode_node_unref (_tmp49_), ((void*)0)))); |
| 24873 | regex_new_call = _tmp51_; |
| 24874 | _tmp52_ = regex_new_call; |
| 24875 | _tmp53_ = bala_ccode_constant_new ("pattern"); |
| 24876 | _tmp54_ = _tmp53_; |
| 24877 | bala_ccode_function_call_add_argument (_tmp52_, (BalaCCodeExpression*) _tmp54_); |
| 24878 | _bala_ccode_node_unref0 (_tmp54_)((_tmp54_ == ((void*)0)) ? ((void*)0) : (_tmp54_ = (bala_ccode_node_unref (_tmp54_), ((void*)0)))); |
| 24879 | _tmp55_ = regex_new_call; |
| 24880 | _tmp56_ = bala_ccode_constant_new ("compile_flags"); |
| 24881 | _tmp57_ = _tmp56_; |
| 24882 | bala_ccode_function_call_add_argument (_tmp55_, (BalaCCodeExpression*) _tmp57_); |
| 24883 | _bala_ccode_node_unref0 (_tmp57_)((_tmp57_ == ((void*)0)) ? ((void*)0) : (_tmp57_ = (bala_ccode_node_unref (_tmp57_), ((void*)0)))); |
| 24884 | _tmp58_ = regex_new_call; |
| 24885 | _tmp59_ = bala_ccode_constant_new ("0"); |
| 24886 | _tmp60_ = _tmp59_; |
| 24887 | bala_ccode_function_call_add_argument (_tmp58_, (BalaCCodeExpression*) _tmp60_); |
| 24888 | _bala_ccode_node_unref0 (_tmp60_)((_tmp60_ == ((void*)0)) ? ((void*)0) : (_tmp60_ = (bala_ccode_node_unref (_tmp60_), ((void*)0)))); |
| 24889 | _tmp61_ = regex_new_call; |
| 24890 | _tmp62_ = bala_ccode_constant_new ("NULL"); |
| 24891 | _tmp63_ = _tmp62_; |
| 24892 | bala_ccode_function_call_add_argument (_tmp61_, (BalaCCodeExpression*) _tmp63_); |
| 24893 | _bala_ccode_node_unref0 (_tmp63_)((_tmp63_ == ((void*)0)) ? ((void*)0) : (_tmp63_ = (bala_ccode_node_unref (_tmp63_), ((void*)0)))); |
| 24894 | _tmp64_ = bala_ccode_base_module_get_ccode (self); |
| 24895 | _tmp65_ = _tmp64_; |
| 24896 | _tmp66_ = bala_ccode_identifier_new ("GRegex* val"); |
| 24897 | _tmp67_ = _tmp66_; |
| 24898 | _tmp68_ = regex_new_call; |
| 24899 | bala_ccode_function_add_assignment (_tmp65_, (BalaCCodeExpression*) _tmp67_, (BalaCCodeExpression*) _tmp68_); |
| 24900 | _bala_ccode_node_unref0 (_tmp67_)((_tmp67_ == ((void*)0)) ? ((void*)0) : (_tmp67_ = (bala_ccode_node_unref (_tmp67_), ((void*)0)))); |
| 24901 | _tmp69_ = bala_ccode_identifier_new ("g_once_init_leave"); |
| 24902 | _tmp70_ = _tmp69_; |
| 24903 | _tmp71_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp70_); |
| 24904 | _tmp72_ = _tmp71_; |
| 24905 | _bala_ccode_node_unref0 (_tmp70_)((_tmp70_ == ((void*)0)) ? ((void*)0) : (_tmp70_ = (bala_ccode_node_unref (_tmp70_), ((void*)0)))); |
| 24906 | once_leave_call = _tmp72_; |
| 24907 | _tmp73_ = once_leave_call; |
| 24908 | _tmp74_ = bala_ccode_constant_new ("(volatile gsize*) re"); |
| 24909 | _tmp75_ = _tmp74_; |
| 24910 | bala_ccode_function_call_add_argument (_tmp73_, (BalaCCodeExpression*) _tmp75_); |
| 24911 | _bala_ccode_node_unref0 (_tmp75_)((_tmp75_ == ((void*)0)) ? ((void*)0) : (_tmp75_ = (bala_ccode_node_unref (_tmp75_), ((void*)0)))); |
| 24912 | _tmp76_ = once_leave_call; |
| 24913 | _tmp77_ = bala_ccode_constant_new ("(gsize) val"); |
| 24914 | _tmp78_ = _tmp77_; |
| 24915 | bala_ccode_function_call_add_argument (_tmp76_, (BalaCCodeExpression*) _tmp78_); |
| 24916 | _bala_ccode_node_unref0 (_tmp78_)((_tmp78_ == ((void*)0)) ? ((void*)0) : (_tmp78_ = (bala_ccode_node_unref (_tmp78_), ((void*)0)))); |
| 24917 | _tmp79_ = bala_ccode_base_module_get_ccode (self); |
| 24918 | _tmp80_ = _tmp79_; |
| 24919 | _tmp81_ = once_leave_call; |
| 24920 | bala_ccode_function_add_expression (_tmp80_, (BalaCCodeExpression*) _tmp81_); |
| 24921 | _tmp82_ = bala_ccode_base_module_get_ccode (self); |
| 24922 | _tmp83_ = _tmp82_; |
| 24923 | bala_ccode_function_close (_tmp83_); |
| 24924 | _tmp84_ = bala_ccode_base_module_get_ccode (self); |
| 24925 | _tmp85_ = _tmp84_; |
| 24926 | _tmp86_ = bala_ccode_identifier_new ("*re"); |
| 24927 | _tmp87_ = _tmp86_; |
| 24928 | bala_ccode_function_add_return (_tmp85_, (BalaCCodeExpression*) _tmp87_); |
| 24929 | _bala_ccode_node_unref0 (_tmp87_)((_tmp87_ == ((void*)0)) ? ((void*)0) : (_tmp87_ = (bala_ccode_node_unref (_tmp87_), ((void*)0)))); |
| 24930 | bala_ccode_base_module_pop_function (self); |
| 24931 | _tmp88_ = self->cfile; |
| 24932 | _tmp89_ = fun; |
| 24933 | bala_ccode_file_add_function (_tmp88_, _tmp89_); |
| 24934 | _bala_ccode_node_unref0 (once_leave_call)((once_leave_call == ((void*)0)) ? ((void*)0) : (once_leave_call = (bala_ccode_node_unref (once_leave_call), ((void*)0)))); |
| 24935 | _bala_ccode_node_unref0 (regex_new_call)((regex_new_call == ((void*)0)) ? ((void*)0) : (regex_new_call = (bala_ccode_node_unref (regex_new_call), ((void*)0)))); |
| 24936 | _bala_ccode_node_unref0 (once_enter_call)((once_enter_call == ((void*)0)) ? ((void*)0) : (once_enter_call = (bala_ccode_node_unref (once_enter_call), ((void*)0)))); |
| 24937 | _bala_ccode_node_unref0 (fun)((fun == ((void*)0)) ? ((void*)0) : (fun = (bala_ccode_node_unref (fun), ((void*)0)))); |
| 24938 | } |
| 24939 | _tmp90_ = self->next_regex_id; |
| 24940 | self->next_regex_id = _tmp90_ + 1; |
| 24941 | _tmp91_ = _cdecl_; |
| 24942 | _tmp92_ = cname; |
| 24943 | _tmp93_ = g_strconcat (_tmp92_, " = NULL", NULL((void*)0)); |
| 24944 | _tmp94_ = _tmp93_; |
| 24945 | _tmp95_ = bala_ccode_variable_declarator_new (_tmp94_, NULL((void*)0), NULL((void*)0)); |
| 24946 | _tmp96_ = _tmp95_; |
| 24947 | bala_ccode_declaration_add_declarator (_tmp91_, (BalaCCodeDeclarator*) _tmp96_); |
| 24948 | _bala_ccode_node_unref0 (_tmp96_)((_tmp96_ == ((void*)0)) ? ((void*)0) : (_tmp96_ = (bala_ccode_node_unref (_tmp96_), ((void*)0)))); |
| 24949 | _g_free0 (_tmp94_)(_tmp94_ = (g_free (_tmp94_), ((void*)0))); |
| 24950 | _tmp97_ = _cdecl_; |
| 24951 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp97_, BALA_CCODE_MODIFIERS_STATIC); |
| 24952 | _tmp98_ = cname; |
| 24953 | _tmp99_ = re; |
| 24954 | _tmp100_ = flags; |
| 24955 | _tmp101_ = g_strdup_printf ("_thread_safe_regex_init (&%s, \"%s\", %s)", _tmp98_, _tmp99_, _tmp100_); |
| 24956 | _tmp102_ = _tmp101_; |
| 24957 | _tmp103_ = bala_ccode_constant_new (_tmp102_); |
| 24958 | _tmp104_ = _tmp103_; |
| 24959 | _g_free0 (_tmp102_)(_tmp102_ = (g_free (_tmp102_), ((void*)0))); |
| 24960 | regex_const = _tmp104_; |
| 24961 | _tmp105_ = self->cfile; |
| 24962 | _tmp106_ = _cdecl_; |
| 24963 | bala_ccode_file_add_constant_declaration (_tmp105_, (BalaCCodeNode*) _tmp106_); |
| 24964 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) regex_const); |
| 24965 | _bala_ccode_node_unref0 (regex_const)((regex_const == ((void*)0)) ? ((void*)0) : (regex_const = (bala_ccode_node_unref (regex_const), ((void*)0)))); |
| 24966 | _g_free0 (cname)(cname = (g_free (cname), ((void*)0))); |
| 24967 | _bala_ccode_node_unref0 (_cdecl_)((_cdecl_ == ((void*)0)) ? ((void*)0) : (_cdecl_ = (bala_ccode_node_unref (_cdecl_), ((void*)0)))); |
| 24968 | _g_free0 (flags)(flags = (g_free (flags), ((void*)0))); |
| 24969 | _g_free0 (re)(re = (g_free (re), ((void*)0))); |
| 24970 | parts = (_bala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL((void*)0)); |
| 24971 | } |
| 24972 | |
| 24973 | static void |
| 24974 | bala_ccode_base_module_real_visit_null_literal (BalaCodeVisitor* base, |
| 24975 | BalaNullLiteral* expr) |
| 24976 | { |
| 24977 | BalaCCodeBaseModule * self; |
| 24978 | BalaCodeContext* _tmp0_; |
| 24979 | BalaProfile _tmp1_; |
| 24980 | BalaProfile _tmp2_; |
| 24981 | BalaCCodeConstant* _tmp5_; |
| 24982 | BalaCCodeConstant* _tmp6_; |
| 24983 | BalaArrayType* array_type = NULL((void*)0); |
| 24984 | BalaDataType* _tmp7_; |
| 24985 | BalaDataType* _tmp8_; |
| 24986 | BalaArrayType* _tmp9_; |
| 24987 | BalaDelegateType* delegate_type = NULL((void*)0); |
| 24988 | BalaDataType* _tmp10_; |
| 24989 | BalaDataType* _tmp11_; |
| 24990 | BalaDelegateType* _tmp12_; |
| 24991 | BalaArrayType* _tmp13_; |
| 24992 | self = (BalaCCodeBaseModule*) base; |
| 24993 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 24994 | _tmp0_ = self->priv->_context; |
| 24995 | _tmp1_ = bala_code_context_get_profile (_tmp0_); |
| 24996 | _tmp2_ = _tmp1_; |
| 24997 | if (_tmp2_ == BALA_PROFILE_GOBJECT) { |
| 24998 | BalaCCodeFile* _tmp3_; |
| 24999 | _tmp3_ = self->cfile; |
| 25000 | bala_ccode_file_add_include (_tmp3_, "glib.h", FALSE(0)); |
| 25001 | } else { |
| 25002 | BalaCCodeFile* _tmp4_; |
| 25003 | _tmp4_ = self->cfile; |
| 25004 | bala_ccode_file_add_include (_tmp4_, "stddef.h", FALSE(0)); |
| 25005 | } |
| 25006 | _tmp5_ = bala_ccode_constant_new ("NULL"); |
| 25007 | _tmp6_ = _tmp5_; |
| 25008 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp6_); |
| 25009 | _bala_ccode_node_unref0 (_tmp6_)((_tmp6_ == ((void*)0)) ? ((void*)0) : (_tmp6_ = (bala_ccode_node_unref (_tmp6_), ((void*)0)))); |
| 25010 | _tmp7_ = bala_expression_get_target_type ((BalaExpression*) expr); |
| 25011 | _tmp8_ = _tmp7_; |
| 25012 | _tmp9_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp8_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) _tmp8_) : NULL((void*)0)); |
| 25013 | array_type = _tmp9_; |
| 25014 | _tmp10_ = bala_expression_get_target_type ((BalaExpression*) expr); |
| 25015 | _tmp11_ = _tmp10_; |
| 25016 | _tmp12_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp11_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaDelegateType*) _tmp11_) : NULL((void*)0)); |
| 25017 | delegate_type = _tmp12_; |
| 25018 | _tmp13_ = array_type; |
| 25019 | if (_tmp13_ != NULL((void*)0)) { |
| 25020 | { |
| 25021 | gint dim = 0; |
| 25022 | dim = 1; |
| 25023 | { |
| 25024 | gboolean _tmp14_ = FALSE(0); |
| 25025 | _tmp14_ = TRUE(!(0)); |
| 25026 | while (TRUE(!(0))) { |
| 25027 | BalaArrayType* _tmp16_; |
| 25028 | gint _tmp17_; |
| 25029 | gint _tmp18_; |
| 25030 | BalaCCodeConstant* _tmp19_; |
| 25031 | BalaCCodeConstant* _tmp20_; |
| 25032 | if (!_tmp14_) { |
| 25033 | gint _tmp15_; |
| 25034 | _tmp15_ = dim; |
| 25035 | dim = _tmp15_ + 1; |
| 25036 | } |
| 25037 | _tmp14_ = FALSE(0); |
| 25038 | _tmp16_ = array_type; |
| 25039 | _tmp17_ = bala_array_type_get_rank (_tmp16_); |
| 25040 | _tmp18_ = _tmp17_; |
| 25041 | if (!(dim <= _tmp18_)) { |
| 25042 | break; |
| 25043 | } |
| 25044 | _tmp19_ = bala_ccode_constant_new ("0"); |
| 25045 | _tmp20_ = _tmp19_; |
| 25046 | bala_append_array_length ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp20_); |
| 25047 | _bala_ccode_node_unref0 (_tmp20_)((_tmp20_ == ((void*)0)) ? ((void*)0) : (_tmp20_ = (bala_ccode_node_unref (_tmp20_), ((void*)0)))); |
| 25048 | } |
| 25049 | } |
| 25050 | } |
| 25051 | } else { |
| 25052 | gboolean _tmp21_ = FALSE(0); |
| 25053 | BalaDelegateType* _tmp22_; |
| 25054 | _tmp22_ = delegate_type; |
| 25055 | if (_tmp22_ != NULL((void*)0)) { |
| 25056 | BalaDelegateType* _tmp23_; |
| 25057 | BalaDelegate* _tmp24_; |
| 25058 | BalaDelegate* _tmp25_; |
| 25059 | gboolean _tmp26_; |
| 25060 | gboolean _tmp27_; |
| 25061 | _tmp23_ = delegate_type; |
| 25062 | _tmp24_ = bala_delegate_type_get_delegate_symbol (_tmp23_); |
| 25063 | _tmp25_ = _tmp24_; |
| 25064 | _tmp26_ = bala_delegate_get_has_target (_tmp25_); |
| 25065 | _tmp27_ = _tmp26_; |
| 25066 | _tmp21_ = _tmp27_; |
| 25067 | } else { |
| 25068 | _tmp21_ = FALSE(0); |
| 25069 | } |
| 25070 | if (_tmp21_) { |
| 25071 | BalaCCodeConstant* _tmp28_; |
| 25072 | BalaCCodeConstant* _tmp29_; |
| 25073 | BalaCCodeConstant* _tmp30_; |
| 25074 | BalaCCodeConstant* _tmp31_; |
| 25075 | _tmp28_ = bala_ccode_constant_new ("NULL"); |
| 25076 | _tmp29_ = _tmp28_; |
| 25077 | bala_set_delegate_target ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp29_); |
| 25078 | _bala_ccode_node_unref0 (_tmp29_)((_tmp29_ == ((void*)0)) ? ((void*)0) : (_tmp29_ = (bala_ccode_node_unref (_tmp29_), ((void*)0)))); |
| 25079 | _tmp30_ = bala_ccode_constant_new ("NULL"); |
| 25080 | _tmp31_ = _tmp30_; |
| 25081 | bala_set_delegate_target_destroy_notify ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp31_); |
| 25082 | _bala_ccode_node_unref0 (_tmp31_)((_tmp31_ == ((void*)0)) ? ((void*)0) : (_tmp31_ = (bala_ccode_node_unref (_tmp31_), ((void*)0)))); |
| 25083 | } |
| 25084 | } |
| 25085 | _bala_code_node_unref0 (delegate_type)((delegate_type == ((void*)0)) ? ((void*)0) : (delegate_type = (bala_code_node_unref (delegate_type), ((void*)0)))); |
| 25086 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 25087 | } |
| 25088 | |
| 25089 | static BalaTargetValue* |
| 25090 | bala_ccode_base_module_real_get_local_cvalue (BalaCCodeBaseModule* self, |
| 25091 | BalaLocalVariable* local) |
| 25092 | { |
| 25093 | g_critical ("Type `%s' does not implement abstract method `bala_ccode_base_module_get_local_cvalue'", g_type_name (G_TYPE_FROM_INSTANCE (self)((((GTypeClass*) (((GTypeInstance*) (self))->g_class))-> g_type)))); |
| 25094 | return NULL((void*)0); |
| 25095 | } |
| 25096 | |
| 25097 | BalaTargetValue* |
| 25098 | bala_ccode_base_module_get_local_cvalue (BalaCCodeBaseModule* self, |
| 25099 | BalaLocalVariable* local) |
| 25100 | { |
| 25101 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 25102 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_local_cvalue (self, local); |
| 25103 | } |
| 25104 | |
| 25105 | static BalaTargetValue* |
| 25106 | bala_ccode_base_module_real_get_parameter_cvalue (BalaCCodeBaseModule* self, |
| 25107 | BalaParameter* param) |
| 25108 | { |
| 25109 | g_critical ("Type `%s' does not implement abstract method `bala_ccode_base_module_get_parameter_cvalue'", g_type_name (G_TYPE_FROM_INSTANCE (self)((((GTypeClass*) (((GTypeInstance*) (self))->g_class))-> g_type)))); |
| 25110 | return NULL((void*)0); |
| 25111 | } |
| 25112 | |
| 25113 | BalaTargetValue* |
| 25114 | bala_ccode_base_module_get_parameter_cvalue (BalaCCodeBaseModule* self, |
| 25115 | BalaParameter* param) |
| 25116 | { |
| 25117 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 25118 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_parameter_cvalue (self, param); |
| 25119 | } |
| 25120 | |
| 25121 | static BalaTargetValue* |
| 25122 | bala_ccode_base_module_real_get_field_cvalue (BalaCCodeBaseModule* self, |
| 25123 | BalaField* field, |
| 25124 | BalaTargetValue* instance) |
| 25125 | { |
| 25126 | g_critical ("Type `%s' does not implement abstract method `bala_ccode_base_module_get_field_cvalue'", g_type_name (G_TYPE_FROM_INSTANCE (self)((((GTypeClass*) (((GTypeInstance*) (self))->g_class))-> g_type)))); |
| 25127 | return NULL((void*)0); |
| 25128 | } |
| 25129 | |
| 25130 | BalaTargetValue* |
| 25131 | bala_ccode_base_module_get_field_cvalue (BalaCCodeBaseModule* self, |
| 25132 | BalaField* field, |
| 25133 | BalaTargetValue* instance) |
| 25134 | { |
| 25135 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 25136 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_field_cvalue (self, field, instance); |
| 25137 | } |
| 25138 | |
| 25139 | static BalaTargetValue* |
| 25140 | bala_ccode_base_module_real_load_variable (BalaCCodeBaseModule* self, |
| 25141 | BalaVariable* variable, |
| 25142 | BalaTargetValue* value, |
| 25143 | BalaExpression* expr) |
| 25144 | { |
| 25145 | g_critical ("Type `%s' does not implement abstract method `bala_ccode_base_module_load_variable'", g_type_name (G_TYPE_FROM_INSTANCE (self)((((GTypeClass*) (((GTypeInstance*) (self))->g_class))-> g_type)))); |
| 25146 | return NULL((void*)0); |
| 25147 | } |
| 25148 | |
| 25149 | BalaTargetValue* |
| 25150 | bala_ccode_base_module_load_variable (BalaCCodeBaseModule* self, |
| 25151 | BalaVariable* variable, |
| 25152 | BalaTargetValue* value, |
| 25153 | BalaExpression* expr) |
| 25154 | { |
| 25155 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 25156 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->load_variable (self, variable, value, expr); |
| 25157 | } |
| 25158 | |
| 25159 | static BalaTargetValue* |
| 25160 | bala_ccode_base_module_real_load_this_parameter (BalaCCodeBaseModule* self, |
| 25161 | BalaTypeSymbol* sym) |
| 25162 | { |
| 25163 | g_critical ("Type `%s' does not implement abstract method `bala_ccode_base_module_load_this_parameter'", g_type_name (G_TYPE_FROM_INSTANCE (self)((((GTypeClass*) (((GTypeInstance*) (self))->g_class))-> g_type)))); |
| 25164 | return NULL((void*)0); |
| 25165 | } |
| 25166 | |
| 25167 | BalaTargetValue* |
| 25168 | bala_ccode_base_module_load_this_parameter (BalaCCodeBaseModule* self, |
| 25169 | BalaTypeSymbol* sym) |
| 25170 | { |
| 25171 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 25172 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->load_this_parameter (self, sym); |
| 25173 | } |
| 25174 | |
| 25175 | static void |
| 25176 | bala_ccode_base_module_real_store_value (BalaCCodeBaseModule* self, |
| 25177 | BalaTargetValue* lvalue, |
| 25178 | BalaTargetValue* value, |
| 25179 | BalaSourceReference* source_reference) |
| 25180 | { |
| 25181 | g_critical ("Type `%s' does not implement abstract method `bala_ccode_base_module_store_value'", g_type_name (G_TYPE_FROM_INSTANCE (self)((((GTypeClass*) (((GTypeInstance*) (self))->g_class))-> g_type)))); |
| 25182 | return; |
| 25183 | } |
| 25184 | |
| 25185 | void |
| 25186 | bala_ccode_base_module_store_value (BalaCCodeBaseModule* self, |
| 25187 | BalaTargetValue* lvalue, |
| 25188 | BalaTargetValue* value, |
| 25189 | BalaSourceReference* source_reference) |
| 25190 | { |
| 25191 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 25192 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->store_value (self, lvalue, value, source_reference); |
| 25193 | } |
| 25194 | |
| 25195 | static gchar* |
| 25196 | bala_ccode_base_module_real_get_delegate_target_cname (BalaCCodeBaseModule* self, |
| 25197 | const gchar* delegate_cname) |
| 25198 | { |
| 25199 | g_return_val_if_fail (delegate_cname != NULL, NULL)do { if ((delegate_cname != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "delegate_cname != NULL" ); return (((void*)0)); } } while (0); |
| 25200 | g_assert_not_reached ()do { g_assertion_message_expr ("bala-ccodegen", "balaccodebasemodule.c" , 25200, ((const char*) (__func__)), ((void*)0)); } while (0); |
| 25201 | } |
| 25202 | |
| 25203 | gchar* |
| 25204 | bala_ccode_base_module_get_delegate_target_cname (BalaCCodeBaseModule* self, |
| 25205 | const gchar* delegate_cname) |
| 25206 | { |
| 25207 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 25208 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_delegate_target_cname (self, delegate_cname); |
| 25209 | } |
| 25210 | |
| 25211 | static BalaCCodeExpression* |
| 25212 | bala_ccode_base_module_real_get_delegate_target_cexpression (BalaCCodeBaseModule* self, |
| 25213 | BalaExpression* delegate_expr, |
| 25214 | BalaCCodeExpression* * delegate_target_destroy_notify) |
| 25215 | { |
| 25216 | BalaCCodeExpression* _bala_delegate_target_destroy_notify = NULL((void*)0); |
| 25217 | g_return_val_if_fail (delegate_expr != NULL, NULL)do { if ((delegate_expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "delegate_expr != NULL" ); return (((void*)0)); } } while (0); |
| 25218 | g_assert_not_reached ()do { g_assertion_message_expr ("bala-ccodegen", "balaccodebasemodule.c" , 25218, ((const char*) (__func__)), ((void*)0)); } while (0); |
| 25219 | if (delegate_target_destroy_notify) { |
| 25220 | *delegate_target_destroy_notify = _bala_delegate_target_destroy_notify; |
| 25221 | } else { |
| 25222 | _bala_ccode_node_unref0 (_bala_delegate_target_destroy_notify)((_bala_delegate_target_destroy_notify == ((void*)0)) ? ((void *)0) : (_bala_delegate_target_destroy_notify = (bala_ccode_node_unref (_bala_delegate_target_destroy_notify), ((void*)0)))); |
| 25223 | } |
| 25224 | } |
| 25225 | |
| 25226 | BalaCCodeExpression* |
| 25227 | bala_ccode_base_module_get_delegate_target_cexpression (BalaCCodeBaseModule* self, |
| 25228 | BalaExpression* delegate_expr, |
| 25229 | BalaCCodeExpression* * delegate_target_destroy_notify) |
| 25230 | { |
| 25231 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 25232 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_delegate_target_cexpression (self, delegate_expr, delegate_target_destroy_notify); |
| 25233 | } |
| 25234 | |
| 25235 | static BalaCCodeExpression* |
| 25236 | bala_ccode_base_module_real_get_delegate_target_cvalue (BalaCCodeBaseModule* self, |
| 25237 | BalaTargetValue* value) |
| 25238 | { |
| 25239 | BalaCCodeInvalidExpression* _tmp0_; |
| 25240 | BalaCCodeExpression* result = NULL((void*)0); |
| 25241 | g_return_val_if_fail (value != NULL, NULL)do { if ((value != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "value != NULL" ); return (((void*)0)); } } while (0); |
| 25242 | _tmp0_ = bala_ccode_invalid_expression_new (); |
| 25243 | result = (BalaCCodeExpression*) _tmp0_; |
| 25244 | return result; |
| 25245 | } |
| 25246 | |
| 25247 | BalaCCodeExpression* |
| 25248 | bala_ccode_base_module_get_delegate_target_cvalue (BalaCCodeBaseModule* self, |
| 25249 | BalaTargetValue* value) |
| 25250 | { |
| 25251 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 25252 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_delegate_target_cvalue (self, value); |
| 25253 | } |
| 25254 | |
| 25255 | static BalaCCodeExpression* |
| 25256 | bala_ccode_base_module_real_get_delegate_target_destroy_notify_cvalue (BalaCCodeBaseModule* self, |
| 25257 | BalaTargetValue* value) |
| 25258 | { |
| 25259 | BalaCCodeInvalidExpression* _tmp0_; |
| 25260 | BalaCCodeExpression* result = NULL((void*)0); |
| 25261 | g_return_val_if_fail (value != NULL, NULL)do { if ((value != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "value != NULL" ); return (((void*)0)); } } while (0); |
| 25262 | _tmp0_ = bala_ccode_invalid_expression_new (); |
| 25263 | result = (BalaCCodeExpression*) _tmp0_; |
| 25264 | return result; |
| 25265 | } |
| 25266 | |
| 25267 | BalaCCodeExpression* |
| 25268 | bala_ccode_base_module_get_delegate_target_destroy_notify_cvalue (BalaCCodeBaseModule* self, |
| 25269 | BalaTargetValue* value) |
| 25270 | { |
| 25271 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 25272 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_delegate_target_destroy_notify_cvalue (self, value); |
| 25273 | } |
| 25274 | |
| 25275 | static gchar* |
| 25276 | bala_ccode_base_module_real_get_delegate_target_destroy_notify_cname (BalaCCodeBaseModule* self, |
| 25277 | const gchar* delegate_cname) |
| 25278 | { |
| 25279 | g_return_val_if_fail (delegate_cname != NULL, NULL)do { if ((delegate_cname != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "delegate_cname != NULL" ); return (((void*)0)); } } while (0); |
| 25280 | g_assert_not_reached ()do { g_assertion_message_expr ("bala-ccodegen", "balaccodebasemodule.c" , 25280, ((const char*) (__func__)), ((void*)0)); } while (0); |
| 25281 | } |
| 25282 | |
| 25283 | gchar* |
| 25284 | bala_ccode_base_module_get_delegate_target_destroy_notify_cname (BalaCCodeBaseModule* self, |
| 25285 | const gchar* delegate_cname) |
| 25286 | { |
| 25287 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 25288 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_delegate_target_destroy_notify_cname (self, delegate_cname); |
| 25289 | } |
| 25290 | |
| 25291 | static void |
| 25292 | bala_ccode_base_module_real_visit_base_access (BalaCodeVisitor* base, |
| 25293 | BalaBaseAccess* expr) |
| 25294 | { |
| 25295 | BalaCCodeBaseModule * self; |
| 25296 | BalaClass* cl = NULL((void*)0); |
| 25297 | BalaDataType* _tmp0_; |
| 25298 | BalaDataType* _tmp1_; |
| 25299 | BalaTypeSymbol* _tmp2_; |
| 25300 | BalaTypeSymbol* _tmp3_; |
| 25301 | gboolean _tmp4_ = FALSE(0); |
| 25302 | BalaClass* _tmp5_; |
| 25303 | self = (BalaCCodeBaseModule*) base; |
| 25304 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 25305 | _tmp0_ = bala_expression_get_value_type ((BalaExpression*) expr); |
| 25306 | _tmp1_ = _tmp0_; |
| 25307 | _tmp2_ = bala_data_type_get_type_symbol (_tmp1_); |
| 25308 | _tmp3_ = _tmp2_; |
| 25309 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp3_) : NULL((void*)0); |
| 25310 | _tmp5_ = cl; |
| 25311 | if (_tmp5_ != NULL((void*)0)) { |
| 25312 | BalaClass* _tmp6_; |
| 25313 | gboolean _tmp7_; |
| 25314 | gboolean _tmp8_; |
| 25315 | _tmp6_ = cl; |
| 25316 | _tmp7_ = bala_class_get_is_compact (_tmp6_); |
| 25317 | _tmp8_ = _tmp7_; |
| 25318 | _tmp4_ = !_tmp8_; |
| 25319 | } else { |
| 25320 | _tmp4_ = FALSE(0); |
| 25321 | } |
| 25322 | if (_tmp4_) { |
| 25323 | BalaCCodeExpression* _tmp9_; |
| 25324 | BalaCCodeExpression* _tmp10_; |
| 25325 | BalaClass* _tmp11_; |
| 25326 | BalaCCodeFunctionCall* _tmp12_; |
| 25327 | BalaCCodeFunctionCall* _tmp13_; |
| 25328 | _tmp9_ = bala_ccode_base_module_get_this_cexpression (self); |
| 25329 | _tmp10_ = _tmp9_; |
| 25330 | _tmp11_ = cl; |
| 25331 | _tmp12_ = bala_ccode_base_module_generate_instance_cast (self, _tmp10_, (BalaTypeSymbol*) _tmp11_); |
| 25332 | _tmp13_ = _tmp12_; |
| 25333 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp13_); |
| 25334 | _bala_ccode_node_unref0 (_tmp13_)((_tmp13_ == ((void*)0)) ? ((void*)0) : (_tmp13_ = (bala_ccode_node_unref (_tmp13_), ((void*)0)))); |
| 25335 | _bala_ccode_node_unref0 (_tmp10_)((_tmp10_ == ((void*)0)) ? ((void*)0) : (_tmp10_ = (bala_ccode_node_unref (_tmp10_), ((void*)0)))); |
| 25336 | } else { |
| 25337 | BalaDataType* _tmp14_; |
| 25338 | BalaDataType* _tmp15_; |
| 25339 | BalaTypeSymbol* _tmp16_; |
| 25340 | BalaTypeSymbol* _tmp17_; |
| 25341 | BalaTargetValue* _tmp18_; |
| 25342 | BalaTargetValue* _tmp19_; |
| 25343 | _tmp14_ = bala_expression_get_value_type ((BalaExpression*) expr); |
| 25344 | _tmp15_ = _tmp14_; |
| 25345 | _tmp16_ = bala_data_type_get_type_symbol (_tmp15_); |
| 25346 | _tmp17_ = _tmp16_; |
| 25347 | _tmp18_ = bala_ccode_base_module_load_this_parameter (self, _tmp17_); |
| 25348 | _tmp19_ = _tmp18_; |
| 25349 | bala_expression_set_target_value ((BalaExpression*) expr, _tmp19_); |
| 25350 | _bala_target_value_unref0 (_tmp19_)((_tmp19_ == ((void*)0)) ? ((void*)0) : (_tmp19_ = (bala_target_value_unref (_tmp19_), ((void*)0)))); |
| 25351 | } |
| 25352 | } |
| 25353 | |
| 25354 | static void |
| 25355 | bala_ccode_base_module_real_visit_postfix_expression (BalaCodeVisitor* base, |
| 25356 | BalaPostfixExpression* expr) |
| 25357 | { |
| 25358 | BalaCCodeBaseModule * self; |
| 25359 | BalaMemberAccess* ma = NULL((void*)0); |
| 25360 | BalaExpression* _tmp0_; |
| 25361 | BalaExpression* _tmp1_; |
| 25362 | BalaMemberAccess* _tmp2_; |
| 25363 | BalaMemberAccess* _tmp3_; |
| 25364 | BalaTargetValue* temp_value = NULL((void*)0); |
| 25365 | BalaExpression* _tmp32_; |
| 25366 | BalaExpression* _tmp33_; |
| 25367 | BalaTargetValue* _tmp34_; |
| 25368 | BalaTargetValue* _tmp35_; |
| 25369 | BalaTargetValue* _tmp36_; |
| 25370 | BalaCCodeBinaryOperator _tmp37_ = 0; |
| 25371 | gboolean _tmp38_; |
| 25372 | gboolean _tmp39_; |
| 25373 | BalaCCodeBinaryOperator op = 0; |
| 25374 | BalaCCodeBinaryExpression* cexpr = NULL((void*)0); |
| 25375 | BalaCCodeBinaryOperator _tmp40_; |
| 25376 | BalaTargetValue* _tmp41_; |
| 25377 | BalaCCodeExpression* _tmp42_; |
| 25378 | BalaCCodeConstant* _tmp43_; |
| 25379 | BalaCCodeConstant* _tmp44_; |
| 25380 | BalaCCodeBinaryExpression* _tmp45_; |
| 25381 | BalaCCodeBinaryExpression* _tmp46_; |
| 25382 | BalaCCodeFunction* _tmp47_; |
| 25383 | BalaCCodeFunction* _tmp48_; |
| 25384 | BalaExpression* _tmp49_; |
| 25385 | BalaExpression* _tmp50_; |
| 25386 | BalaCCodeExpression* _tmp51_; |
| 25387 | BalaCCodeBinaryExpression* _tmp52_; |
| 25388 | BalaTargetValue* _tmp53_; |
| 25389 | self = (BalaCCodeBaseModule*) base; |
| 25390 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 25391 | _tmp0_ = bala_postfix_expression_get_inner (expr); |
| 25392 | _tmp1_ = _tmp0_; |
| 25393 | _tmp2_ = bala_ccode_base_module_find_property_access (self, _tmp1_); |
| 25394 | ma = _tmp2_; |
| 25395 | _tmp3_ = ma; |
| 25396 | if (_tmp3_ != NULL((void*)0)) { |
| 25397 | BalaProperty* prop = NULL((void*)0); |
| 25398 | BalaMemberAccess* _tmp4_; |
| 25399 | BalaSymbol* _tmp5_; |
| 25400 | BalaSymbol* _tmp6_; |
| 25401 | BalaProperty* _tmp7_; |
| 25402 | BalaCCodeBinaryOperator _tmp8_ = 0; |
| 25403 | gboolean _tmp9_; |
| 25404 | gboolean _tmp10_; |
| 25405 | BalaCCodeBinaryOperator op = 0; |
| 25406 | BalaCCodeBinaryExpression* cexpr = NULL((void*)0); |
| 25407 | BalaCCodeBinaryOperator _tmp11_; |
| 25408 | BalaExpression* _tmp12_; |
| 25409 | BalaExpression* _tmp13_; |
| 25410 | BalaCCodeExpression* _tmp14_; |
| 25411 | BalaCCodeConstant* _tmp15_; |
| 25412 | BalaCCodeConstant* _tmp16_; |
| 25413 | BalaCCodeBinaryExpression* _tmp17_; |
| 25414 | BalaCCodeBinaryExpression* _tmp18_; |
| 25415 | BalaProperty* _tmp19_; |
| 25416 | BalaMemberAccess* _tmp20_; |
| 25417 | BalaExpression* _tmp21_; |
| 25418 | BalaExpression* _tmp22_; |
| 25419 | BalaDataType* _tmp23_; |
| 25420 | BalaDataType* _tmp24_; |
| 25421 | BalaCCodeBinaryExpression* _tmp25_; |
| 25422 | BalaGLibValue* _tmp26_; |
| 25423 | BalaGLibValue* _tmp27_; |
| 25424 | BalaExpression* _tmp28_; |
| 25425 | BalaExpression* _tmp29_; |
| 25426 | BalaTargetValue* _tmp30_; |
| 25427 | BalaTargetValue* _tmp31_; |
| 25428 | _tmp4_ = ma; |
| 25429 | _tmp5_ = bala_expression_get_symbol_reference ((BalaExpression*) _tmp4_); |
| 25430 | _tmp6_ = _tmp5_; |
| 25431 | _tmp7_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, BALA_TYPE_PROPERTY, BalaProperty)(((BalaProperty*) g_type_check_instance_cast ((GTypeInstance* ) (_tmp6_), ((bala_property_get_type ())))))); |
| 25432 | prop = _tmp7_; |
| 25433 | _tmp9_ = bala_postfix_expression_get_increment (expr); |
| 25434 | _tmp10_ = _tmp9_; |
| 25435 | if (_tmp10_) { |
| 25436 | _tmp8_ = BALA_CCODE_BINARY_OPERATOR_PLUS; |
| 25437 | } else { |
| 25438 | _tmp8_ = BALA_CCODE_BINARY_OPERATOR_MINUS; |
| 25439 | } |
| 25440 | op = _tmp8_; |
| 25441 | _tmp11_ = op; |
| 25442 | _tmp12_ = bala_postfix_expression_get_inner (expr); |
| 25443 | _tmp13_ = _tmp12_; |
| 25444 | _tmp14_ = bala_get_cvalue (_tmp13_); |
| 25445 | _tmp15_ = bala_ccode_constant_new ("1"); |
| 25446 | _tmp16_ = _tmp15_; |
| 25447 | _tmp17_ = bala_ccode_binary_expression_new (_tmp11_, _tmp14_, (BalaCCodeExpression*) _tmp16_); |
| 25448 | _tmp18_ = _tmp17_; |
| 25449 | _bala_ccode_node_unref0 (_tmp16_)((_tmp16_ == ((void*)0)) ? ((void*)0) : (_tmp16_ = (bala_ccode_node_unref (_tmp16_), ((void*)0)))); |
| 25450 | cexpr = _tmp18_; |
| 25451 | _tmp19_ = prop; |
| 25452 | _tmp20_ = ma; |
| 25453 | _tmp21_ = bala_member_access_get_inner (_tmp20_); |
| 25454 | _tmp22_ = _tmp21_; |
| 25455 | _tmp23_ = bala_expression_get_value_type ((BalaExpression*) expr); |
| 25456 | _tmp24_ = _tmp23_; |
| 25457 | _tmp25_ = cexpr; |
| 25458 | _tmp26_ = bala_glib_value_new (_tmp24_, (BalaCCodeExpression*) _tmp25_, FALSE(0)); |
| 25459 | _tmp27_ = _tmp26_; |
| 25460 | bala_ccode_base_module_store_property (self, _tmp19_, _tmp22_, (BalaTargetValue*) _tmp27_); |
| 25461 | _bala_target_value_unref0 (_tmp27_)((_tmp27_ == ((void*)0)) ? ((void*)0) : (_tmp27_ = (bala_target_value_unref (_tmp27_), ((void*)0)))); |
| 25462 | _tmp28_ = bala_postfix_expression_get_inner (expr); |
| 25463 | _tmp29_ = _tmp28_; |
| 25464 | _tmp30_ = bala_expression_get_target_value (_tmp29_); |
| 25465 | _tmp31_ = _tmp30_; |
| 25466 | bala_expression_set_target_value ((BalaExpression*) expr, _tmp31_); |
| 25467 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 25468 | _bala_code_node_unref0 (prop)((prop == ((void*)0)) ? ((void*)0) : (prop = (bala_code_node_unref (prop), ((void*)0)))); |
| 25469 | _bala_code_node_unref0 (ma)((ma == ((void*)0)) ? ((void*)0) : (ma = (bala_code_node_unref (ma), ((void*)0)))); |
| 25470 | return; |
| 25471 | } |
| 25472 | _tmp32_ = bala_postfix_expression_get_inner (expr); |
| 25473 | _tmp33_ = _tmp32_; |
| 25474 | _tmp34_ = bala_expression_get_target_value (_tmp33_); |
| 25475 | _tmp35_ = _tmp34_; |
| 25476 | _tmp36_ = bala_ccode_base_module_store_temp_value (self, _tmp35_, (BalaCodeNode*) expr, NULL((void*)0)); |
| 25477 | temp_value = _tmp36_; |
| 25478 | _tmp38_ = bala_postfix_expression_get_increment (expr); |
| 25479 | _tmp39_ = _tmp38_; |
| 25480 | if (_tmp39_) { |
| 25481 | _tmp37_ = BALA_CCODE_BINARY_OPERATOR_PLUS; |
| 25482 | } else { |
| 25483 | _tmp37_ = BALA_CCODE_BINARY_OPERATOR_MINUS; |
| 25484 | } |
| 25485 | op = _tmp37_; |
| 25486 | _tmp40_ = op; |
| 25487 | _tmp41_ = temp_value; |
| 25488 | _tmp42_ = bala_get_cvalue_ (_tmp41_); |
| 25489 | _tmp43_ = bala_ccode_constant_new ("1"); |
| 25490 | _tmp44_ = _tmp43_; |
| 25491 | _tmp45_ = bala_ccode_binary_expression_new (_tmp40_, _tmp42_, (BalaCCodeExpression*) _tmp44_); |
| 25492 | _tmp46_ = _tmp45_; |
| 25493 | _bala_ccode_node_unref0 (_tmp44_)((_tmp44_ == ((void*)0)) ? ((void*)0) : (_tmp44_ = (bala_ccode_node_unref (_tmp44_), ((void*)0)))); |
| 25494 | cexpr = _tmp46_; |
| 25495 | _tmp47_ = bala_ccode_base_module_get_ccode (self); |
| 25496 | _tmp48_ = _tmp47_; |
| 25497 | _tmp49_ = bala_postfix_expression_get_inner (expr); |
| 25498 | _tmp50_ = _tmp49_; |
| 25499 | _tmp51_ = bala_get_cvalue (_tmp50_); |
| 25500 | _tmp52_ = cexpr; |
| 25501 | bala_ccode_function_add_assignment (_tmp48_, _tmp51_, (BalaCCodeExpression*) _tmp52_); |
| 25502 | _tmp53_ = temp_value; |
| 25503 | bala_expression_set_target_value ((BalaExpression*) expr, _tmp53_); |
| 25504 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 25505 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 25506 | _bala_code_node_unref0 (ma)((ma == ((void*)0)) ? ((void*)0) : (ma = (bala_code_node_unref (ma), ((void*)0)))); |
| 25507 | } |
| 25508 | |
| 25509 | static BalaMemberAccess* |
| 25510 | bala_ccode_base_module_find_property_access (BalaCCodeBaseModule* self, |
| 25511 | BalaExpression* expr) |
| 25512 | { |
| 25513 | BalaMemberAccess* ma = NULL((void*)0); |
| 25514 | BalaMemberAccess* _tmp0_; |
| 25515 | BalaMemberAccess* _tmp1_; |
| 25516 | BalaSymbol* _tmp2_; |
| 25517 | BalaSymbol* _tmp3_; |
| 25518 | BalaMemberAccess* result = NULL((void*)0); |
| 25519 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 25520 | g_return_val_if_fail (expr != NULL, NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return (((void*)0)); } } while (0); |
| 25521 | if (!G_TYPE_CHECK_INSTANCE_TYPE (expr, BALA_TYPE_MEMBER_ACCESS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( expr); GType __t = ((bala_member_access_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 25522 | result = NULL((void*)0); |
| 25523 | return result; |
| 25524 | } |
| 25525 | _tmp0_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (expr, BALA_TYPE_MEMBER_ACCESS, BalaMemberAccess)(((BalaMemberAccess*) g_type_check_instance_cast ((GTypeInstance *) (expr), ((bala_member_access_get_type ())))))); |
| 25526 | ma = _tmp0_; |
| 25527 | _tmp1_ = ma; |
| 25528 | _tmp2_ = bala_expression_get_symbol_reference ((BalaExpression*) _tmp1_); |
| 25529 | _tmp3_ = _tmp2_; |
| 25530 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_PROPERTY)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_property_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 25531 | result = ma; |
| 25532 | return result; |
| 25533 | } |
| 25534 | result = NULL((void*)0); |
| 25535 | _bala_code_node_unref0 (ma)((ma == ((void*)0)) ? ((void*)0) : (ma = (bala_code_node_unref (ma), ((void*)0)))); |
| 25536 | return result; |
| 25537 | } |
| 25538 | |
| 25539 | static gboolean |
| 25540 | bala_ccode_base_module_is_limited_generic_type (BalaGenericType* type) |
| 25541 | { |
| 25542 | BalaClass* cl = NULL((void*)0); |
| 25543 | BalaTypeParameter* _tmp0_; |
| 25544 | BalaTypeParameter* _tmp1_; |
| 25545 | BalaSymbol* _tmp2_; |
| 25546 | BalaSymbol* _tmp3_; |
| 25547 | BalaStruct* st = NULL((void*)0); |
| 25548 | BalaTypeParameter* _tmp4_; |
| 25549 | BalaTypeParameter* _tmp5_; |
| 25550 | BalaSymbol* _tmp6_; |
| 25551 | BalaSymbol* _tmp7_; |
| 25552 | gboolean _tmp8_ = FALSE(0); |
| 25553 | gboolean _tmp9_ = FALSE(0); |
| 25554 | BalaClass* _tmp10_; |
| 25555 | gboolean result = FALSE(0); |
| 25556 | g_return_val_if_fail (type != NULL, FALSE)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return ((0)); } } while (0); |
| 25557 | _tmp0_ = bala_generic_type_get_type_parameter (type); |
| 25558 | _tmp1_ = _tmp0_; |
| 25559 | _tmp2_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp1_); |
| 25560 | _tmp3_ = _tmp2_; |
| 25561 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp3_) : NULL((void*)0); |
| 25562 | _tmp4_ = bala_generic_type_get_type_parameter (type); |
| 25563 | _tmp5_ = _tmp4_; |
| 25564 | _tmp6_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp5_); |
| 25565 | _tmp7_ = _tmp6_; |
| 25566 | st = G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp7_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp7_) : NULL((void*)0); |
| 25567 | _tmp10_ = cl; |
| 25568 | if (_tmp10_ != NULL((void*)0)) { |
| 25569 | BalaClass* _tmp11_; |
| 25570 | gboolean _tmp12_; |
| 25571 | gboolean _tmp13_; |
| 25572 | _tmp11_ = cl; |
| 25573 | _tmp12_ = bala_class_get_is_compact (_tmp11_); |
| 25574 | _tmp13_ = _tmp12_; |
| 25575 | _tmp9_ = _tmp13_; |
| 25576 | } else { |
| 25577 | _tmp9_ = FALSE(0); |
| 25578 | } |
| 25579 | if (_tmp9_) { |
| 25580 | _tmp8_ = TRUE(!(0)); |
| 25581 | } else { |
| 25582 | BalaStruct* _tmp14_; |
| 25583 | _tmp14_ = st; |
| 25584 | _tmp8_ = _tmp14_ != NULL((void*)0); |
| 25585 | } |
| 25586 | if (_tmp8_) { |
| 25587 | result = TRUE(!(0)); |
| 25588 | return result; |
| 25589 | } |
| 25590 | result = FALSE(0); |
| 25591 | return result; |
| 25592 | } |
| 25593 | |
| 25594 | gboolean |
| 25595 | bala_ccode_base_module_requires_copy (BalaDataType* type) |
| 25596 | { |
| 25597 | BalaClass* cl = NULL((void*)0); |
| 25598 | BalaTypeSymbol* _tmp0_; |
| 25599 | BalaTypeSymbol* _tmp1_; |
| 25600 | gboolean _tmp2_ = FALSE(0); |
| 25601 | gboolean _tmp3_ = FALSE(0); |
| 25602 | BalaClass* _tmp4_; |
| 25603 | gboolean result = FALSE(0); |
| 25604 | g_return_val_if_fail (type != NULL, FALSE)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return ((0)); } } while (0); |
| 25605 | if (!bala_data_type_is_disposable (type)) { |
| 25606 | result = FALSE(0); |
| 25607 | return result; |
| 25608 | } |
| 25609 | _tmp0_ = bala_data_type_get_type_symbol (type); |
| 25610 | _tmp1_ = _tmp0_; |
| 25611 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp1_) : NULL((void*)0); |
| 25612 | _tmp4_ = cl; |
| 25613 | if (_tmp4_ != NULL((void*)0)) { |
| 25614 | BalaClass* _tmp5_; |
| 25615 | _tmp5_ = cl; |
| 25616 | _tmp3_ = bala_is_reference_counting ((BalaTypeSymbol*) _tmp5_); |
| 25617 | } else { |
| 25618 | _tmp3_ = FALSE(0); |
| 25619 | } |
| 25620 | if (_tmp3_) { |
| 25621 | BalaClass* _tmp6_; |
| 25622 | gchar* _tmp7_; |
| 25623 | gchar* _tmp8_; |
| 25624 | _tmp6_ = cl; |
| 25625 | _tmp7_ = bala_get_ccode_ref_function ((BalaTypeSymbol*) _tmp6_); |
| 25626 | _tmp8_ = _tmp7_; |
| 25627 | _tmp2_ = g_strcmp0 (_tmp8_, "") == 0; |
| 25628 | _g_free0 (_tmp8_)(_tmp8_ = (g_free (_tmp8_), ((void*)0))); |
| 25629 | } else { |
| 25630 | _tmp2_ = FALSE(0); |
| 25631 | } |
| 25632 | if (_tmp2_) { |
| 25633 | result = FALSE(0); |
| 25634 | return result; |
| 25635 | } |
| 25636 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 25637 | if (bala_ccode_base_module_is_limited_generic_type (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_GENERIC_TYPE, BalaGenericType)(((BalaGenericType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_generic_type_get_type ()))))))) { |
| 25638 | result = FALSE(0); |
| 25639 | return result; |
| 25640 | } |
| 25641 | } |
| 25642 | result = TRUE(!(0)); |
| 25643 | return result; |
| 25644 | } |
| 25645 | |
| 25646 | gboolean |
| 25647 | bala_ccode_base_module_requires_destroy (BalaDataType* type) |
| 25648 | { |
| 25649 | BalaArrayType* array_type = NULL((void*)0); |
| 25650 | BalaArrayType* _tmp0_; |
| 25651 | gboolean _tmp1_ = FALSE(0); |
| 25652 | BalaArrayType* _tmp2_; |
| 25653 | BalaClass* cl = NULL((void*)0); |
| 25654 | BalaTypeSymbol* _tmp9_; |
| 25655 | BalaTypeSymbol* _tmp10_; |
| 25656 | gboolean _tmp11_ = FALSE(0); |
| 25657 | gboolean _tmp12_ = FALSE(0); |
| 25658 | BalaClass* _tmp13_; |
| 25659 | gboolean result = FALSE(0); |
| 25660 | g_return_val_if_fail (type != NULL, FALSE)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return ((0)); } } while (0); |
| 25661 | if (!bala_data_type_is_disposable (type)) { |
| 25662 | result = FALSE(0); |
| 25663 | return result; |
| 25664 | } |
| 25665 | _tmp0_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_array_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) type) : NULL((void*)0)); |
| 25666 | array_type = _tmp0_; |
| 25667 | _tmp2_ = array_type; |
| 25668 | if (_tmp2_ != NULL((void*)0)) { |
| 25669 | BalaArrayType* _tmp3_; |
| 25670 | gboolean _tmp4_; |
| 25671 | gboolean _tmp5_; |
| 25672 | _tmp3_ = array_type; |
| 25673 | _tmp4_ = bala_array_type_get_fixed_length (_tmp3_); |
| 25674 | _tmp5_ = _tmp4_; |
| 25675 | _tmp1_ = _tmp5_; |
| 25676 | } else { |
| 25677 | _tmp1_ = FALSE(0); |
| 25678 | } |
| 25679 | if (_tmp1_) { |
| 25680 | BalaArrayType* _tmp6_; |
| 25681 | BalaDataType* _tmp7_; |
| 25682 | BalaDataType* _tmp8_; |
| 25683 | _tmp6_ = array_type; |
| 25684 | _tmp7_ = bala_array_type_get_element_type (_tmp6_); |
| 25685 | _tmp8_ = _tmp7_; |
| 25686 | result = bala_ccode_base_module_requires_destroy (_tmp8_); |
| 25687 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 25688 | return result; |
| 25689 | } |
| 25690 | _tmp9_ = bala_data_type_get_type_symbol (type); |
| 25691 | _tmp10_ = _tmp9_; |
| 25692 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp10_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp10_) : NULL((void*)0); |
| 25693 | _tmp13_ = cl; |
| 25694 | if (_tmp13_ != NULL((void*)0)) { |
| 25695 | BalaClass* _tmp14_; |
| 25696 | _tmp14_ = cl; |
| 25697 | _tmp12_ = bala_is_reference_counting ((BalaTypeSymbol*) _tmp14_); |
| 25698 | } else { |
| 25699 | _tmp12_ = FALSE(0); |
| 25700 | } |
| 25701 | if (_tmp12_) { |
| 25702 | BalaClass* _tmp15_; |
| 25703 | gchar* _tmp16_; |
| 25704 | gchar* _tmp17_; |
| 25705 | _tmp15_ = cl; |
| 25706 | _tmp16_ = bala_get_ccode_unref_function ((BalaObjectTypeSymbol*) _tmp15_); |
| 25707 | _tmp17_ = _tmp16_; |
| 25708 | _tmp11_ = g_strcmp0 (_tmp17_, "") == 0; |
| 25709 | _g_free0 (_tmp17_)(_tmp17_ = (g_free (_tmp17_), ((void*)0))); |
| 25710 | } else { |
| 25711 | _tmp11_ = FALSE(0); |
| 25712 | } |
| 25713 | if (_tmp11_) { |
| 25714 | result = FALSE(0); |
| 25715 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 25716 | return result; |
| 25717 | } |
| 25718 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 25719 | if (bala_ccode_base_module_is_limited_generic_type (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_GENERIC_TYPE, BalaGenericType)(((BalaGenericType*) g_type_check_instance_cast ((GTypeInstance *) (type), ((bala_generic_type_get_type ()))))))) { |
| 25720 | result = FALSE(0); |
| 25721 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 25722 | return result; |
| 25723 | } |
| 25724 | } |
| 25725 | result = TRUE(!(0)); |
| 25726 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 25727 | return result; |
| 25728 | } |
| 25729 | |
| 25730 | static BalaTargetValue* |
| 25731 | bala_ccode_base_module_real_copy_value (BalaCCodeBaseModule* self, |
| 25732 | BalaTargetValue* value, |
| 25733 | BalaCodeNode* node) |
| 25734 | { |
| 25735 | BalaDataType* type = NULL((void*)0); |
| 25736 | BalaDataType* _tmp0_; |
| 25737 | BalaDataType* _tmp1_; |
| 25738 | BalaDataType* _tmp2_; |
| 25739 | BalaCCodeExpression* cexpr = NULL((void*)0); |
| 25740 | BalaCCodeExpression* _tmp3_; |
| 25741 | BalaCCodeExpression* _tmp4_; |
| 25742 | BalaGLibValue* _result_ = NULL((void*)0); |
| 25743 | BalaGLibValue* _tmp5_; |
| 25744 | BalaDataType* _tmp6_; |
| 25745 | gboolean _tmp23_ = FALSE(0); |
| 25746 | BalaDataType* _tmp24_; |
| 25747 | BalaCCodeExpression* dupexpr = NULL((void*)0); |
| 25748 | BalaDataType* _tmp117_; |
| 25749 | BalaSourceReference* _tmp118_; |
| 25750 | BalaSourceReference* _tmp119_; |
| 25751 | BalaCCodeExpression* _tmp120_; |
| 25752 | BalaCCodeExpression* _tmp121_; |
| 25753 | gboolean _tmp122_ = FALSE(0); |
| 25754 | gboolean _tmp123_ = FALSE(0); |
| 25755 | gboolean _tmp124_ = FALSE(0); |
| 25756 | BalaCCodeExpression* _tmp125_; |
| 25757 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 25758 | BalaCCodeExpression* _tmp188_; |
| 25759 | BalaCCodeFunctionCall* _tmp189_; |
| 25760 | gboolean _tmp190_ = FALSE(0); |
| 25761 | gboolean _tmp191_ = FALSE(0); |
| 25762 | BalaDataType* _tmp192_; |
| 25763 | BalaTargetValue* result = NULL((void*)0); |
| 25764 | g_return_val_if_fail (value != NULL, NULL)do { if ((value != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "value != NULL" ); return (((void*)0)); } } while (0); |
| 25765 | g_return_val_if_fail (node != NULL, NULL)do { if ((node != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "node != NULL" ); return (((void*)0)); } } while (0); |
| 25766 | _tmp0_ = bala_target_value_get_value_type (value); |
| 25767 | _tmp1_ = _tmp0_; |
| 25768 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 25769 | type = _tmp2_; |
| 25770 | _tmp3_ = bala_get_cvalue_ (value); |
| 25771 | _tmp4_ = _bala_ccode_node_ref0 (_tmp3_); |
| 25772 | cexpr = _tmp4_; |
| 25773 | _tmp5_ = bala_glib_value_copy (G_TYPE_CHECK_INSTANCE_CAST (value, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (value), ((bala_glib_value_get_type ())))))); |
| 25774 | _result_ = _tmp5_; |
| 25775 | _tmp6_ = type; |
| 25776 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp6_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 25777 | BalaDelegateType* delegate_type = NULL((void*)0); |
| 25778 | BalaDataType* _tmp7_; |
| 25779 | BalaDelegateType* _tmp8_; |
| 25780 | gboolean _tmp9_ = FALSE(0); |
| 25781 | gboolean _tmp10_ = FALSE(0); |
| 25782 | BalaGLibValue* _tmp21_; |
| 25783 | BalaCCodeConstant* _tmp22_; |
| 25784 | _tmp7_ = type; |
| 25785 | _tmp8_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp7_), ((bala_delegate_type_get_type ())))))); |
| 25786 | delegate_type = _tmp8_; |
| 25787 | if (bala_get_ccode_delegate_target (node)) { |
| 25788 | BalaDelegateType* _tmp11_; |
| 25789 | BalaDelegate* _tmp12_; |
| 25790 | BalaDelegate* _tmp13_; |
| 25791 | gboolean _tmp14_; |
| 25792 | gboolean _tmp15_; |
| 25793 | _tmp11_ = delegate_type; |
| 25794 | _tmp12_ = bala_delegate_type_get_delegate_symbol (_tmp11_); |
| 25795 | _tmp13_ = _tmp12_; |
| 25796 | _tmp14_ = bala_delegate_get_has_target (_tmp13_); |
| 25797 | _tmp15_ = _tmp14_; |
| 25798 | _tmp10_ = _tmp15_; |
| 25799 | } else { |
| 25800 | _tmp10_ = FALSE(0); |
| 25801 | } |
| 25802 | if (_tmp10_) { |
| 25803 | BalaCodeContext* _tmp16_; |
| 25804 | gboolean _tmp17_; |
| 25805 | gboolean _tmp18_; |
| 25806 | _tmp16_ = self->priv->_context; |
| 25807 | _tmp17_ = bala_code_context_get_deprecated (_tmp16_); |
| 25808 | _tmp18_ = _tmp17_; |
| 25809 | _tmp9_ = !_tmp18_; |
| 25810 | } else { |
| 25811 | _tmp9_ = FALSE(0); |
| 25812 | } |
| 25813 | if (_tmp9_) { |
| 25814 | BalaSourceReference* _tmp19_; |
| 25815 | BalaSourceReference* _tmp20_; |
| 25816 | _tmp19_ = bala_code_node_get_source_reference (node); |
| 25817 | _tmp20_ = _tmp19_; |
| 25818 | bala_report_deprecated (_tmp20_, "copying delegates is not supported"); |
| 25819 | } |
| 25820 | _tmp21_ = _result_; |
| 25821 | _tmp22_ = bala_ccode_constant_new ("NULL"); |
| 25822 | _bala_ccode_node_unref0 (_tmp21_->delegate_target_destroy_notify_cvalue)((_tmp21_->delegate_target_destroy_notify_cvalue == ((void *)0)) ? ((void*)0) : (_tmp21_->delegate_target_destroy_notify_cvalue = (bala_ccode_node_unref (_tmp21_->delegate_target_destroy_notify_cvalue ), ((void*)0)))); |
| 25823 | _tmp21_->delegate_target_destroy_notify_cvalue = (BalaCCodeExpression*) _tmp22_; |
| 25824 | result = (BalaTargetValue*) _result_; |
| 25825 | _bala_code_node_unref0 (delegate_type)((delegate_type == ((void*)0)) ? ((void*)0) : (delegate_type = (bala_code_node_unref (delegate_type), ((void*)0)))); |
| 25826 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 25827 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 25828 | return result; |
| 25829 | } |
| 25830 | _tmp24_ = type; |
| 25831 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp24_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 25832 | BalaDataType* _tmp25_; |
| 25833 | gboolean _tmp26_; |
| 25834 | gboolean _tmp27_; |
| 25835 | _tmp25_ = type; |
| 25836 | _tmp26_ = bala_data_type_get_nullable (_tmp25_); |
| 25837 | _tmp27_ = _tmp26_; |
| 25838 | _tmp23_ = !_tmp27_; |
| 25839 | } else { |
| 25840 | _tmp23_ = FALSE(0); |
| 25841 | } |
| 25842 | if (_tmp23_) { |
| 25843 | BalaTargetValue* temp_cvalue = NULL((void*)0); |
| 25844 | BalaDataType* _tmp28_; |
| 25845 | BalaTargetValue* _tmp29_; |
| 25846 | BalaTargetValue* _tmp30_; |
| 25847 | BalaSourceReference* _tmp31_; |
| 25848 | BalaSourceReference* _tmp32_; |
| 25849 | BalaTargetValue* _tmp33_; |
| 25850 | BalaCCodeExpression* _tmp34_; |
| 25851 | BalaCCodeExpression* _tmp35_; |
| 25852 | BalaTargetValue* temp_value = NULL((void*)0); |
| 25853 | BalaDataType* _tmp36_; |
| 25854 | gboolean _tmp37_; |
| 25855 | BalaTargetValue* _tmp38_; |
| 25856 | BalaCCodeExpression* ctemp = NULL((void*)0); |
| 25857 | BalaTargetValue* _tmp39_; |
| 25858 | BalaCCodeExpression* _tmp40_; |
| 25859 | BalaCCodeExpression* _tmp41_; |
| 25860 | BalaValueType* vt = NULL((void*)0); |
| 25861 | BalaDataType* _tmp42_; |
| 25862 | BalaValueType* _tmp43_; |
| 25863 | BalaStruct* st = NULL((void*)0); |
| 25864 | BalaValueType* _tmp44_; |
| 25865 | BalaTypeSymbol* _tmp45_; |
| 25866 | BalaTypeSymbol* _tmp46_; |
| 25867 | BalaStruct* _tmp47_; |
| 25868 | BalaCCodeFunctionCall* copy_call = NULL((void*)0); |
| 25869 | BalaStruct* _tmp48_; |
| 25870 | gchar* _tmp49_; |
| 25871 | gchar* _tmp50_; |
| 25872 | BalaCCodeIdentifier* _tmp51_; |
| 25873 | BalaCCodeIdentifier* _tmp52_; |
| 25874 | BalaCCodeFunctionCall* _tmp53_; |
| 25875 | BalaCCodeFunctionCall* _tmp54_; |
| 25876 | BalaCCodeFunctionCall* _tmp55_; |
| 25877 | BalaCCodeExpression* _tmp56_; |
| 25878 | BalaCCodeUnaryExpression* _tmp57_; |
| 25879 | BalaCCodeUnaryExpression* _tmp58_; |
| 25880 | BalaCCodeFunctionCall* _tmp59_; |
| 25881 | BalaCCodeExpression* _tmp60_; |
| 25882 | BalaCCodeUnaryExpression* _tmp61_; |
| 25883 | BalaCCodeUnaryExpression* _tmp62_; |
| 25884 | BalaStruct* _tmp63_; |
| 25885 | gboolean _tmp65_ = FALSE(0); |
| 25886 | BalaStruct* _tmp66_; |
| 25887 | _tmp28_ = type; |
| 25888 | _tmp29_ = bala_ccode_base_module_create_temp_value (self, _tmp28_, FALSE(0), node, NULL((void*)0)); |
| 25889 | temp_cvalue = _tmp29_; |
| 25890 | _tmp30_ = temp_cvalue; |
| 25891 | _tmp31_ = bala_code_node_get_source_reference (node); |
| 25892 | _tmp32_ = _tmp31_; |
| 25893 | bala_ccode_base_module_store_value (self, _tmp30_, value, _tmp32_); |
| 25894 | _tmp33_ = temp_cvalue; |
| 25895 | _tmp34_ = bala_get_cvalue_ (_tmp33_); |
| 25896 | _tmp35_ = _bala_ccode_node_ref0 (_tmp34_); |
| 25897 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 25898 | cexpr = _tmp35_; |
| 25899 | _tmp36_ = type; |
| 25900 | _tmp37_ = TRUE(!(0)); |
| 25901 | _tmp38_ = bala_ccode_base_module_create_temp_value (self, _tmp36_, TRUE(!(0)), node, &_tmp37_); |
| 25902 | temp_value = _tmp38_; |
| 25903 | _tmp39_ = temp_value; |
| 25904 | _tmp40_ = bala_get_cvalue_ (_tmp39_); |
| 25905 | _tmp41_ = _bala_ccode_node_ref0 (_tmp40_); |
| 25906 | ctemp = _tmp41_; |
| 25907 | _tmp42_ = type; |
| 25908 | _tmp43_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, BALA_TYPE_VALUE_TYPE, BalaValueType)(((BalaValueType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp42_), ((bala_value_type_get_type ())))))); |
| 25909 | vt = _tmp43_; |
| 25910 | _tmp44_ = vt; |
| 25911 | _tmp45_ = bala_data_type_get_type_symbol ((BalaDataType*) _tmp44_); |
| 25912 | _tmp46_ = _tmp45_; |
| 25913 | _tmp47_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp46_), ((bala_struct_get_type ())))))); |
| 25914 | st = _tmp47_; |
| 25915 | _tmp48_ = st; |
| 25916 | _tmp49_ = bala_get_ccode_copy_function ((BalaTypeSymbol*) _tmp48_); |
| 25917 | _tmp50_ = _tmp49_; |
| 25918 | _tmp51_ = bala_ccode_identifier_new (_tmp50_); |
| 25919 | _tmp52_ = _tmp51_; |
| 25920 | _tmp53_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp52_); |
| 25921 | _tmp54_ = _tmp53_; |
| 25922 | _bala_ccode_node_unref0 (_tmp52_)((_tmp52_ == ((void*)0)) ? ((void*)0) : (_tmp52_ = (bala_ccode_node_unref (_tmp52_), ((void*)0)))); |
| 25923 | _g_free0 (_tmp50_)(_tmp50_ = (g_free (_tmp50_), ((void*)0))); |
| 25924 | copy_call = _tmp54_; |
| 25925 | _tmp55_ = copy_call; |
| 25926 | _tmp56_ = cexpr; |
| 25927 | _tmp57_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp56_); |
| 25928 | _tmp58_ = _tmp57_; |
| 25929 | bala_ccode_function_call_add_argument (_tmp55_, (BalaCCodeExpression*) _tmp58_); |
| 25930 | _bala_ccode_node_unref0 (_tmp58_)((_tmp58_ == ((void*)0)) ? ((void*)0) : (_tmp58_ = (bala_ccode_node_unref (_tmp58_), ((void*)0)))); |
| 25931 | _tmp59_ = copy_call; |
| 25932 | _tmp60_ = ctemp; |
| 25933 | _tmp61_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp60_); |
| 25934 | _tmp62_ = _tmp61_; |
| 25935 | bala_ccode_function_call_add_argument (_tmp59_, (BalaCCodeExpression*) _tmp62_); |
| 25936 | _bala_ccode_node_unref0 (_tmp62_)((_tmp62_ == ((void*)0)) ? ((void*)0) : (_tmp62_ = (bala_ccode_node_unref (_tmp62_), ((void*)0)))); |
| 25937 | _tmp63_ = st; |
| 25938 | if (!bala_get_ccode_has_copy_function (_tmp63_)) { |
| 25939 | BalaStruct* _tmp64_; |
| 25940 | _tmp64_ = st; |
| 25941 | bala_ccode_base_module_generate_struct_copy_function (self, _tmp64_); |
| 25942 | } |
| 25943 | _tmp66_ = self->gvalue_type; |
| 25944 | if (_tmp66_ != NULL((void*)0)) { |
| 25945 | BalaDataType* _tmp67_; |
| 25946 | BalaTypeSymbol* _tmp68_; |
| 25947 | BalaTypeSymbol* _tmp69_; |
| 25948 | BalaStruct* _tmp70_; |
| 25949 | _tmp67_ = type; |
| 25950 | _tmp68_ = bala_data_type_get_type_symbol (_tmp67_); |
| 25951 | _tmp69_ = _tmp68_; |
| 25952 | _tmp70_ = self->gvalue_type; |
| 25953 | _tmp65_ = _tmp69_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp70_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp70_), ((bala_typesymbol_get_type ()))))); |
| 25954 | } else { |
| 25955 | _tmp65_ = FALSE(0); |
| 25956 | } |
| 25957 | if (_tmp65_) { |
| 25958 | BalaCCodeFunctionCall* cisvalid = NULL((void*)0); |
| 25959 | BalaCCodeIdentifier* _tmp71_; |
| 25960 | BalaCCodeIdentifier* _tmp72_; |
| 25961 | BalaCCodeFunctionCall* _tmp73_; |
| 25962 | BalaCCodeFunctionCall* _tmp74_; |
| 25963 | BalaCCodeFunctionCall* _tmp75_; |
| 25964 | BalaCCodeExpression* _tmp76_; |
| 25965 | BalaCCodeUnaryExpression* _tmp77_; |
| 25966 | BalaCCodeUnaryExpression* _tmp78_; |
| 25967 | BalaCCodeFunction* _tmp79_; |
| 25968 | BalaCCodeFunction* _tmp80_; |
| 25969 | BalaCCodeFunctionCall* _tmp81_; |
| 25970 | BalaCCodeFunctionCall* value_type_call = NULL((void*)0); |
| 25971 | BalaCCodeIdentifier* _tmp82_; |
| 25972 | BalaCCodeIdentifier* _tmp83_; |
| 25973 | BalaCCodeFunctionCall* _tmp84_; |
| 25974 | BalaCCodeFunctionCall* _tmp85_; |
| 25975 | BalaCCodeFunctionCall* _tmp86_; |
| 25976 | BalaCCodeExpression* _tmp87_; |
| 25977 | BalaCCodeUnaryExpression* _tmp88_; |
| 25978 | BalaCCodeUnaryExpression* _tmp89_; |
| 25979 | BalaCCodeFunctionCall* init_call = NULL((void*)0); |
| 25980 | BalaCCodeIdentifier* _tmp90_; |
| 25981 | BalaCCodeIdentifier* _tmp91_; |
| 25982 | BalaCCodeFunctionCall* _tmp92_; |
| 25983 | BalaCCodeFunctionCall* _tmp93_; |
| 25984 | BalaCCodeFunctionCall* _tmp94_; |
| 25985 | BalaCCodeExpression* _tmp95_; |
| 25986 | BalaCCodeUnaryExpression* _tmp96_; |
| 25987 | BalaCCodeUnaryExpression* _tmp97_; |
| 25988 | BalaCCodeFunctionCall* _tmp98_; |
| 25989 | BalaCCodeFunctionCall* _tmp99_; |
| 25990 | BalaCCodeFunction* _tmp100_; |
| 25991 | BalaCCodeFunction* _tmp101_; |
| 25992 | BalaCCodeFunctionCall* _tmp102_; |
| 25993 | BalaCCodeFunction* _tmp103_; |
| 25994 | BalaCCodeFunction* _tmp104_; |
| 25995 | BalaCCodeFunctionCall* _tmp105_; |
| 25996 | BalaCCodeFunction* _tmp106_; |
| 25997 | BalaCCodeFunction* _tmp107_; |
| 25998 | BalaTargetValue* _tmp108_; |
| 25999 | BalaTargetValue* _tmp109_; |
| 26000 | BalaSourceReference* _tmp110_; |
| 26001 | BalaSourceReference* _tmp111_; |
| 26002 | BalaCCodeFunction* _tmp112_; |
| 26003 | BalaCCodeFunction* _tmp113_; |
| 26004 | _tmp71_ = bala_ccode_identifier_new ("G_IS_VALUE"); |
| 26005 | _tmp72_ = _tmp71_; |
| 26006 | _tmp73_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp72_); |
| 26007 | _tmp74_ = _tmp73_; |
| 26008 | _bala_ccode_node_unref0 (_tmp72_)((_tmp72_ == ((void*)0)) ? ((void*)0) : (_tmp72_ = (bala_ccode_node_unref (_tmp72_), ((void*)0)))); |
| 26009 | cisvalid = _tmp74_; |
| 26010 | _tmp75_ = cisvalid; |
| 26011 | _tmp76_ = cexpr; |
| 26012 | _tmp77_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp76_); |
| 26013 | _tmp78_ = _tmp77_; |
| 26014 | bala_ccode_function_call_add_argument (_tmp75_, (BalaCCodeExpression*) _tmp78_); |
| 26015 | _bala_ccode_node_unref0 (_tmp78_)((_tmp78_ == ((void*)0)) ? ((void*)0) : (_tmp78_ = (bala_ccode_node_unref (_tmp78_), ((void*)0)))); |
| 26016 | _tmp79_ = bala_ccode_base_module_get_ccode (self); |
| 26017 | _tmp80_ = _tmp79_; |
| 26018 | _tmp81_ = cisvalid; |
| 26019 | bala_ccode_function_open_if (_tmp80_, (BalaCCodeExpression*) _tmp81_); |
| 26020 | _tmp82_ = bala_ccode_identifier_new ("G_VALUE_TYPE"); |
| 26021 | _tmp83_ = _tmp82_; |
| 26022 | _tmp84_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp83_); |
| 26023 | _tmp85_ = _tmp84_; |
| 26024 | _bala_ccode_node_unref0 (_tmp83_)((_tmp83_ == ((void*)0)) ? ((void*)0) : (_tmp83_ = (bala_ccode_node_unref (_tmp83_), ((void*)0)))); |
| 26025 | value_type_call = _tmp85_; |
| 26026 | _tmp86_ = value_type_call; |
| 26027 | _tmp87_ = cexpr; |
| 26028 | _tmp88_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp87_); |
| 26029 | _tmp89_ = _tmp88_; |
| 26030 | bala_ccode_function_call_add_argument (_tmp86_, (BalaCCodeExpression*) _tmp89_); |
| 26031 | _bala_ccode_node_unref0 (_tmp89_)((_tmp89_ == ((void*)0)) ? ((void*)0) : (_tmp89_ = (bala_ccode_node_unref (_tmp89_), ((void*)0)))); |
| 26032 | _tmp90_ = bala_ccode_identifier_new ("g_value_init"); |
| 26033 | _tmp91_ = _tmp90_; |
| 26034 | _tmp92_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp91_); |
| 26035 | _tmp93_ = _tmp92_; |
| 26036 | _bala_ccode_node_unref0 (_tmp91_)((_tmp91_ == ((void*)0)) ? ((void*)0) : (_tmp91_ = (bala_ccode_node_unref (_tmp91_), ((void*)0)))); |
| 26037 | init_call = _tmp93_; |
| 26038 | _tmp94_ = init_call; |
| 26039 | _tmp95_ = ctemp; |
| 26040 | _tmp96_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp95_); |
| 26041 | _tmp97_ = _tmp96_; |
| 26042 | bala_ccode_function_call_add_argument (_tmp94_, (BalaCCodeExpression*) _tmp97_); |
| 26043 | _bala_ccode_node_unref0 (_tmp97_)((_tmp97_ == ((void*)0)) ? ((void*)0) : (_tmp97_ = (bala_ccode_node_unref (_tmp97_), ((void*)0)))); |
| 26044 | _tmp98_ = init_call; |
| 26045 | _tmp99_ = value_type_call; |
| 26046 | bala_ccode_function_call_add_argument (_tmp98_, (BalaCCodeExpression*) _tmp99_); |
| 26047 | _tmp100_ = bala_ccode_base_module_get_ccode (self); |
| 26048 | _tmp101_ = _tmp100_; |
| 26049 | _tmp102_ = init_call; |
| 26050 | bala_ccode_function_add_expression (_tmp101_, (BalaCCodeExpression*) _tmp102_); |
| 26051 | _tmp103_ = bala_ccode_base_module_get_ccode (self); |
| 26052 | _tmp104_ = _tmp103_; |
| 26053 | _tmp105_ = copy_call; |
| 26054 | bala_ccode_function_add_expression (_tmp104_, (BalaCCodeExpression*) _tmp105_); |
| 26055 | _tmp106_ = bala_ccode_base_module_get_ccode (self); |
| 26056 | _tmp107_ = _tmp106_; |
| 26057 | bala_ccode_function_add_else (_tmp107_); |
| 26058 | _tmp108_ = temp_value; |
| 26059 | _tmp109_ = temp_cvalue; |
| 26060 | _tmp110_ = bala_code_node_get_source_reference (node); |
| 26061 | _tmp111_ = _tmp110_; |
| 26062 | bala_ccode_base_module_store_value (self, _tmp108_, _tmp109_, _tmp111_); |
| 26063 | _tmp112_ = bala_ccode_base_module_get_ccode (self); |
| 26064 | _tmp113_ = _tmp112_; |
| 26065 | bala_ccode_function_close (_tmp113_); |
| 26066 | _bala_ccode_node_unref0 (init_call)((init_call == ((void*)0)) ? ((void*)0) : (init_call = (bala_ccode_node_unref (init_call), ((void*)0)))); |
| 26067 | _bala_ccode_node_unref0 (value_type_call)((value_type_call == ((void*)0)) ? ((void*)0) : (value_type_call = (bala_ccode_node_unref (value_type_call), ((void*)0)))); |
| 26068 | _bala_ccode_node_unref0 (cisvalid)((cisvalid == ((void*)0)) ? ((void*)0) : (cisvalid = (bala_ccode_node_unref (cisvalid), ((void*)0)))); |
| 26069 | } else { |
| 26070 | BalaCCodeFunction* _tmp114_; |
| 26071 | BalaCCodeFunction* _tmp115_; |
| 26072 | BalaCCodeFunctionCall* _tmp116_; |
| 26073 | _tmp114_ = bala_ccode_base_module_get_ccode (self); |
| 26074 | _tmp115_ = _tmp114_; |
| 26075 | _tmp116_ = copy_call; |
| 26076 | bala_ccode_function_add_expression (_tmp115_, (BalaCCodeExpression*) _tmp116_); |
| 26077 | } |
| 26078 | result = temp_value; |
| 26079 | _bala_ccode_node_unref0 (copy_call)((copy_call == ((void*)0)) ? ((void*)0) : (copy_call = (bala_ccode_node_unref (copy_call), ((void*)0)))); |
| 26080 | _bala_code_node_unref0 (st)((st == ((void*)0)) ? ((void*)0) : (st = (bala_code_node_unref (st), ((void*)0)))); |
| 26081 | _bala_code_node_unref0 (vt)((vt == ((void*)0)) ? ((void*)0) : (vt = (bala_code_node_unref (vt), ((void*)0)))); |
| 26082 | _bala_ccode_node_unref0 (ctemp)((ctemp == ((void*)0)) ? ((void*)0) : (ctemp = (bala_ccode_node_unref (ctemp), ((void*)0)))); |
| 26083 | _bala_target_value_unref0 (temp_cvalue)((temp_cvalue == ((void*)0)) ? ((void*)0) : (temp_cvalue = (bala_target_value_unref (temp_cvalue), ((void*)0)))); |
| 26084 | _bala_target_value_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_target_value_unref (_result_), ((void*)0)))); |
| 26085 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 26086 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 26087 | return result; |
| 26088 | } |
| 26089 | _tmp117_ = type; |
| 26090 | _tmp118_ = bala_code_node_get_source_reference (node); |
| 26091 | _tmp119_ = _tmp118_; |
| 26092 | _tmp120_ = bala_ccode_base_module_get_dup_func_expression (self, _tmp117_, _tmp119_, FALSE(0)); |
| 26093 | dupexpr = _tmp120_; |
| 26094 | _tmp121_ = dupexpr; |
| 26095 | if (_tmp121_ == NULL((void*)0)) { |
| 26096 | bala_code_node_set_error (node, TRUE(!(0))); |
| 26097 | result = NULL((void*)0); |
| 26098 | _bala_ccode_node_unref0 (dupexpr)((dupexpr == ((void*)0)) ? ((void*)0) : (dupexpr = (bala_ccode_node_unref (dupexpr), ((void*)0)))); |
| 26099 | _bala_target_value_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_target_value_unref (_result_), ((void*)0)))); |
| 26100 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 26101 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 26102 | return result; |
| 26103 | } |
| 26104 | _tmp125_ = dupexpr; |
| 26105 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp125_, BALA_TYPE_CCODE_IDENTIFIER)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp125_); GType __t = ((bala_ccode_identifier_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 26106 | BalaDataType* _tmp126_; |
| 26107 | _tmp126_ = type; |
| 26108 | _tmp124_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp126_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp126_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 26109 | } else { |
| 26110 | _tmp124_ = FALSE(0); |
| 26111 | } |
| 26112 | if (_tmp124_) { |
| 26113 | BalaDataType* _tmp127_; |
| 26114 | _tmp127_ = type; |
| 26115 | _tmp123_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp127_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp127_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 26116 | } else { |
| 26117 | _tmp123_ = FALSE(0); |
| 26118 | } |
| 26119 | if (_tmp123_) { |
| 26120 | BalaDataType* _tmp128_; |
| 26121 | _tmp128_ = type; |
| 26122 | _tmp122_ = !bala_is_ref_function_void (_tmp128_); |
| 26123 | } else { |
| 26124 | _tmp122_ = FALSE(0); |
| 26125 | } |
| 26126 | if (_tmp122_) { |
| 26127 | BalaCCodeIdentifier* dupid = NULL((void*)0); |
| 26128 | BalaCCodeExpression* _tmp129_; |
| 26129 | BalaCCodeIdentifier* _tmp130_; |
| 26130 | gchar* dup0_func = NULL((void*)0); |
| 26131 | BalaCCodeIdentifier* _tmp131_; |
| 26132 | const gchar* _tmp132_; |
| 26133 | const gchar* _tmp133_; |
| 26134 | gchar* _tmp134_; |
| 26135 | BalaCCodeIdentifier* _tmp135_; |
| 26136 | const gchar* _tmp136_; |
| 26137 | const gchar* _tmp137_; |
| 26138 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 26139 | const gchar* _tmp173_; |
| 26140 | BalaCCodeIdentifier* _tmp174_; |
| 26141 | BalaCCodeIdentifier* _tmp175_; |
| 26142 | BalaCCodeFunctionCall* _tmp176_; |
| 26143 | BalaCCodeFunctionCall* _tmp177_; |
| 26144 | BalaCCodeFunctionCall* _tmp178_; |
| 26145 | BalaCCodeExpression* _tmp179_; |
| 26146 | BalaGLibValue* _tmp180_; |
| 26147 | BalaCCodeFunctionCall* _tmp181_; |
| 26148 | BalaCCodeExpression* _tmp182_; |
| 26149 | BalaGLibValue* _tmp183_; |
| 26150 | BalaDataType* _tmp184_; |
| 26151 | BalaDataType* _tmp185_; |
| 26152 | BalaGLibValue* _tmp186_; |
| 26153 | BalaTargetValue* _tmp187_; |
| 26154 | _tmp129_ = dupexpr; |
| 26155 | _tmp130_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp129_, BALA_TYPE_CCODE_IDENTIFIER, BalaCCodeIdentifier)(((BalaCCodeIdentifier*) g_type_check_instance_cast ((GTypeInstance *) (_tmp129_), ((bala_ccode_identifier_get_type ())))))); |
| 26156 | dupid = _tmp130_; |
| 26157 | _tmp131_ = dupid; |
| 26158 | _tmp132_ = bala_ccode_identifier_get_name (_tmp131_); |
| 26159 | _tmp133_ = _tmp132_; |
| 26160 | _tmp134_ = g_strdup_printf ("_%s0", _tmp133_); |
| 26161 | dup0_func = _tmp134_; |
| 26162 | _tmp135_ = dupid; |
| 26163 | _tmp136_ = bala_ccode_identifier_get_name (_tmp135_); |
| 26164 | _tmp137_ = _tmp136_; |
| 26165 | if (g_strcmp0 (_tmp137_, "g_strdup") == 0) { |
| 26166 | BalaCCodeIdentifier* _tmp138_; |
| 26167 | const gchar* _tmp139_; |
| 26168 | const gchar* _tmp140_; |
| 26169 | gchar* _tmp141_; |
| 26170 | _tmp138_ = dupid; |
| 26171 | _tmp139_ = bala_ccode_identifier_get_name (_tmp138_); |
| 26172 | _tmp140_ = _tmp139_; |
| 26173 | _tmp141_ = g_strdup (_tmp140_); |
| 26174 | _g_free0 (dup0_func)(dup0_func = (g_free (dup0_func), ((void*)0))); |
| 26175 | dup0_func = _tmp141_; |
| 26176 | } else { |
| 26177 | const gchar* _tmp142_; |
| 26178 | _tmp142_ = dup0_func; |
| 26179 | if (bala_ccode_base_module_add_wrapper (self, _tmp142_)) { |
| 26180 | BalaCCodeFunction* dup0_fun = NULL((void*)0); |
| 26181 | const gchar* _tmp143_; |
| 26182 | BalaDataType* _tmp144_; |
| 26183 | gchar* _tmp145_; |
| 26184 | gchar* _tmp146_; |
| 26185 | BalaCCodeFunction* _tmp147_; |
| 26186 | BalaCCodeFunction* _tmp148_; |
| 26187 | BalaCCodeFunction* _tmp149_; |
| 26188 | BalaDataType* _tmp150_; |
| 26189 | gchar* _tmp151_; |
| 26190 | gchar* _tmp152_; |
| 26191 | BalaCCodeParameter* _tmp153_; |
| 26192 | BalaCCodeParameter* _tmp154_; |
| 26193 | BalaCCodeFunction* _tmp155_; |
| 26194 | BalaCCodeFunction* _tmp156_; |
| 26195 | BalaCCodeFunctionCall* dup_call = NULL((void*)0); |
| 26196 | BalaCCodeExpression* _tmp157_; |
| 26197 | BalaCCodeFunctionCall* _tmp158_; |
| 26198 | BalaCCodeFunctionCall* _tmp159_; |
| 26199 | BalaCCodeIdentifier* _tmp160_; |
| 26200 | BalaCCodeIdentifier* _tmp161_; |
| 26201 | BalaCCodeFunction* _tmp162_; |
| 26202 | BalaCCodeFunction* _tmp163_; |
| 26203 | BalaCCodeIdentifier* _tmp164_; |
| 26204 | BalaCCodeIdentifier* _tmp165_; |
| 26205 | BalaCCodeFunctionCall* _tmp166_; |
| 26206 | BalaCCodeConstant* _tmp167_; |
| 26207 | BalaCCodeConstant* _tmp168_; |
| 26208 | BalaCCodeConditionalExpression* _tmp169_; |
| 26209 | BalaCCodeConditionalExpression* _tmp170_; |
| 26210 | BalaCCodeFile* _tmp171_; |
| 26211 | BalaCCodeFunction* _tmp172_; |
| 26212 | _tmp143_ = dup0_func; |
| 26213 | _tmp144_ = self->pointer_type; |
| 26214 | _tmp145_ = bala_get_ccode_name ((BalaCodeNode*) _tmp144_); |
| 26215 | _tmp146_ = _tmp145_; |
| 26216 | _tmp147_ = bala_ccode_function_new (_tmp143_, _tmp146_); |
| 26217 | _tmp148_ = _tmp147_; |
| 26218 | _g_free0 (_tmp146_)(_tmp146_ = (g_free (_tmp146_), ((void*)0))); |
| 26219 | dup0_fun = _tmp148_; |
| 26220 | _tmp149_ = dup0_fun; |
| 26221 | _tmp150_ = self->pointer_type; |
| 26222 | _tmp151_ = bala_get_ccode_name ((BalaCodeNode*) _tmp150_); |
| 26223 | _tmp152_ = _tmp151_; |
| 26224 | _tmp153_ = bala_ccode_parameter_new ("self", _tmp152_); |
| 26225 | _tmp154_ = _tmp153_; |
| 26226 | bala_ccode_function_add_parameter (_tmp149_, _tmp154_); |
| 26227 | _bala_ccode_node_unref0 (_tmp154_)((_tmp154_ == ((void*)0)) ? ((void*)0) : (_tmp154_ = (bala_ccode_node_unref (_tmp154_), ((void*)0)))); |
| 26228 | _g_free0 (_tmp152_)(_tmp152_ = (g_free (_tmp152_), ((void*)0))); |
| 26229 | _tmp155_ = dup0_fun; |
| 26230 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp155_, BALA_CCODE_MODIFIERS_STATIC); |
| 26231 | _tmp156_ = dup0_fun; |
| 26232 | bala_ccode_base_module_push_function (self, _tmp156_); |
| 26233 | _tmp157_ = dupexpr; |
| 26234 | _tmp158_ = bala_ccode_function_call_new (_tmp157_); |
| 26235 | dup_call = _tmp158_; |
| 26236 | _tmp159_ = dup_call; |
| 26237 | _tmp160_ = bala_ccode_identifier_new ("self"); |
| 26238 | _tmp161_ = _tmp160_; |
| 26239 | bala_ccode_function_call_add_argument (_tmp159_, (BalaCCodeExpression*) _tmp161_); |
| 26240 | _bala_ccode_node_unref0 (_tmp161_)((_tmp161_ == ((void*)0)) ? ((void*)0) : (_tmp161_ = (bala_ccode_node_unref (_tmp161_), ((void*)0)))); |
| 26241 | _tmp162_ = bala_ccode_base_module_get_ccode (self); |
| 26242 | _tmp163_ = _tmp162_; |
| 26243 | _tmp164_ = bala_ccode_identifier_new ("self"); |
| 26244 | _tmp165_ = _tmp164_; |
| 26245 | _tmp166_ = dup_call; |
| 26246 | _tmp167_ = bala_ccode_constant_new ("NULL"); |
| 26247 | _tmp168_ = _tmp167_; |
| 26248 | _tmp169_ = bala_ccode_conditional_expression_new ((BalaCCodeExpression*) _tmp165_, (BalaCCodeExpression*) _tmp166_, (BalaCCodeExpression*) _tmp168_); |
| 26249 | _tmp170_ = _tmp169_; |
| 26250 | bala_ccode_function_add_return (_tmp163_, (BalaCCodeExpression*) _tmp170_); |
| 26251 | _bala_ccode_node_unref0 (_tmp170_)((_tmp170_ == ((void*)0)) ? ((void*)0) : (_tmp170_ = (bala_ccode_node_unref (_tmp170_), ((void*)0)))); |
| 26252 | _bala_ccode_node_unref0 (_tmp168_)((_tmp168_ == ((void*)0)) ? ((void*)0) : (_tmp168_ = (bala_ccode_node_unref (_tmp168_), ((void*)0)))); |
| 26253 | _bala_ccode_node_unref0 (_tmp165_)((_tmp165_ == ((void*)0)) ? ((void*)0) : (_tmp165_ = (bala_ccode_node_unref (_tmp165_), ((void*)0)))); |
| 26254 | bala_ccode_base_module_pop_function (self); |
| 26255 | _tmp171_ = self->cfile; |
| 26256 | _tmp172_ = dup0_fun; |
| 26257 | bala_ccode_file_add_function (_tmp171_, _tmp172_); |
| 26258 | _bala_ccode_node_unref0 (dup_call)((dup_call == ((void*)0)) ? ((void*)0) : (dup_call = (bala_ccode_node_unref (dup_call), ((void*)0)))); |
| 26259 | _bala_ccode_node_unref0 (dup0_fun)((dup0_fun == ((void*)0)) ? ((void*)0) : (dup0_fun = (bala_ccode_node_unref (dup0_fun), ((void*)0)))); |
| 26260 | } |
| 26261 | } |
| 26262 | _tmp173_ = dup0_func; |
| 26263 | _tmp174_ = bala_ccode_identifier_new (_tmp173_); |
| 26264 | _tmp175_ = _tmp174_; |
| 26265 | _tmp176_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp175_); |
| 26266 | _tmp177_ = _tmp176_; |
| 26267 | _bala_ccode_node_unref0 (_tmp175_)((_tmp175_ == ((void*)0)) ? ((void*)0) : (_tmp175_ = (bala_ccode_node_unref (_tmp175_), ((void*)0)))); |
| 26268 | ccall = _tmp177_; |
| 26269 | _tmp178_ = ccall; |
| 26270 | _tmp179_ = cexpr; |
| 26271 | bala_ccode_function_call_add_argument (_tmp178_, _tmp179_); |
| 26272 | _tmp180_ = _result_; |
| 26273 | _tmp181_ = ccall; |
| 26274 | _tmp182_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp181_); |
| 26275 | _bala_ccode_node_unref0 (_tmp180_->cvalue)((_tmp180_->cvalue == ((void*)0)) ? ((void*)0) : (_tmp180_ ->cvalue = (bala_ccode_node_unref (_tmp180_->cvalue), ( (void*)0)))); |
| 26276 | _tmp180_->cvalue = _tmp182_; |
| 26277 | _tmp183_ = _result_; |
| 26278 | _tmp184_ = bala_target_value_get_value_type ((BalaTargetValue*) _tmp183_); |
| 26279 | _tmp185_ = _tmp184_; |
| 26280 | bala_data_type_set_value_owned (_tmp185_, TRUE(!(0))); |
| 26281 | _tmp186_ = _result_; |
| 26282 | _tmp187_ = bala_ccode_base_module_store_temp_value (self, (BalaTargetValue*) _tmp186_, node, NULL((void*)0)); |
| 26283 | result = _tmp187_; |
| 26284 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 26285 | _g_free0 (dup0_func)(dup0_func = (g_free (dup0_func), ((void*)0))); |
| 26286 | _bala_ccode_node_unref0 (dupid)((dupid == ((void*)0)) ? ((void*)0) : (dupid = (bala_ccode_node_unref (dupid), ((void*)0)))); |
| 26287 | _bala_ccode_node_unref0 (dupexpr)((dupexpr == ((void*)0)) ? ((void*)0) : (dupexpr = (bala_ccode_node_unref (dupexpr), ((void*)0)))); |
| 26288 | _bala_target_value_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_target_value_unref (_result_), ((void*)0)))); |
| 26289 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 26290 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 26291 | return result; |
| 26292 | } |
| 26293 | _tmp188_ = dupexpr; |
| 26294 | _tmp189_ = bala_ccode_function_call_new (_tmp188_); |
| 26295 | ccall = _tmp189_; |
| 26296 | _tmp192_ = type; |
| 26297 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp192_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp192_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 26298 | _tmp191_ = bala_get_non_null (value); |
| 26299 | } else { |
| 26300 | _tmp191_ = FALSE(0); |
| 26301 | } |
| 26302 | if (_tmp191_) { |
| 26303 | BalaDataType* _tmp193_; |
| 26304 | _tmp193_ = type; |
| 26305 | _tmp190_ = !bala_is_ref_function_void (_tmp193_); |
| 26306 | } else { |
| 26307 | _tmp190_ = FALSE(0); |
| 26308 | } |
| 26309 | if (_tmp190_) { |
| 26310 | BalaCCodeFunctionCall* _tmp194_; |
| 26311 | BalaCCodeExpression* _tmp195_; |
| 26312 | BalaDataType* _tmp196_; |
| 26313 | BalaCCodeFunctionCall* _tmp197_; |
| 26314 | BalaGLibValue* _tmp198_; |
| 26315 | BalaGLibValue* _tmp199_; |
| 26316 | BalaTargetValue* _tmp200_; |
| 26317 | BalaTargetValue* _tmp201_; |
| 26318 | _tmp194_ = ccall; |
| 26319 | _tmp195_ = cexpr; |
| 26320 | bala_ccode_function_call_add_argument (_tmp194_, _tmp195_); |
| 26321 | _tmp196_ = type; |
| 26322 | _tmp197_ = ccall; |
| 26323 | _tmp198_ = bala_glib_value_new (_tmp196_, (BalaCCodeExpression*) _tmp197_, FALSE(0)); |
| 26324 | _tmp199_ = _tmp198_; |
| 26325 | _tmp200_ = bala_ccode_base_module_store_temp_value (self, (BalaTargetValue*) _tmp199_, node, NULL((void*)0)); |
| 26326 | _tmp201_ = _tmp200_; |
| 26327 | _bala_target_value_unref0 (_tmp199_)((_tmp199_ == ((void*)0)) ? ((void*)0) : (_tmp199_ = (bala_target_value_unref (_tmp199_), ((void*)0)))); |
| 26328 | result = _tmp201_; |
| 26329 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 26330 | _bala_ccode_node_unref0 (dupexpr)((dupexpr == ((void*)0)) ? ((void*)0) : (dupexpr = (bala_ccode_node_unref (dupexpr), ((void*)0)))); |
| 26331 | _bala_target_value_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_target_value_unref (_result_), ((void*)0)))); |
| 26332 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 26333 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 26334 | return result; |
| 26335 | } else { |
| 26336 | BalaCCodeBinaryExpression* cnotnull = NULL((void*)0); |
| 26337 | BalaCCodeExpression* _tmp202_; |
| 26338 | BalaCCodeConstant* _tmp203_; |
| 26339 | BalaCCodeConstant* _tmp204_; |
| 26340 | BalaCCodeBinaryExpression* _tmp205_; |
| 26341 | BalaCCodeBinaryExpression* _tmp206_; |
| 26342 | BalaDataType* _tmp207_; |
| 26343 | BalaDataType* _tmp220_; |
| 26344 | BalaDataType* _tmp230_; |
| 26345 | BalaCCodeExpression* cifnull = NULL((void*)0); |
| 26346 | BalaDataType* _tmp249_; |
| 26347 | BalaTypeSymbol* _tmp250_; |
| 26348 | BalaTypeSymbol* _tmp251_; |
| 26349 | BalaDataType* _tmp258_; |
| 26350 | _tmp202_ = cexpr; |
| 26351 | _tmp203_ = bala_ccode_constant_new ("NULL"); |
| 26352 | _tmp204_ = _tmp203_; |
| 26353 | _tmp205_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_INEQUALITY, _tmp202_, (BalaCCodeExpression*) _tmp204_); |
| 26354 | _tmp206_ = _tmp205_; |
| 26355 | _bala_ccode_node_unref0 (_tmp204_)((_tmp204_ == ((void*)0)) ? ((void*)0) : (_tmp204_ = (bala_ccode_node_unref (_tmp204_), ((void*)0)))); |
| 26356 | cnotnull = _tmp206_; |
| 26357 | _tmp207_ = type; |
| 26358 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp207_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp207_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 26359 | BalaCCodeBinaryExpression* cdupnotnull = NULL((void*)0); |
| 26360 | BalaDataType* _tmp208_; |
| 26361 | BalaSourceReference* _tmp209_; |
| 26362 | BalaSourceReference* _tmp210_; |
| 26363 | BalaCCodeExpression* _tmp211_; |
| 26364 | BalaCCodeExpression* _tmp212_; |
| 26365 | BalaCCodeConstant* _tmp213_; |
| 26366 | BalaCCodeConstant* _tmp214_; |
| 26367 | BalaCCodeBinaryExpression* _tmp215_; |
| 26368 | BalaCCodeBinaryExpression* _tmp216_; |
| 26369 | BalaCCodeBinaryExpression* _tmp217_; |
| 26370 | BalaCCodeBinaryExpression* _tmp218_; |
| 26371 | BalaCCodeBinaryExpression* _tmp219_; |
| 26372 | _tmp208_ = type; |
| 26373 | _tmp209_ = bala_code_node_get_source_reference (node); |
| 26374 | _tmp210_ = _tmp209_; |
| 26375 | _tmp211_ = bala_ccode_base_module_get_dup_func_expression (self, _tmp208_, _tmp210_, FALSE(0)); |
| 26376 | _tmp212_ = _tmp211_; |
| 26377 | _tmp213_ = bala_ccode_constant_new ("NULL"); |
| 26378 | _tmp214_ = _tmp213_; |
| 26379 | _tmp215_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_INEQUALITY, _tmp212_, (BalaCCodeExpression*) _tmp214_); |
| 26380 | _tmp216_ = _tmp215_; |
| 26381 | _bala_ccode_node_unref0 (_tmp214_)((_tmp214_ == ((void*)0)) ? ((void*)0) : (_tmp214_ = (bala_ccode_node_unref (_tmp214_), ((void*)0)))); |
| 26382 | _bala_ccode_node_unref0 (_tmp212_)((_tmp212_ == ((void*)0)) ? ((void*)0) : (_tmp212_ = (bala_ccode_node_unref (_tmp212_), ((void*)0)))); |
| 26383 | cdupnotnull = _tmp216_; |
| 26384 | _tmp217_ = cnotnull; |
| 26385 | _tmp218_ = cdupnotnull; |
| 26386 | _tmp219_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_AND, (BalaCCodeExpression*) _tmp217_, (BalaCCodeExpression*) _tmp218_); |
| 26387 | _bala_ccode_node_unref0 (cnotnull)((cnotnull == ((void*)0)) ? ((void*)0) : (cnotnull = (bala_ccode_node_unref (cnotnull), ((void*)0)))); |
| 26388 | cnotnull = _tmp219_; |
| 26389 | _bala_ccode_node_unref0 (cdupnotnull)((cdupnotnull == ((void*)0)) ? ((void*)0) : (cdupnotnull = (bala_ccode_node_unref (cdupnotnull), ((void*)0)))); |
| 26390 | } |
| 26391 | _tmp220_ = type; |
| 26392 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp220_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp220_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 26393 | BalaCCodeFunctionCall* _tmp221_; |
| 26394 | BalaCCodeExpression* _tmp222_; |
| 26395 | BalaDataType* _tmp223_; |
| 26396 | gchar* _tmp224_; |
| 26397 | gchar* _tmp225_; |
| 26398 | BalaCCodeCastExpression* _tmp226_; |
| 26399 | BalaCCodeCastExpression* _tmp227_; |
| 26400 | _tmp221_ = ccall; |
| 26401 | _tmp222_ = cexpr; |
| 26402 | _tmp223_ = self->pointer_type; |
| 26403 | _tmp224_ = bala_get_ccode_name ((BalaCodeNode*) _tmp223_); |
| 26404 | _tmp225_ = _tmp224_; |
| 26405 | _tmp226_ = bala_ccode_cast_expression_new (_tmp222_, _tmp225_); |
| 26406 | _tmp227_ = _tmp226_; |
| 26407 | bala_ccode_function_call_add_argument (_tmp221_, (BalaCCodeExpression*) _tmp227_); |
| 26408 | _bala_ccode_node_unref0 (_tmp227_)((_tmp227_ == ((void*)0)) ? ((void*)0) : (_tmp227_ = (bala_ccode_node_unref (_tmp227_), ((void*)0)))); |
| 26409 | _g_free0 (_tmp225_)(_tmp225_ = (g_free (_tmp225_), ((void*)0))); |
| 26410 | } else { |
| 26411 | BalaCCodeFunctionCall* _tmp228_; |
| 26412 | BalaCCodeExpression* _tmp229_; |
| 26413 | _tmp228_ = ccall; |
| 26414 | _tmp229_ = cexpr; |
| 26415 | bala_ccode_function_call_add_argument (_tmp228_, _tmp229_); |
| 26416 | } |
| 26417 | _tmp230_ = type; |
| 26418 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp230_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp230_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 26419 | BalaArrayType* array_type = NULL((void*)0); |
| 26420 | BalaDataType* _tmp231_; |
| 26421 | BalaArrayType* _tmp232_; |
| 26422 | BalaCCodeFunctionCall* _tmp233_; |
| 26423 | BalaCCodeExpression* _tmp234_; |
| 26424 | BalaCCodeExpression* _tmp235_; |
| 26425 | BalaArrayType* _tmp236_; |
| 26426 | BalaDataType* _tmp237_; |
| 26427 | BalaDataType* _tmp238_; |
| 26428 | _tmp231_ = type; |
| 26429 | _tmp232_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp231_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp231_), ((bala_array_type_get_type ())))))); |
| 26430 | array_type = _tmp232_; |
| 26431 | _tmp233_ = ccall; |
| 26432 | _tmp234_ = bala_ccode_base_module_get_array_length_cvalue (self, value, -1); |
| 26433 | _tmp235_ = _tmp234_; |
| 26434 | bala_ccode_function_call_add_argument (_tmp233_, _tmp235_); |
| 26435 | _bala_ccode_node_unref0 (_tmp235_)((_tmp235_ == ((void*)0)) ? ((void*)0) : (_tmp235_ = (bala_ccode_node_unref (_tmp235_), ((void*)0)))); |
| 26436 | _tmp236_ = array_type; |
| 26437 | _tmp237_ = bala_array_type_get_element_type (_tmp236_); |
| 26438 | _tmp238_ = _tmp237_; |
| 26439 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp238_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp238_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 26440 | BalaCCodeExpression* elem_dupexpr = NULL((void*)0); |
| 26441 | BalaArrayType* _tmp239_; |
| 26442 | BalaDataType* _tmp240_; |
| 26443 | BalaDataType* _tmp241_; |
| 26444 | BalaSourceReference* _tmp242_; |
| 26445 | BalaSourceReference* _tmp243_; |
| 26446 | BalaCCodeExpression* _tmp244_; |
| 26447 | BalaCCodeExpression* _tmp245_; |
| 26448 | BalaCCodeFunctionCall* _tmp247_; |
| 26449 | BalaCCodeExpression* _tmp248_; |
| 26450 | _tmp239_ = array_type; |
| 26451 | _tmp240_ = bala_array_type_get_element_type (_tmp239_); |
| 26452 | _tmp241_ = _tmp240_; |
| 26453 | _tmp242_ = bala_code_node_get_source_reference (node); |
| 26454 | _tmp243_ = _tmp242_; |
| 26455 | _tmp244_ = bala_ccode_base_module_get_dup_func_expression (self, _tmp241_, _tmp243_, FALSE(0)); |
| 26456 | elem_dupexpr = _tmp244_; |
| 26457 | _tmp245_ = elem_dupexpr; |
| 26458 | if (_tmp245_ == NULL((void*)0)) { |
| 26459 | BalaCCodeConstant* _tmp246_; |
| 26460 | _tmp246_ = bala_ccode_constant_new ("NULL"); |
| 26461 | _bala_ccode_node_unref0 (elem_dupexpr)((elem_dupexpr == ((void*)0)) ? ((void*)0) : (elem_dupexpr = ( bala_ccode_node_unref (elem_dupexpr), ((void*)0)))); |
| 26462 | elem_dupexpr = (BalaCCodeExpression*) _tmp246_; |
| 26463 | } |
| 26464 | _tmp247_ = ccall; |
| 26465 | _tmp248_ = elem_dupexpr; |
| 26466 | bala_ccode_function_call_add_argument (_tmp247_, _tmp248_); |
| 26467 | _bala_ccode_node_unref0 (elem_dupexpr)((elem_dupexpr == ((void*)0)) ? ((void*)0) : (elem_dupexpr = ( bala_ccode_node_unref (elem_dupexpr), ((void*)0)))); |
| 26468 | } |
| 26469 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 26470 | } |
| 26471 | _tmp249_ = type; |
| 26472 | _tmp250_ = bala_data_type_get_type_symbol (_tmp249_); |
| 26473 | _tmp251_ = _tmp250_; |
| 26474 | if (_tmp251_ != NULL((void*)0)) { |
| 26475 | BalaCCodeConstant* _tmp252_; |
| 26476 | _tmp252_ = bala_ccode_constant_new ("NULL"); |
| 26477 | _bala_ccode_node_unref0 (cifnull)((cifnull == ((void*)0)) ? ((void*)0) : (cifnull = (bala_ccode_node_unref (cifnull), ((void*)0)))); |
| 26478 | cifnull = (BalaCCodeExpression*) _tmp252_; |
| 26479 | } else { |
| 26480 | BalaCCodeExpression* _tmp253_; |
| 26481 | BalaDataType* _tmp254_; |
| 26482 | gchar* _tmp255_; |
| 26483 | gchar* _tmp256_; |
| 26484 | BalaCCodeCastExpression* _tmp257_; |
| 26485 | _tmp253_ = cexpr; |
| 26486 | _tmp254_ = self->pointer_type; |
| 26487 | _tmp255_ = bala_get_ccode_name ((BalaCodeNode*) _tmp254_); |
| 26488 | _tmp256_ = _tmp255_; |
| 26489 | _tmp257_ = bala_ccode_cast_expression_new (_tmp253_, _tmp256_); |
| 26490 | _bala_ccode_node_unref0 (cifnull)((cifnull == ((void*)0)) ? ((void*)0) : (cifnull = (bala_ccode_node_unref (cifnull), ((void*)0)))); |
| 26491 | cifnull = (BalaCCodeExpression*) _tmp257_; |
| 26492 | _g_free0 (_tmp256_)(_tmp256_ = (g_free (_tmp256_), ((void*)0))); |
| 26493 | } |
| 26494 | _tmp258_ = type; |
| 26495 | if (bala_is_ref_function_void (_tmp258_)) { |
| 26496 | BalaCCodeFunction* _tmp259_; |
| 26497 | BalaCCodeFunction* _tmp260_; |
| 26498 | BalaCCodeBinaryExpression* _tmp261_; |
| 26499 | BalaCCodeFunction* _tmp262_; |
| 26500 | BalaCCodeFunction* _tmp263_; |
| 26501 | BalaCCodeFunctionCall* _tmp264_; |
| 26502 | BalaCCodeFunction* _tmp265_; |
| 26503 | BalaCCodeFunction* _tmp266_; |
| 26504 | _tmp259_ = bala_ccode_base_module_get_ccode (self); |
| 26505 | _tmp260_ = _tmp259_; |
| 26506 | _tmp261_ = cnotnull; |
| 26507 | bala_ccode_function_open_if (_tmp260_, (BalaCCodeExpression*) _tmp261_); |
| 26508 | _tmp262_ = bala_ccode_base_module_get_ccode (self); |
| 26509 | _tmp263_ = _tmp262_; |
| 26510 | _tmp264_ = ccall; |
| 26511 | bala_ccode_function_add_expression (_tmp263_, (BalaCCodeExpression*) _tmp264_); |
| 26512 | _tmp265_ = bala_ccode_base_module_get_ccode (self); |
| 26513 | _tmp266_ = _tmp265_; |
| 26514 | bala_ccode_function_close (_tmp266_); |
| 26515 | } else { |
| 26516 | BalaGLibValue* _tmp277_; |
| 26517 | gboolean _tmp278_; |
| 26518 | BalaTargetValue* _tmp279_; |
| 26519 | if (bala_get_non_null (value)) { |
| 26520 | BalaGLibValue* _tmp267_; |
| 26521 | BalaCCodeFunctionCall* _tmp268_; |
| 26522 | BalaCCodeExpression* _tmp269_; |
| 26523 | _tmp267_ = _result_; |
| 26524 | _tmp268_ = ccall; |
| 26525 | _tmp269_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp268_); |
| 26526 | _bala_ccode_node_unref0 (_tmp267_->cvalue)((_tmp267_->cvalue == ((void*)0)) ? ((void*)0) : (_tmp267_ ->cvalue = (bala_ccode_node_unref (_tmp267_->cvalue), ( (void*)0)))); |
| 26527 | _tmp267_->cvalue = _tmp269_; |
| 26528 | } else { |
| 26529 | BalaCCodeConditionalExpression* ccond = NULL((void*)0); |
| 26530 | BalaCCodeBinaryExpression* _tmp270_; |
| 26531 | BalaCCodeFunctionCall* _tmp271_; |
| 26532 | BalaCCodeExpression* _tmp272_; |
| 26533 | BalaCCodeConditionalExpression* _tmp273_; |
| 26534 | BalaGLibValue* _tmp274_; |
| 26535 | BalaCCodeConditionalExpression* _tmp275_; |
| 26536 | BalaCCodeExpression* _tmp276_; |
| 26537 | _tmp270_ = cnotnull; |
| 26538 | _tmp271_ = ccall; |
| 26539 | _tmp272_ = cifnull; |
| 26540 | _tmp273_ = bala_ccode_conditional_expression_new ((BalaCCodeExpression*) _tmp270_, (BalaCCodeExpression*) _tmp271_, _tmp272_); |
| 26541 | ccond = _tmp273_; |
| 26542 | _tmp274_ = _result_; |
| 26543 | _tmp275_ = ccond; |
| 26544 | _tmp276_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp275_); |
| 26545 | _bala_ccode_node_unref0 (_tmp274_->cvalue)((_tmp274_->cvalue == ((void*)0)) ? ((void*)0) : (_tmp274_ ->cvalue = (bala_ccode_node_unref (_tmp274_->cvalue), ( (void*)0)))); |
| 26546 | _tmp274_->cvalue = _tmp276_; |
| 26547 | _bala_ccode_node_unref0 (ccond)((ccond == ((void*)0)) ? ((void*)0) : (ccond = (bala_ccode_node_unref (ccond), ((void*)0)))); |
| 26548 | } |
| 26549 | _tmp277_ = _result_; |
| 26550 | _tmp278_ = TRUE(!(0)); |
| 26551 | _tmp279_ = bala_ccode_base_module_store_temp_value (self, (BalaTargetValue*) _tmp277_, node, &_tmp278_); |
| 26552 | _bala_target_value_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_target_value_unref (_result_), ((void*)0)))); |
| 26553 | _result_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp279_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp279_), ((bala_glib_value_get_type ()))))); |
| 26554 | } |
| 26555 | result = (BalaTargetValue*) _result_; |
| 26556 | _bala_ccode_node_unref0 (cifnull)((cifnull == ((void*)0)) ? ((void*)0) : (cifnull = (bala_ccode_node_unref (cifnull), ((void*)0)))); |
| 26557 | _bala_ccode_node_unref0 (cnotnull)((cnotnull == ((void*)0)) ? ((void*)0) : (cnotnull = (bala_ccode_node_unref (cnotnull), ((void*)0)))); |
| 26558 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 26559 | _bala_ccode_node_unref0 (dupexpr)((dupexpr == ((void*)0)) ? ((void*)0) : (dupexpr = (bala_ccode_node_unref (dupexpr), ((void*)0)))); |
| 26560 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 26561 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 26562 | return result; |
| 26563 | } |
| 26564 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 26565 | _bala_ccode_node_unref0 (dupexpr)((dupexpr == ((void*)0)) ? ((void*)0) : (dupexpr = (bala_ccode_node_unref (dupexpr), ((void*)0)))); |
| 26566 | _bala_target_value_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_target_value_unref (_result_), ((void*)0)))); |
| 26567 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 26568 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 26569 | } |
| 26570 | |
| 26571 | BalaTargetValue* |
| 26572 | bala_ccode_base_module_copy_value (BalaCCodeBaseModule* self, |
| 26573 | BalaTargetValue* value, |
| 26574 | BalaCodeNode* node) |
| 26575 | { |
| 26576 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 26577 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->copy_value (self, value, node); |
| 26578 | } |
| 26579 | |
| 26580 | static void |
| 26581 | bala_ccode_base_module_real_generate_class_declaration (BalaCCodeBaseModule* self, |
| 26582 | BalaClass* cl, |
| 26583 | BalaCCodeFile* decl_space) |
| 26584 | { |
| 26585 | gchar* _tmp0_; |
| 26586 | gchar* _tmp1_; |
| 26587 | gboolean _tmp2_; |
| 26588 | g_return_if_fail (cl != NULL)do { if ((cl != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "cl != NULL"); return; } } while (0); |
| 26589 | g_return_if_fail (decl_space != NULL)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return; } } while (0); |
| 26590 | _tmp0_ = bala_get_ccode_name ((BalaCodeNode*) cl); |
| 26591 | _tmp1_ = _tmp0_; |
| 26592 | _tmp2_ = bala_ccode_base_module_add_symbol_declaration (self, decl_space, (BalaSymbol*) cl, _tmp1_); |
| 26593 | _g_free0 (_tmp1_)(_tmp1_ = (g_free (_tmp1_), ((void*)0))); |
| 26594 | if (_tmp2_) { |
| 26595 | return; |
| 26596 | } |
| 26597 | } |
| 26598 | |
| 26599 | void |
| 26600 | bala_ccode_base_module_generate_class_declaration (BalaCCodeBaseModule* self, |
| 26601 | BalaClass* cl, |
| 26602 | BalaCCodeFile* decl_space) |
| 26603 | { |
| 26604 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 26605 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->generate_class_declaration (self, cl, decl_space); |
| 26606 | } |
| 26607 | |
| 26608 | static void |
| 26609 | bala_ccode_base_module_real_generate_interface_declaration (BalaCCodeBaseModule* self, |
| 26610 | BalaInterface* iface, |
| 26611 | BalaCCodeFile* decl_space) |
| 26612 | { |
| 26613 | g_return_if_fail (iface != NULL)do { if ((iface != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "iface != NULL" ); return; } } while (0); |
| 26614 | g_return_if_fail (decl_space != NULL)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return; } } while (0); |
| 26615 | } |
| 26616 | |
| 26617 | void |
| 26618 | bala_ccode_base_module_generate_interface_declaration (BalaCCodeBaseModule* self, |
| 26619 | BalaInterface* iface, |
| 26620 | BalaCCodeFile* decl_space) |
| 26621 | { |
| 26622 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 26623 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->generate_interface_declaration (self, iface, decl_space); |
| 26624 | } |
| 26625 | |
| 26626 | static gboolean |
| 26627 | bala_ccode_base_module_real_generate_method_declaration (BalaCCodeBaseModule* self, |
| 26628 | BalaMethod* m, |
| 26629 | BalaCCodeFile* decl_space) |
| 26630 | { |
| 26631 | gboolean result = FALSE(0); |
| 26632 | g_return_val_if_fail (m != NULL, FALSE)do { if ((m != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "m != NULL"); return ((0)); } } while (0); |
| 26633 | g_return_val_if_fail (decl_space != NULL, FALSE)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return ((0)); } } while (0); |
| 26634 | result = FALSE(0); |
| 26635 | return result; |
| 26636 | } |
| 26637 | |
| 26638 | gboolean |
| 26639 | bala_ccode_base_module_generate_method_declaration (BalaCCodeBaseModule* self, |
| 26640 | BalaMethod* m, |
| 26641 | BalaCCodeFile* decl_space) |
| 26642 | { |
| 26643 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 26644 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->generate_method_declaration (self, m, decl_space); |
| 26645 | } |
| 26646 | |
| 26647 | static void |
| 26648 | bala_ccode_base_module_real_generate_error_domain_declaration (BalaCCodeBaseModule* self, |
| 26649 | BalaErrorDomain* edomain, |
| 26650 | BalaCCodeFile* decl_space) |
| 26651 | { |
| 26652 | g_return_if_fail (edomain != NULL)do { if ((edomain != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "edomain != NULL" ); return; } } while (0); |
| 26653 | g_return_if_fail (decl_space != NULL)do { if ((decl_space != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "decl_space != NULL" ); return; } } while (0); |
| 26654 | } |
| 26655 | |
| 26656 | void |
| 26657 | bala_ccode_base_module_generate_error_domain_declaration (BalaCCodeBaseModule* self, |
| 26658 | BalaErrorDomain* edomain, |
| 26659 | BalaCCodeFile* decl_space) |
| 26660 | { |
| 26661 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 26662 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->generate_error_domain_declaration (self, edomain, decl_space); |
| 26663 | } |
| 26664 | |
| 26665 | void |
| 26666 | bala_ccode_base_module_add_generic_type_arguments (BalaCCodeBaseModule* self, |
| 26667 | BalaMap* arg_map, |
| 26668 | BalaList* type_args, |
| 26669 | BalaCodeNode* expr, |
| 26670 | gboolean is_chainup, |
| 26671 | BalaList* type_parameters) |
| 26672 | { |
| 26673 | gint type_param_index = 0; |
| 26674 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 26675 | g_return_if_fail (arg_map != NULL)do { if ((arg_map != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "arg_map != NULL" ); return; } } while (0); |
| 26676 | g_return_if_fail (type_args != NULL)do { if ((type_args != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type_args != NULL" ); return; } } while (0); |
| 26677 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 26678 | type_param_index = 0; |
| 26679 | { |
| 26680 | BalaList* _type_arg_list = NULL((void*)0); |
| 26681 | BalaList* _tmp0_; |
| 26682 | gint _type_arg_size = 0; |
| 26683 | BalaList* _tmp1_; |
| 26684 | gint _tmp2_; |
| 26685 | gint _tmp3_; |
| 26686 | gint _type_arg_index = 0; |
| 26687 | _tmp0_ = _bala_iterable_ref0 (type_args); |
| 26688 | _type_arg_list = _tmp0_; |
| 26689 | _tmp1_ = _type_arg_list; |
| 26690 | _tmp2_ = bala_collection_get_size ((BalaCollection*) _tmp1_); |
| 26691 | _tmp3_ = _tmp2_; |
| 26692 | _type_arg_size = _tmp3_; |
| 26693 | _type_arg_index = -1; |
| 26694 | while (TRUE(!(0))) { |
| 26695 | gint _tmp4_; |
| 26696 | gint _tmp5_; |
| 26697 | BalaDataType* type_arg = NULL((void*)0); |
| 26698 | BalaList* _tmp6_; |
| 26699 | gpointer _tmp7_; |
| 26700 | BalaDataType* _tmp31_; |
| 26701 | BalaCCodeExpression* _tmp32_; |
| 26702 | BalaCCodeExpression* _tmp33_; |
| 26703 | BalaDataType* _tmp34_; |
| 26704 | gint _tmp53_; |
| 26705 | _type_arg_index = _type_arg_index + 1; |
| 26706 | _tmp4_ = _type_arg_index; |
| 26707 | _tmp5_ = _type_arg_size; |
| 26708 | if (!(_tmp4_ < _tmp5_)) { |
| 26709 | break; |
| 26710 | } |
| 26711 | _tmp6_ = _type_arg_list; |
| 26712 | _tmp7_ = bala_list_get (_tmp6_, _type_arg_index); |
| 26713 | type_arg = (BalaDataType*) _tmp7_; |
| 26714 | if (type_parameters != NULL((void*)0)) { |
| 26715 | gchar* type_param_name = NULL((void*)0); |
| 26716 | gpointer _tmp8_; |
| 26717 | BalaTypeParameter* _tmp9_; |
| 26718 | const gchar* _tmp10_; |
| 26719 | const gchar* _tmp11_; |
| 26720 | gchar* _tmp12_; |
| 26721 | gchar* _tmp13_; |
| 26722 | gchar* _tmp14_; |
| 26723 | gchar* _tmp15_; |
| 26724 | const gchar* _tmp16_; |
| 26725 | gchar* _tmp17_; |
| 26726 | gchar* _tmp18_; |
| 26727 | BalaCCodeConstant* _tmp19_; |
| 26728 | BalaCCodeConstant* _tmp20_; |
| 26729 | const gchar* _tmp21_; |
| 26730 | gchar* _tmp22_; |
| 26731 | gchar* _tmp23_; |
| 26732 | BalaCCodeConstant* _tmp24_; |
| 26733 | BalaCCodeConstant* _tmp25_; |
| 26734 | const gchar* _tmp26_; |
| 26735 | gchar* _tmp27_; |
| 26736 | gchar* _tmp28_; |
| 26737 | BalaCCodeConstant* _tmp29_; |
| 26738 | BalaCCodeConstant* _tmp30_; |
| 26739 | _tmp8_ = bala_list_get (type_parameters, type_param_index); |
| 26740 | _tmp9_ = (BalaTypeParameter*) _tmp8_; |
| 26741 | _tmp10_ = bala_symbol_get_name ((BalaSymbol*) _tmp9_); |
| 26742 | _tmp11_ = _tmp10_; |
| 26743 | _tmp12_ = g_ascii_strdown (_tmp11_, (gssize) -1); |
| 26744 | _tmp13_ = _tmp12_; |
| 26745 | _tmp14_ = string_replace (_tmp13_, "_", "-"); |
| 26746 | _tmp15_ = _tmp14_; |
| 26747 | _g_free0 (_tmp13_)(_tmp13_ = (g_free (_tmp13_), ((void*)0))); |
| 26748 | _bala_code_node_unref0 (_tmp9_)((_tmp9_ == ((void*)0)) ? ((void*)0) : (_tmp9_ = (bala_code_node_unref (_tmp9_), ((void*)0)))); |
| 26749 | type_param_name = _tmp15_; |
| 26750 | _tmp16_ = type_param_name; |
| 26751 | _tmp17_ = g_strdup_printf ("\"%s-type\"", _tmp16_); |
| 26752 | _tmp18_ = _tmp17_; |
| 26753 | _tmp19_ = bala_ccode_constant_new (_tmp18_); |
| 26754 | _tmp20_ = _tmp19_; |
| 26755 | bala_map_set (arg_map, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (0.1 * type_param_index) + 0.01, FALSE(0))), (BalaCCodeExpression*) _tmp20_); |
| 26756 | _bala_ccode_node_unref0 (_tmp20_)((_tmp20_ == ((void*)0)) ? ((void*)0) : (_tmp20_ = (bala_ccode_node_unref (_tmp20_), ((void*)0)))); |
| 26757 | _g_free0 (_tmp18_)(_tmp18_ = (g_free (_tmp18_), ((void*)0))); |
| 26758 | _tmp21_ = type_param_name; |
| 26759 | _tmp22_ = g_strdup_printf ("\"%s-dup-func\"", _tmp21_); |
| 26760 | _tmp23_ = _tmp22_; |
| 26761 | _tmp24_ = bala_ccode_constant_new (_tmp23_); |
| 26762 | _tmp25_ = _tmp24_; |
| 26763 | bala_map_set (arg_map, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (0.1 * type_param_index) + 0.03, FALSE(0))), (BalaCCodeExpression*) _tmp25_); |
| 26764 | _bala_ccode_node_unref0 (_tmp25_)((_tmp25_ == ((void*)0)) ? ((void*)0) : (_tmp25_ = (bala_ccode_node_unref (_tmp25_), ((void*)0)))); |
| 26765 | _g_free0 (_tmp23_)(_tmp23_ = (g_free (_tmp23_), ((void*)0))); |
| 26766 | _tmp26_ = type_param_name; |
| 26767 | _tmp27_ = g_strdup_printf ("\"%s-destroy-func\"", _tmp26_); |
| 26768 | _tmp28_ = _tmp27_; |
| 26769 | _tmp29_ = bala_ccode_constant_new (_tmp28_); |
| 26770 | _tmp30_ = _tmp29_; |
| 26771 | bala_map_set (arg_map, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (0.1 * type_param_index) + 0.05, FALSE(0))), (BalaCCodeExpression*) _tmp30_); |
| 26772 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 26773 | _g_free0 (_tmp28_)(_tmp28_ = (g_free (_tmp28_), ((void*)0))); |
| 26774 | _g_free0 (type_param_name)(type_param_name = (g_free (type_param_name), ((void*)0))); |
| 26775 | } |
| 26776 | _tmp31_ = type_arg; |
| 26777 | _tmp32_ = bala_ccode_base_module_get_type_id_expression (self, _tmp31_, is_chainup); |
| 26778 | _tmp33_ = _tmp32_; |
| 26779 | bala_map_set (arg_map, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (0.1 * type_param_index) + 0.02, FALSE(0))), _tmp33_); |
| 26780 | _bala_ccode_node_unref0 (_tmp33_)((_tmp33_ == ((void*)0)) ? ((void*)0) : (_tmp33_ = (bala_ccode_node_unref (_tmp33_), ((void*)0)))); |
| 26781 | _tmp34_ = type_arg; |
| 26782 | if (bala_ccode_base_module_requires_copy (_tmp34_)) { |
| 26783 | BalaCCodeExpression* dup_func = NULL((void*)0); |
| 26784 | BalaDataType* _tmp35_; |
| 26785 | BalaDataType* _tmp36_; |
| 26786 | BalaSourceReference* _tmp37_; |
| 26787 | BalaSourceReference* _tmp38_; |
| 26788 | BalaCCodeExpression* _tmp39_; |
| 26789 | BalaCCodeExpression* _tmp40_; |
| 26790 | BalaCCodeExpression* _tmp41_; |
| 26791 | BalaCCodeCastExpression* _tmp42_; |
| 26792 | BalaCCodeCastExpression* _tmp43_; |
| 26793 | BalaDataType* _tmp44_; |
| 26794 | BalaCCodeExpression* _tmp45_; |
| 26795 | BalaCCodeExpression* _tmp46_; |
| 26796 | BalaCCodeCastExpression* _tmp47_; |
| 26797 | BalaCCodeCastExpression* _tmp48_; |
| 26798 | _tmp35_ = type_arg; |
| 26799 | _tmp36_ = type_arg; |
| 26800 | _tmp37_ = bala_code_node_get_source_reference ((BalaCodeNode*) _tmp36_); |
| 26801 | _tmp38_ = _tmp37_; |
| 26802 | _tmp39_ = bala_ccode_base_module_get_dup_func_expression (self, _tmp35_, _tmp38_, is_chainup); |
| 26803 | dup_func = _tmp39_; |
| 26804 | _tmp40_ = dup_func; |
| 26805 | if (_tmp40_ == NULL((void*)0)) { |
| 26806 | bala_code_node_set_error (expr, TRUE(!(0))); |
| 26807 | _bala_ccode_node_unref0 (dup_func)((dup_func == ((void*)0)) ? ((void*)0) : (dup_func = (bala_ccode_node_unref (dup_func), ((void*)0)))); |
| 26808 | _bala_code_node_unref0 (type_arg)((type_arg == ((void*)0)) ? ((void*)0) : (type_arg = (bala_code_node_unref (type_arg), ((void*)0)))); |
| 26809 | _bala_iterable_unref0 (_type_arg_list)((_type_arg_list == ((void*)0)) ? ((void*)0) : (_type_arg_list = (bala_iterable_unref (_type_arg_list), ((void*)0)))); |
| 26810 | return; |
| 26811 | } |
| 26812 | _tmp41_ = dup_func; |
| 26813 | _tmp42_ = bala_ccode_cast_expression_new (_tmp41_, "GBoxedCopyFunc"); |
| 26814 | _tmp43_ = _tmp42_; |
| 26815 | bala_map_set (arg_map, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (0.1 * type_param_index) + 0.04, FALSE(0))), (BalaCCodeExpression*) _tmp43_); |
| 26816 | _bala_ccode_node_unref0 (_tmp43_)((_tmp43_ == ((void*)0)) ? ((void*)0) : (_tmp43_ = (bala_ccode_node_unref (_tmp43_), ((void*)0)))); |
| 26817 | _tmp44_ = type_arg; |
| 26818 | _tmp45_ = bala_ccode_base_module_get_destroy_func_expression (self, _tmp44_, is_chainup); |
| 26819 | _tmp46_ = _tmp45_; |
| 26820 | _tmp47_ = bala_ccode_cast_expression_new (_tmp46_, "GDestroyNotify"); |
| 26821 | _tmp48_ = _tmp47_; |
| 26822 | bala_map_set (arg_map, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (0.1 * type_param_index) + 0.06, FALSE(0))), (BalaCCodeExpression*) _tmp48_); |
| 26823 | _bala_ccode_node_unref0 (_tmp48_)((_tmp48_ == ((void*)0)) ? ((void*)0) : (_tmp48_ = (bala_ccode_node_unref (_tmp48_), ((void*)0)))); |
| 26824 | _bala_ccode_node_unref0 (_tmp46_)((_tmp46_ == ((void*)0)) ? ((void*)0) : (_tmp46_ = (bala_ccode_node_unref (_tmp46_), ((void*)0)))); |
| 26825 | _bala_ccode_node_unref0 (dup_func)((dup_func == ((void*)0)) ? ((void*)0) : (dup_func = (bala_ccode_node_unref (dup_func), ((void*)0)))); |
| 26826 | } else { |
| 26827 | BalaCCodeConstant* _tmp49_; |
| 26828 | BalaCCodeConstant* _tmp50_; |
| 26829 | BalaCCodeConstant* _tmp51_; |
| 26830 | BalaCCodeConstant* _tmp52_; |
| 26831 | _tmp49_ = bala_ccode_constant_new ("NULL"); |
| 26832 | _tmp50_ = _tmp49_; |
| 26833 | bala_map_set (arg_map, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (0.1 * type_param_index) + 0.04, FALSE(0))), (BalaCCodeExpression*) _tmp50_); |
| 26834 | _bala_ccode_node_unref0 (_tmp50_)((_tmp50_ == ((void*)0)) ? ((void*)0) : (_tmp50_ = (bala_ccode_node_unref (_tmp50_), ((void*)0)))); |
| 26835 | _tmp51_ = bala_ccode_constant_new ("NULL"); |
| 26836 | _tmp52_ = _tmp51_; |
| 26837 | bala_map_set (arg_map, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (0.1 * type_param_index) + 0.06, FALSE(0))), (BalaCCodeExpression*) _tmp52_); |
| 26838 | _bala_ccode_node_unref0 (_tmp52_)((_tmp52_ == ((void*)0)) ? ((void*)0) : (_tmp52_ = (bala_ccode_node_unref (_tmp52_), ((void*)0)))); |
| 26839 | } |
| 26840 | _tmp53_ = type_param_index; |
| 26841 | type_param_index = _tmp53_ + 1; |
| 26842 | _bala_code_node_unref0 (type_arg)((type_arg == ((void*)0)) ? ((void*)0) : (type_arg = (bala_code_node_unref (type_arg), ((void*)0)))); |
| 26843 | } |
| 26844 | _bala_iterable_unref0 (_type_arg_list)((_type_arg_list == ((void*)0)) ? ((void*)0) : (_type_arg_list = (bala_iterable_unref (_type_arg_list), ((void*)0)))); |
| 26845 | } |
| 26846 | } |
| 26847 | |
| 26848 | static gpointer |
| 26849 | _bala_map_ref0 (gpointer self) |
| 26850 | { |
| 26851 | return self ? bala_map_ref (self) : NULL((void*)0); |
| 26852 | } |
| 26853 | |
| 26854 | static void |
| 26855 | bala_ccode_base_module_real_visit_object_creation_expression (BalaCodeVisitor* base, |
| 26856 | BalaObjectCreationExpression* expr) |
| 26857 | { |
| 26858 | BalaCCodeBaseModule * self; |
| 26859 | BalaCCodeExpression* instance = NULL((void*)0); |
| 26860 | BalaCCodeExpression* creation_expr = NULL((void*)0); |
| 26861 | BalaStruct* st = NULL((void*)0); |
| 26862 | BalaDataType* _tmp0_; |
| 26863 | BalaDataType* _tmp1_; |
| 26864 | BalaTypeSymbol* _tmp2_; |
| 26865 | BalaTypeSymbol* _tmp3_; |
| 26866 | gboolean _tmp4_ = FALSE(0); |
| 26867 | gboolean _tmp5_ = FALSE(0); |
| 26868 | BalaStruct* _tmp6_; |
| 26869 | BalaSymbol* _tmp134_; |
| 26870 | BalaSymbol* _tmp135_; |
| 26871 | BalaLocalVariable* local = NULL((void*)0); |
| 26872 | BalaCodeNode* _tmp645_; |
| 26873 | BalaCodeNode* _tmp646_; |
| 26874 | BalaLocalVariable* _tmp647_; |
| 26875 | gboolean _tmp648_ = FALSE(0); |
| 26876 | BalaLocalVariable* _tmp649_; |
| 26877 | BalaTargetValue* _tmp884_; |
| 26878 | BalaTargetValue* _tmp885_; |
| 26879 | self = (BalaCCodeBaseModule*) base; |
| 26880 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 26881 | instance = NULL((void*)0); |
| 26882 | creation_expr = NULL((void*)0); |
| 26883 | _tmp0_ = bala_object_creation_expression_get_type_reference (expr); |
| 26884 | _tmp1_ = _tmp0_; |
| 26885 | _tmp2_ = bala_data_type_get_type_symbol (_tmp1_); |
| 26886 | _tmp3_ = _tmp2_; |
| 26887 | st = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp3_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp3_) : NULL((void*)0); |
| 26888 | _tmp6_ = st; |
| 26889 | if (_tmp6_ != NULL((void*)0)) { |
| 26890 | gboolean _tmp7_ = FALSE(0); |
| 26891 | BalaStruct* _tmp8_; |
| 26892 | _tmp8_ = st; |
| 26893 | if (!bala_struct_is_simple_type (_tmp8_)) { |
| 26894 | _tmp7_ = TRUE(!(0)); |
| 26895 | } else { |
| 26896 | BalaStruct* _tmp9_; |
| 26897 | gchar* _tmp10_; |
| 26898 | gchar* _tmp11_; |
| 26899 | _tmp9_ = st; |
| 26900 | _tmp10_ = bala_get_ccode_name ((BalaCodeNode*) _tmp9_); |
| 26901 | _tmp11_ = _tmp10_; |
| 26902 | _tmp7_ = g_strcmp0 (_tmp11_, "va_list") == 0; |
| 26903 | _g_free0 (_tmp11_)(_tmp11_ = (g_free (_tmp11_), ((void*)0))); |
| 26904 | } |
| 26905 | _tmp5_ = _tmp7_; |
| 26906 | } else { |
| 26907 | _tmp5_ = FALSE(0); |
| 26908 | } |
| 26909 | if (_tmp5_) { |
| 26910 | _tmp4_ = TRUE(!(0)); |
| 26911 | } else { |
| 26912 | BalaList* _tmp12_; |
| 26913 | gint _tmp13_; |
| 26914 | gint _tmp14_; |
| 26915 | _tmp12_ = bala_object_creation_expression_get_object_initializer (expr); |
| 26916 | _tmp13_ = bala_collection_get_size ((BalaCollection*) _tmp12_); |
| 26917 | _tmp14_ = _tmp13_; |
| 26918 | _tmp4_ = _tmp14_ > 0; |
| 26919 | } |
| 26920 | if (_tmp4_) { |
| 26921 | BalaLocalVariable* local = NULL((void*)0); |
| 26922 | BalaCodeNode* _tmp15_; |
| 26923 | BalaCodeNode* _tmp16_; |
| 26924 | BalaLocalVariable* _tmp17_; |
| 26925 | BalaField* field = NULL((void*)0); |
| 26926 | BalaCodeNode* _tmp18_; |
| 26927 | BalaCodeNode* _tmp19_; |
| 26928 | BalaField* _tmp20_; |
| 26929 | BalaAssignment* a = NULL((void*)0); |
| 26930 | BalaCodeNode* _tmp21_; |
| 26931 | BalaCodeNode* _tmp22_; |
| 26932 | BalaAssignment* _tmp23_; |
| 26933 | gboolean _tmp24_ = FALSE(0); |
| 26934 | BalaLocalVariable* _tmp25_; |
| 26935 | _tmp15_ = bala_code_node_get_parent_node ((BalaCodeNode*) expr); |
| 26936 | _tmp16_ = _tmp15_; |
| 26937 | _tmp17_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, BALA_TYPE_LOCAL_VARIABLE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp16_); GType __t = ((bala_local_variable_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaLocalVariable*) _tmp16_) : NULL((void*)0)); |
| 26938 | local = _tmp17_; |
| 26939 | _tmp18_ = bala_code_node_get_parent_node ((BalaCodeNode*) expr); |
| 26940 | _tmp19_ = _tmp18_; |
| 26941 | _tmp20_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, BALA_TYPE_FIELD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp19_); GType __t = ((bala_field_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaField*) _tmp19_) : NULL((void*)0)); |
| 26942 | field = _tmp20_; |
| 26943 | _tmp21_ = bala_code_node_get_parent_node ((BalaCodeNode*) expr); |
| 26944 | _tmp22_ = _tmp21_; |
| 26945 | _tmp23_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp22_, BALA_TYPE_ASSIGNMENT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp22_); GType __t = ((bala_assignment_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaAssignment*) _tmp22_) : NULL((void*)0)); |
| 26946 | a = _tmp23_; |
| 26947 | _tmp25_ = local; |
| 26948 | if (_tmp25_ != NULL((void*)0)) { |
| 26949 | BalaLocalVariable* _tmp26_; |
| 26950 | BalaLocalVariable* _tmp27_; |
| 26951 | BalaExpression* _tmp28_; |
| 26952 | BalaExpression* _tmp29_; |
| 26953 | _tmp26_ = local; |
| 26954 | _tmp27_ = local; |
| 26955 | _tmp28_ = bala_variable_get_initializer ((BalaVariable*) _tmp27_); |
| 26956 | _tmp29_ = _tmp28_; |
| 26957 | _tmp24_ = bala_ccode_base_module_is_simple_struct_creation (self, (BalaVariable*) _tmp26_, _tmp29_); |
| 26958 | } else { |
| 26959 | _tmp24_ = FALSE(0); |
| 26960 | } |
| 26961 | if (_tmp24_) { |
| 26962 | BalaLocalVariable* _tmp30_; |
| 26963 | BalaTargetValue* _tmp31_; |
| 26964 | BalaTargetValue* _tmp32_; |
| 26965 | BalaCCodeExpression* _tmp33_; |
| 26966 | BalaCCodeExpression* _tmp34_; |
| 26967 | _tmp30_ = local; |
| 26968 | _tmp31_ = bala_ccode_base_module_get_local_cvalue (self, _tmp30_); |
| 26969 | _tmp32_ = _tmp31_; |
| 26970 | _tmp33_ = bala_get_cvalue_ (_tmp32_); |
| 26971 | _tmp34_ = _bala_ccode_node_ref0 (_tmp33_); |
| 26972 | _bala_ccode_node_unref0 (instance)((instance == ((void*)0)) ? ((void*)0) : (instance = (bala_ccode_node_unref (instance), ((void*)0)))); |
| 26973 | instance = _tmp34_; |
| 26974 | _bala_target_value_unref0 (_tmp32_)((_tmp32_ == ((void*)0)) ? ((void*)0) : (_tmp32_ = (bala_target_value_unref (_tmp32_), ((void*)0)))); |
| 26975 | } else { |
| 26976 | gboolean _tmp35_ = FALSE(0); |
| 26977 | BalaField* _tmp36_; |
| 26978 | _tmp36_ = field; |
| 26979 | if (_tmp36_ != NULL((void*)0)) { |
| 26980 | BalaField* _tmp37_; |
| 26981 | BalaField* _tmp38_; |
| 26982 | BalaExpression* _tmp39_; |
| 26983 | BalaExpression* _tmp40_; |
| 26984 | _tmp37_ = field; |
| 26985 | _tmp38_ = field; |
| 26986 | _tmp39_ = bala_variable_get_initializer ((BalaVariable*) _tmp38_); |
| 26987 | _tmp40_ = _tmp39_; |
| 26988 | _tmp35_ = bala_ccode_base_module_is_simple_struct_creation (self, (BalaVariable*) _tmp37_, _tmp40_); |
| 26989 | } else { |
| 26990 | _tmp35_ = FALSE(0); |
| 26991 | } |
| 26992 | if (_tmp35_) { |
| 26993 | BalaTargetValue* thisparam = NULL((void*)0); |
| 26994 | BalaField* _tmp41_; |
| 26995 | BalaSymbol* _tmp42_; |
| 26996 | BalaSymbol* _tmp43_; |
| 26997 | BalaTargetValue* _tmp44_; |
| 26998 | BalaField* _tmp45_; |
| 26999 | BalaTargetValue* _tmp46_; |
| 27000 | BalaTargetValue* _tmp47_; |
| 27001 | BalaTargetValue* _tmp48_; |
| 27002 | BalaCCodeExpression* _tmp49_; |
| 27003 | BalaCCodeExpression* _tmp50_; |
| 27004 | _tmp41_ = field; |
| 27005 | _tmp42_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp41_); |
| 27006 | _tmp43_ = _tmp42_; |
| 27007 | _tmp44_ = bala_ccode_base_module_load_this_parameter (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp43_), ((bala_typesymbol_get_type ())))))); |
| 27008 | thisparam = _tmp44_; |
| 27009 | _tmp45_ = field; |
| 27010 | _tmp46_ = thisparam; |
| 27011 | _tmp47_ = bala_ccode_base_module_get_field_cvalue (self, _tmp45_, _tmp46_); |
| 27012 | _tmp48_ = _tmp47_; |
| 27013 | _tmp49_ = bala_get_cvalue_ (_tmp48_); |
| 27014 | _tmp50_ = _bala_ccode_node_ref0 (_tmp49_); |
| 27015 | _bala_ccode_node_unref0 (instance)((instance == ((void*)0)) ? ((void*)0) : (instance = (bala_ccode_node_unref (instance), ((void*)0)))); |
| 27016 | instance = _tmp50_; |
| 27017 | _bala_target_value_unref0 (_tmp48_)((_tmp48_ == ((void*)0)) ? ((void*)0) : (_tmp48_ = (bala_target_value_unref (_tmp48_), ((void*)0)))); |
| 27018 | _bala_target_value_unref0 (thisparam)((thisparam == ((void*)0)) ? ((void*)0) : (thisparam = (bala_target_value_unref (thisparam), ((void*)0)))); |
| 27019 | } else { |
| 27020 | gboolean _tmp51_ = FALSE(0); |
| 27021 | gboolean _tmp52_ = FALSE(0); |
| 27022 | BalaAssignment* _tmp53_; |
| 27023 | _tmp53_ = a; |
| 27024 | if (_tmp53_ != NULL((void*)0)) { |
| 27025 | BalaAssignment* _tmp54_; |
| 27026 | BalaExpression* _tmp55_; |
| 27027 | BalaExpression* _tmp56_; |
| 27028 | BalaSymbol* _tmp57_; |
| 27029 | BalaSymbol* _tmp58_; |
| 27030 | _tmp54_ = a; |
| 27031 | _tmp55_ = bala_assignment_get_left (_tmp54_); |
| 27032 | _tmp56_ = _tmp55_; |
| 27033 | _tmp57_ = bala_expression_get_symbol_reference (_tmp56_); |
| 27034 | _tmp58_ = _tmp57_; |
| 27035 | _tmp52_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp58_, BALA_TYPE_VARIABLE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp58_); GType __t = ((bala_variable_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 27036 | } else { |
| 27037 | _tmp52_ = FALSE(0); |
| 27038 | } |
| 27039 | if (_tmp52_) { |
| 27040 | BalaAssignment* _tmp59_; |
| 27041 | BalaExpression* _tmp60_; |
| 27042 | BalaExpression* _tmp61_; |
| 27043 | BalaSymbol* _tmp62_; |
| 27044 | BalaSymbol* _tmp63_; |
| 27045 | BalaAssignment* _tmp64_; |
| 27046 | BalaExpression* _tmp65_; |
| 27047 | BalaExpression* _tmp66_; |
| 27048 | _tmp59_ = a; |
| 27049 | _tmp60_ = bala_assignment_get_left (_tmp59_); |
| 27050 | _tmp61_ = _tmp60_; |
| 27051 | _tmp62_ = bala_expression_get_symbol_reference (_tmp61_); |
| 27052 | _tmp63_ = _tmp62_; |
| 27053 | _tmp64_ = a; |
| 27054 | _tmp65_ = bala_assignment_get_right (_tmp64_); |
| 27055 | _tmp66_ = _tmp65_; |
| 27056 | _tmp51_ = bala_ccode_base_module_is_simple_struct_creation (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp63_, BALA_TYPE_VARIABLE, BalaVariable)(((BalaVariable*) g_type_check_instance_cast ((GTypeInstance* ) (_tmp63_), ((bala_variable_get_type ()))))), _tmp66_); |
| 27057 | } else { |
| 27058 | _tmp51_ = FALSE(0); |
| 27059 | } |
| 27060 | if (_tmp51_) { |
| 27061 | BalaAssignment* _tmp67_; |
| 27062 | BalaExpression* _tmp68_; |
| 27063 | BalaExpression* _tmp69_; |
| 27064 | BalaDataType* _tmp70_; |
| 27065 | BalaDataType* _tmp71_; |
| 27066 | BalaAssignment* _tmp81_; |
| 27067 | BalaExpression* _tmp82_; |
| 27068 | BalaExpression* _tmp83_; |
| 27069 | BalaSymbol* _tmp84_; |
| 27070 | BalaSymbol* _tmp85_; |
| 27071 | BalaLocalVariable* _tmp86_; |
| 27072 | BalaAssignment* _tmp87_; |
| 27073 | BalaExpression* _tmp88_; |
| 27074 | BalaExpression* _tmp89_; |
| 27075 | BalaSymbol* _tmp90_; |
| 27076 | BalaSymbol* _tmp91_; |
| 27077 | BalaField* _tmp92_; |
| 27078 | BalaParameter* param = NULL((void*)0); |
| 27079 | BalaAssignment* _tmp93_; |
| 27080 | BalaExpression* _tmp94_; |
| 27081 | BalaExpression* _tmp95_; |
| 27082 | BalaSymbol* _tmp96_; |
| 27083 | BalaSymbol* _tmp97_; |
| 27084 | BalaParameter* _tmp98_; |
| 27085 | BalaLocalVariable* _tmp99_; |
| 27086 | _tmp67_ = a; |
| 27087 | _tmp68_ = bala_assignment_get_left (_tmp67_); |
| 27088 | _tmp69_ = _tmp68_; |
| 27089 | _tmp70_ = bala_expression_get_value_type (_tmp69_); |
| 27090 | _tmp71_ = _tmp70_; |
| 27091 | if (bala_ccode_base_module_requires_destroy (_tmp71_)) { |
| 27092 | BalaCCodeFunction* _tmp72_; |
| 27093 | BalaCCodeFunction* _tmp73_; |
| 27094 | BalaAssignment* _tmp74_; |
| 27095 | BalaExpression* _tmp75_; |
| 27096 | BalaExpression* _tmp76_; |
| 27097 | BalaTargetValue* _tmp77_; |
| 27098 | BalaTargetValue* _tmp78_; |
| 27099 | BalaCCodeExpression* _tmp79_; |
| 27100 | BalaCCodeExpression* _tmp80_; |
| 27101 | _tmp72_ = bala_ccode_base_module_get_ccode (self); |
| 27102 | _tmp73_ = _tmp72_; |
| 27103 | _tmp74_ = a; |
| 27104 | _tmp75_ = bala_assignment_get_left (_tmp74_); |
| 27105 | _tmp76_ = _tmp75_; |
| 27106 | _tmp77_ = bala_expression_get_target_value (_tmp76_); |
| 27107 | _tmp78_ = _tmp77_; |
| 27108 | _tmp79_ = bala_ccode_base_module_destroy_value (self, _tmp78_, FALSE(0)); |
| 27109 | _tmp80_ = _tmp79_; |
| 27110 | bala_ccode_function_add_expression (_tmp73_, _tmp80_); |
| 27111 | _bala_ccode_node_unref0 (_tmp80_)((_tmp80_ == ((void*)0)) ? ((void*)0) : (_tmp80_ = (bala_ccode_node_unref (_tmp80_), ((void*)0)))); |
| 27112 | } |
| 27113 | _tmp81_ = a; |
| 27114 | _tmp82_ = bala_assignment_get_left (_tmp81_); |
| 27115 | _tmp83_ = _tmp82_; |
| 27116 | _tmp84_ = bala_expression_get_symbol_reference (_tmp83_); |
| 27117 | _tmp85_ = _tmp84_; |
| 27118 | _tmp86_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp85_, BALA_TYPE_LOCAL_VARIABLE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp85_); GType __t = ((bala_local_variable_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaLocalVariable*) _tmp85_) : NULL((void*)0)); |
| 27119 | _bala_code_node_unref0 (local)((local == ((void*)0)) ? ((void*)0) : (local = (bala_code_node_unref (local), ((void*)0)))); |
| 27120 | local = _tmp86_; |
| 27121 | _tmp87_ = a; |
| 27122 | _tmp88_ = bala_assignment_get_left (_tmp87_); |
| 27123 | _tmp89_ = _tmp88_; |
| 27124 | _tmp90_ = bala_expression_get_symbol_reference (_tmp89_); |
| 27125 | _tmp91_ = _tmp90_; |
| 27126 | _tmp92_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp91_, BALA_TYPE_FIELD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp91_); GType __t = ((bala_field_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaField*) _tmp91_) : NULL((void*)0)); |
| 27127 | _bala_code_node_unref0 (field)((field == ((void*)0)) ? ((void*)0) : (field = (bala_code_node_unref (field), ((void*)0)))); |
| 27128 | field = _tmp92_; |
| 27129 | _tmp93_ = a; |
| 27130 | _tmp94_ = bala_assignment_get_left (_tmp93_); |
| 27131 | _tmp95_ = _tmp94_; |
| 27132 | _tmp96_ = bala_expression_get_symbol_reference (_tmp95_); |
| 27133 | _tmp97_ = _tmp96_; |
| 27134 | _tmp98_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp97_, BALA_TYPE_PARAMETER)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp97_); GType __t = ((bala_parameter_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaParameter*) _tmp97_) : NULL((void*)0)); |
| 27135 | param = _tmp98_; |
| 27136 | _tmp99_ = local; |
| 27137 | if (_tmp99_ != NULL((void*)0)) { |
| 27138 | BalaLocalVariable* _tmp100_; |
| 27139 | BalaTargetValue* _tmp101_; |
| 27140 | BalaTargetValue* _tmp102_; |
| 27141 | BalaCCodeExpression* _tmp103_; |
| 27142 | BalaCCodeExpression* _tmp104_; |
| 27143 | _tmp100_ = local; |
| 27144 | _tmp101_ = bala_ccode_base_module_get_local_cvalue (self, _tmp100_); |
| 27145 | _tmp102_ = _tmp101_; |
| 27146 | _tmp103_ = bala_get_cvalue_ (_tmp102_); |
| 27147 | _tmp104_ = _bala_ccode_node_ref0 (_tmp103_); |
| 27148 | _bala_ccode_node_unref0 (instance)((instance == ((void*)0)) ? ((void*)0) : (instance = (bala_ccode_node_unref (instance), ((void*)0)))); |
| 27149 | instance = _tmp104_; |
| 27150 | _bala_target_value_unref0 (_tmp102_)((_tmp102_ == ((void*)0)) ? ((void*)0) : (_tmp102_ = (bala_target_value_unref (_tmp102_), ((void*)0)))); |
| 27151 | } else { |
| 27152 | BalaField* _tmp105_; |
| 27153 | _tmp105_ = field; |
| 27154 | if (_tmp105_ != NULL((void*)0)) { |
| 27155 | BalaExpression* inner = NULL((void*)0); |
| 27156 | BalaAssignment* _tmp106_; |
| 27157 | BalaExpression* _tmp107_; |
| 27158 | BalaExpression* _tmp108_; |
| 27159 | BalaExpression* _tmp109_; |
| 27160 | BalaExpression* _tmp110_; |
| 27161 | BalaExpression* _tmp111_; |
| 27162 | BalaTargetValue* _tmp112_ = NULL((void*)0); |
| 27163 | BalaExpression* _tmp113_; |
| 27164 | BalaField* _tmp117_; |
| 27165 | BalaTargetValue* _tmp118_; |
| 27166 | BalaTargetValue* _tmp119_; |
| 27167 | BalaCCodeExpression* _tmp120_; |
| 27168 | BalaCCodeExpression* _tmp121_; |
| 27169 | _tmp106_ = a; |
| 27170 | _tmp107_ = bala_assignment_get_left (_tmp106_); |
| 27171 | _tmp108_ = _tmp107_; |
| 27172 | _tmp109_ = bala_member_access_get_inner (G_TYPE_CHECK_INSTANCE_CAST (_tmp108_, BALA_TYPE_MEMBER_ACCESS, BalaMemberAccess)(((BalaMemberAccess*) g_type_check_instance_cast ((GTypeInstance *) (_tmp108_), ((bala_member_access_get_type ())))))); |
| 27173 | _tmp110_ = _tmp109_; |
| 27174 | _tmp111_ = _bala_code_node_ref0 (_tmp110_); |
| 27175 | inner = _tmp111_; |
| 27176 | _tmp113_ = inner; |
| 27177 | if (_tmp113_ != NULL((void*)0)) { |
| 27178 | BalaExpression* _tmp114_; |
| 27179 | BalaTargetValue* _tmp115_; |
| 27180 | BalaTargetValue* _tmp116_; |
| 27181 | _tmp114_ = inner; |
| 27182 | _tmp115_ = bala_expression_get_target_value (_tmp114_); |
| 27183 | _tmp116_ = _tmp115_; |
| 27184 | _tmp112_ = _tmp116_; |
| 27185 | } else { |
| 27186 | _tmp112_ = NULL((void*)0); |
| 27187 | } |
| 27188 | _tmp117_ = field; |
| 27189 | _tmp118_ = bala_ccode_base_module_get_field_cvalue (self, _tmp117_, _tmp112_); |
| 27190 | _tmp119_ = _tmp118_; |
| 27191 | _tmp120_ = bala_get_cvalue_ (_tmp119_); |
| 27192 | _tmp121_ = _bala_ccode_node_ref0 (_tmp120_); |
| 27193 | _bala_ccode_node_unref0 (instance)((instance == ((void*)0)) ? ((void*)0) : (instance = (bala_ccode_node_unref (instance), ((void*)0)))); |
| 27194 | instance = _tmp121_; |
| 27195 | _bala_target_value_unref0 (_tmp119_)((_tmp119_ == ((void*)0)) ? ((void*)0) : (_tmp119_ = (bala_target_value_unref (_tmp119_), ((void*)0)))); |
| 27196 | _bala_code_node_unref0 (inner)((inner == ((void*)0)) ? ((void*)0) : (inner = (bala_code_node_unref (inner), ((void*)0)))); |
| 27197 | } else { |
| 27198 | BalaParameter* _tmp122_; |
| 27199 | _tmp122_ = param; |
| 27200 | if (_tmp122_ != NULL((void*)0)) { |
| 27201 | BalaParameter* _tmp123_; |
| 27202 | BalaTargetValue* _tmp124_; |
| 27203 | BalaTargetValue* _tmp125_; |
| 27204 | BalaCCodeExpression* _tmp126_; |
| 27205 | BalaCCodeExpression* _tmp127_; |
| 27206 | _tmp123_ = param; |
| 27207 | _tmp124_ = bala_ccode_base_module_get_parameter_cvalue (self, _tmp123_); |
| 27208 | _tmp125_ = _tmp124_; |
| 27209 | _tmp126_ = bala_get_cvalue_ (_tmp125_); |
| 27210 | _tmp127_ = _bala_ccode_node_ref0 (_tmp126_); |
| 27211 | _bala_ccode_node_unref0 (instance)((instance == ((void*)0)) ? ((void*)0) : (instance = (bala_ccode_node_unref (instance), ((void*)0)))); |
| 27212 | instance = _tmp127_; |
| 27213 | _bala_target_value_unref0 (_tmp125_)((_tmp125_ == ((void*)0)) ? ((void*)0) : (_tmp125_ = (bala_target_value_unref (_tmp125_), ((void*)0)))); |
| 27214 | } |
| 27215 | } |
| 27216 | } |
| 27217 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 27218 | } else { |
| 27219 | BalaTargetValue* temp_value = NULL((void*)0); |
| 27220 | BalaDataType* _tmp128_; |
| 27221 | BalaDataType* _tmp129_; |
| 27222 | BalaTargetValue* _tmp130_; |
| 27223 | BalaTargetValue* _tmp131_; |
| 27224 | BalaCCodeExpression* _tmp132_; |
| 27225 | BalaCCodeExpression* _tmp133_; |
| 27226 | _tmp128_ = bala_object_creation_expression_get_type_reference (expr); |
| 27227 | _tmp129_ = _tmp128_; |
| 27228 | _tmp130_ = bala_ccode_base_module_create_temp_value (self, _tmp129_, TRUE(!(0)), (BalaCodeNode*) expr, NULL((void*)0)); |
| 27229 | temp_value = _tmp130_; |
| 27230 | _tmp131_ = temp_value; |
| 27231 | _tmp132_ = bala_get_cvalue_ (_tmp131_); |
| 27232 | _tmp133_ = _bala_ccode_node_ref0 (_tmp132_); |
| 27233 | _bala_ccode_node_unref0 (instance)((instance == ((void*)0)) ? ((void*)0) : (instance = (bala_ccode_node_unref (instance), ((void*)0)))); |
| 27234 | instance = _tmp133_; |
| 27235 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 27236 | } |
| 27237 | } |
| 27238 | } |
| 27239 | _bala_code_node_unref0 (a)((a == ((void*)0)) ? ((void*)0) : (a = (bala_code_node_unref ( a), ((void*)0)))); |
| 27240 | _bala_code_node_unref0 (field)((field == ((void*)0)) ? ((void*)0) : (field = (bala_code_node_unref (field), ((void*)0)))); |
| 27241 | _bala_code_node_unref0 (local)((local == ((void*)0)) ? ((void*)0) : (local = (bala_code_node_unref (local), ((void*)0)))); |
| 27242 | } |
| 27243 | _tmp134_ = bala_expression_get_symbol_reference ((BalaExpression*) expr); |
| 27244 | _tmp135_ = _tmp134_; |
| 27245 | if (_tmp135_ == NULL((void*)0)) { |
| 27246 | BalaDataType* _tmp136_; |
| 27247 | BalaDataType* _tmp137_; |
| 27248 | BalaTypeSymbol* _tmp138_; |
| 27249 | BalaTypeSymbol* _tmp139_; |
| 27250 | _tmp136_ = bala_object_creation_expression_get_type_reference (expr); |
| 27251 | _tmp137_ = _tmp136_; |
| 27252 | _tmp138_ = bala_data_type_get_type_symbol (_tmp137_); |
| 27253 | _tmp139_ = _tmp138_; |
| 27254 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp139_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp139_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 27255 | BalaCCodeFile* _tmp140_; |
| 27256 | BalaCCodeFunctionCall* creation_call = NULL((void*)0); |
| 27257 | BalaCCodeIdentifier* _tmp141_; |
| 27258 | BalaCCodeIdentifier* _tmp142_; |
| 27259 | BalaCCodeFunctionCall* _tmp143_; |
| 27260 | BalaCCodeFunctionCall* _tmp144_; |
| 27261 | BalaCCodeFunctionCall* _tmp145_; |
| 27262 | BalaCCodeExpression* _tmp146_; |
| 27263 | BalaCCodeUnaryExpression* _tmp147_; |
| 27264 | BalaCCodeUnaryExpression* _tmp148_; |
| 27265 | BalaCCodeFunctionCall* _tmp149_; |
| 27266 | BalaCCodeConstant* _tmp150_; |
| 27267 | BalaCCodeConstant* _tmp151_; |
| 27268 | BalaCCodeFunctionCall* _tmp152_; |
| 27269 | BalaDataType* _tmp153_; |
| 27270 | BalaDataType* _tmp154_; |
| 27271 | gchar* _tmp155_; |
| 27272 | gchar* _tmp156_; |
| 27273 | gchar* _tmp157_; |
| 27274 | gchar* _tmp158_; |
| 27275 | BalaCCodeIdentifier* _tmp159_; |
| 27276 | BalaCCodeIdentifier* _tmp160_; |
| 27277 | BalaCCodeFunctionCall* _tmp161_; |
| 27278 | BalaCCodeExpression* _tmp162_; |
| 27279 | _tmp140_ = self->cfile; |
| 27280 | bala_ccode_file_add_include (_tmp140_, "string.h", FALSE(0)); |
| 27281 | _tmp141_ = bala_ccode_identifier_new ("memset"); |
| 27282 | _tmp142_ = _tmp141_; |
| 27283 | _tmp143_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp142_); |
| 27284 | _tmp144_ = _tmp143_; |
| 27285 | _bala_ccode_node_unref0 (_tmp142_)((_tmp142_ == ((void*)0)) ? ((void*)0) : (_tmp142_ = (bala_ccode_node_unref (_tmp142_), ((void*)0)))); |
| 27286 | creation_call = _tmp144_; |
| 27287 | _tmp145_ = creation_call; |
| 27288 | _tmp146_ = instance; |
| 27289 | _tmp147_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp146_); |
| 27290 | _tmp148_ = _tmp147_; |
| 27291 | bala_ccode_function_call_add_argument (_tmp145_, (BalaCCodeExpression*) _tmp148_); |
| 27292 | _bala_ccode_node_unref0 (_tmp148_)((_tmp148_ == ((void*)0)) ? ((void*)0) : (_tmp148_ = (bala_ccode_node_unref (_tmp148_), ((void*)0)))); |
| 27293 | _tmp149_ = creation_call; |
| 27294 | _tmp150_ = bala_ccode_constant_new ("0"); |
| 27295 | _tmp151_ = _tmp150_; |
| 27296 | bala_ccode_function_call_add_argument (_tmp149_, (BalaCCodeExpression*) _tmp151_); |
| 27297 | _bala_ccode_node_unref0 (_tmp151_)((_tmp151_ == ((void*)0)) ? ((void*)0) : (_tmp151_ = (bala_ccode_node_unref (_tmp151_), ((void*)0)))); |
| 27298 | _tmp152_ = creation_call; |
| 27299 | _tmp153_ = bala_object_creation_expression_get_type_reference (expr); |
| 27300 | _tmp154_ = _tmp153_; |
| 27301 | _tmp155_ = bala_get_ccode_name ((BalaCodeNode*) _tmp154_); |
| 27302 | _tmp156_ = _tmp155_; |
| 27303 | _tmp157_ = g_strdup_printf ("sizeof (%s)", _tmp156_); |
| 27304 | _tmp158_ = _tmp157_; |
| 27305 | _tmp159_ = bala_ccode_identifier_new (_tmp158_); |
| 27306 | _tmp160_ = _tmp159_; |
| 27307 | bala_ccode_function_call_add_argument (_tmp152_, (BalaCCodeExpression*) _tmp160_); |
| 27308 | _bala_ccode_node_unref0 (_tmp160_)((_tmp160_ == ((void*)0)) ? ((void*)0) : (_tmp160_ = (bala_ccode_node_unref (_tmp160_), ((void*)0)))); |
| 27309 | _g_free0 (_tmp158_)(_tmp158_ = (g_free (_tmp158_), ((void*)0))); |
| 27310 | _g_free0 (_tmp156_)(_tmp156_ = (g_free (_tmp156_), ((void*)0))); |
| 27311 | _tmp161_ = creation_call; |
| 27312 | _tmp162_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp161_); |
| 27313 | _bala_ccode_node_unref0 (creation_expr)((creation_expr == ((void*)0)) ? ((void*)0) : (creation_expr = (bala_ccode_node_unref (creation_expr), ((void*)0)))); |
| 27314 | creation_expr = _tmp162_; |
| 27315 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 27316 | } |
| 27317 | } else { |
| 27318 | gboolean _tmp163_ = FALSE(0); |
| 27319 | BalaDataType* _tmp164_; |
| 27320 | BalaDataType* _tmp165_; |
| 27321 | BalaTypeSymbol* _tmp166_; |
| 27322 | BalaTypeSymbol* _tmp167_; |
| 27323 | BalaClass* _tmp168_; |
| 27324 | _tmp164_ = bala_object_creation_expression_get_type_reference (expr); |
| 27325 | _tmp165_ = _tmp164_; |
| 27326 | _tmp166_ = bala_data_type_get_type_symbol (_tmp165_); |
| 27327 | _tmp167_ = _tmp166_; |
| 27328 | _tmp168_ = self->glist_type; |
| 27329 | if (_tmp167_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp168_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp168_), ((bala_typesymbol_get_type ())))))) { |
| 27330 | _tmp163_ = TRUE(!(0)); |
| 27331 | } else { |
| 27332 | BalaDataType* _tmp169_; |
| 27333 | BalaDataType* _tmp170_; |
| 27334 | BalaTypeSymbol* _tmp171_; |
| 27335 | BalaTypeSymbol* _tmp172_; |
| 27336 | BalaClass* _tmp173_; |
| 27337 | _tmp169_ = bala_object_creation_expression_get_type_reference (expr); |
| 27338 | _tmp170_ = _tmp169_; |
| 27339 | _tmp171_ = bala_data_type_get_type_symbol (_tmp170_); |
| 27340 | _tmp172_ = _tmp171_; |
| 27341 | _tmp173_ = self->gslist_type; |
| 27342 | _tmp163_ = _tmp172_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp173_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp173_), ((bala_typesymbol_get_type ()))))); |
| 27343 | } |
| 27344 | if (_tmp163_) { |
| 27345 | BalaCCodeConstant* _tmp174_; |
| 27346 | BalaCCodeConstant* _tmp175_; |
| 27347 | _tmp174_ = bala_ccode_constant_new ("NULL"); |
| 27348 | _tmp175_ = _tmp174_; |
| 27349 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp175_); |
| 27350 | _bala_ccode_node_unref0 (_tmp175_)((_tmp175_ == ((void*)0)) ? ((void*)0) : (_tmp175_ = (bala_ccode_node_unref (_tmp175_), ((void*)0)))); |
| 27351 | } else { |
| 27352 | BalaSymbol* _tmp176_; |
| 27353 | BalaSymbol* _tmp177_; |
| 27354 | _tmp176_ = bala_expression_get_symbol_reference ((BalaExpression*) expr); |
| 27355 | _tmp177_ = _tmp176_; |
| 27356 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp177_, BALA_TYPE_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp177_); GType __t = ((bala_method_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 27357 | BalaMethod* m = NULL((void*)0); |
| 27358 | BalaSymbol* _tmp178_; |
| 27359 | BalaSymbol* _tmp179_; |
| 27360 | BalaMethod* _tmp180_; |
| 27361 | BalaList* params = NULL((void*)0); |
| 27362 | BalaMethod* _tmp181_; |
| 27363 | BalaList* _tmp182_; |
| 27364 | BalaList* _tmp183_; |
| 27365 | BalaCCodeFunctionCall* creation_call = NULL((void*)0); |
| 27366 | BalaCCodeFunctionCall* async_call = NULL((void*)0); |
| 27367 | BalaCCodeFunctionCall* finish_call = NULL((void*)0); |
| 27368 | BalaMethod* _tmp184_; |
| 27369 | BalaCCodeFile* _tmp185_; |
| 27370 | BalaClass* cl = NULL((void*)0); |
| 27371 | BalaDataType* _tmp186_; |
| 27372 | BalaDataType* _tmp187_; |
| 27373 | BalaTypeSymbol* _tmp188_; |
| 27374 | BalaTypeSymbol* _tmp189_; |
| 27375 | BalaMethod* _tmp190_; |
| 27376 | gboolean _tmp209_ = FALSE(0); |
| 27377 | gboolean _tmp210_ = FALSE(0); |
| 27378 | BalaStruct* _tmp211_; |
| 27379 | BalaDataType* _tmp281_; |
| 27380 | BalaDataType* _tmp282_; |
| 27381 | BalaCCodeFile* _tmp283_; |
| 27382 | BalaHashMap* in_arg_map = NULL((void*)0); |
| 27383 | GHashFunc _tmp284_; |
| 27384 | GEqualFunc _tmp285_; |
| 27385 | GEqualFunc _tmp286_; |
| 27386 | BalaHashMap* _tmp287_; |
| 27387 | BalaHashMap* out_arg_map = NULL((void*)0); |
| 27388 | BalaHashMap* _tmp288_; |
| 27389 | BalaHashMap* _tmp289_; |
| 27390 | gboolean _tmp290_ = FALSE(0); |
| 27391 | BalaMethod* _tmp291_; |
| 27392 | gboolean _tmp319_ = FALSE(0); |
| 27393 | BalaClass* _tmp320_; |
| 27394 | gboolean ellipsis = FALSE(0); |
| 27395 | gint i = 0; |
| 27396 | gint arg_pos = 0; |
| 27397 | BalaIterator* params_it = NULL((void*)0); |
| 27398 | BalaList* _tmp351_; |
| 27399 | BalaIterator* _tmp352_; |
| 27400 | BalaIterator* _tmp450_; |
| 27401 | gboolean _tmp460_; |
| 27402 | gboolean _tmp461_; |
| 27403 | gboolean _tmp488_ = FALSE(0); |
| 27404 | gboolean _tmp489_ = FALSE(0); |
| 27405 | BalaStruct* _tmp490_; |
| 27406 | gboolean _tmp497_ = FALSE(0); |
| 27407 | BalaMethod* _tmp498_; |
| 27408 | gboolean _tmp514_ = FALSE(0); |
| 27409 | gboolean _tmp515_ = FALSE(0); |
| 27410 | BalaMethod* _tmp516_; |
| 27411 | gint last_pos = 0; |
| 27412 | gint min_pos = 0; |
| 27413 | BalaCCodeFunctionCall* _tmp531_; |
| 27414 | BalaCCodeFunctionCall* _tmp532_; |
| 27415 | BalaCCodeFunctionCall* _tmp547_; |
| 27416 | gboolean _tmp562_; |
| 27417 | gboolean _tmp563_; |
| 27418 | BalaCCodeFunctionCall* _tmp587_; |
| 27419 | BalaCCodeExpression* _tmp588_; |
| 27420 | BalaMethod* _tmp589_; |
| 27421 | gchar* _tmp590_; |
| 27422 | gchar* _tmp591_; |
| 27423 | gboolean _tmp592_; |
| 27424 | _tmp178_ = bala_expression_get_symbol_reference ((BalaExpression*) expr); |
| 27425 | _tmp179_ = _tmp178_; |
| 27426 | _tmp180_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp179_, BALA_TYPE_METHOD, BalaMethod)(((BalaMethod*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp179_), ((bala_method_get_type ())))))); |
| 27427 | m = _tmp180_; |
| 27428 | _tmp181_ = m; |
| 27429 | _tmp182_ = bala_callable_get_parameters ((BalaCallable*) _tmp181_); |
| 27430 | _tmp183_ = _bala_iterable_ref0 (_tmp182_); |
| 27431 | params = _tmp183_; |
| 27432 | async_call = NULL((void*)0); |
| 27433 | finish_call = NULL((void*)0); |
| 27434 | _tmp184_ = m; |
| 27435 | _tmp185_ = self->cfile; |
| 27436 | bala_ccode_base_module_generate_method_declaration (self, _tmp184_, _tmp185_); |
| 27437 | _tmp186_ = bala_object_creation_expression_get_type_reference (expr); |
| 27438 | _tmp187_ = _tmp186_; |
| 27439 | _tmp188_ = bala_data_type_get_type_symbol (_tmp187_); |
| 27440 | _tmp189_ = _tmp188_; |
| 27441 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp189_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp189_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp189_) : NULL((void*)0); |
| 27442 | _tmp190_ = m; |
| 27443 | if (!bala_get_ccode_has_new_function (_tmp190_)) { |
| 27444 | BalaMethod* _tmp191_; |
| 27445 | gchar* _tmp192_; |
| 27446 | gchar* _tmp193_; |
| 27447 | BalaCCodeIdentifier* _tmp194_; |
| 27448 | BalaCCodeIdentifier* _tmp195_; |
| 27449 | BalaCCodeFunctionCall* _tmp196_; |
| 27450 | BalaCCodeFunctionCall* _tmp197_; |
| 27451 | BalaClass* _tmp198_; |
| 27452 | gchar* _tmp199_; |
| 27453 | gchar* _tmp200_; |
| 27454 | BalaCCodeIdentifier* _tmp201_; |
| 27455 | BalaCCodeIdentifier* _tmp202_; |
| 27456 | _tmp191_ = m; |
| 27457 | _tmp192_ = bala_get_ccode_real_name ((BalaSymbol*) _tmp191_); |
| 27458 | _tmp193_ = _tmp192_; |
| 27459 | _tmp194_ = bala_ccode_identifier_new (_tmp193_); |
| 27460 | _tmp195_ = _tmp194_; |
| 27461 | _tmp196_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp195_); |
| 27462 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 27463 | creation_call = _tmp196_; |
| 27464 | _bala_ccode_node_unref0 (_tmp195_)((_tmp195_ == ((void*)0)) ? ((void*)0) : (_tmp195_ = (bala_ccode_node_unref (_tmp195_), ((void*)0)))); |
| 27465 | _g_free0 (_tmp193_)(_tmp193_ = (g_free (_tmp193_), ((void*)0))); |
| 27466 | _tmp197_ = creation_call; |
| 27467 | _tmp198_ = cl; |
| 27468 | _tmp199_ = bala_get_ccode_type_id ((BalaCodeNode*) _tmp198_); |
| 27469 | _tmp200_ = _tmp199_; |
| 27470 | _tmp201_ = bala_ccode_identifier_new (_tmp200_); |
| 27471 | _tmp202_ = _tmp201_; |
| 27472 | bala_ccode_function_call_add_argument (_tmp197_, (BalaCCodeExpression*) _tmp202_); |
| 27473 | _bala_ccode_node_unref0 (_tmp202_)((_tmp202_ == ((void*)0)) ? ((void*)0) : (_tmp202_ = (bala_ccode_node_unref (_tmp202_), ((void*)0)))); |
| 27474 | _g_free0 (_tmp200_)(_tmp200_ = (g_free (_tmp200_), ((void*)0))); |
| 27475 | } else { |
| 27476 | BalaMethod* _tmp203_; |
| 27477 | gchar* _tmp204_; |
| 27478 | gchar* _tmp205_; |
| 27479 | BalaCCodeIdentifier* _tmp206_; |
| 27480 | BalaCCodeIdentifier* _tmp207_; |
| 27481 | BalaCCodeFunctionCall* _tmp208_; |
| 27482 | _tmp203_ = m; |
| 27483 | _tmp204_ = bala_get_ccode_name ((BalaCodeNode*) _tmp203_); |
| 27484 | _tmp205_ = _tmp204_; |
| 27485 | _tmp206_ = bala_ccode_identifier_new (_tmp205_); |
| 27486 | _tmp207_ = _tmp206_; |
| 27487 | _tmp208_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp207_); |
| 27488 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 27489 | creation_call = _tmp208_; |
| 27490 | _bala_ccode_node_unref0 (_tmp207_)((_tmp207_ == ((void*)0)) ? ((void*)0) : (_tmp207_ = (bala_ccode_node_unref (_tmp207_), ((void*)0)))); |
| 27491 | _g_free0 (_tmp205_)(_tmp205_ = (g_free (_tmp205_), ((void*)0))); |
| 27492 | } |
| 27493 | _tmp211_ = st; |
| 27494 | if (_tmp211_ != NULL((void*)0)) { |
| 27495 | BalaStruct* _tmp212_; |
| 27496 | _tmp212_ = st; |
| 27497 | _tmp210_ = !bala_struct_is_simple_type (_tmp212_); |
| 27498 | } else { |
| 27499 | _tmp210_ = FALSE(0); |
| 27500 | } |
| 27501 | if (_tmp210_) { |
| 27502 | BalaMethod* _tmp213_; |
| 27503 | _tmp213_ = m; |
| 27504 | _tmp209_ = !(bala_get_ccode_instance_pos ((BalaCodeNode*) _tmp213_) < ((gdouble) 0)); |
| 27505 | } else { |
| 27506 | _tmp209_ = FALSE(0); |
| 27507 | } |
| 27508 | if (_tmp209_) { |
| 27509 | BalaCCodeFunctionCall* _tmp214_; |
| 27510 | BalaCCodeExpression* _tmp215_; |
| 27511 | BalaCCodeUnaryExpression* _tmp216_; |
| 27512 | BalaCCodeUnaryExpression* _tmp217_; |
| 27513 | _tmp214_ = creation_call; |
| 27514 | _tmp215_ = instance; |
| 27515 | _tmp216_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp215_); |
| 27516 | _tmp217_ = _tmp216_; |
| 27517 | bala_ccode_function_call_add_argument (_tmp214_, (BalaCCodeExpression*) _tmp217_); |
| 27518 | _bala_ccode_node_unref0 (_tmp217_)((_tmp217_ == ((void*)0)) ? ((void*)0) : (_tmp217_ = (bala_ccode_node_unref (_tmp217_), ((void*)0)))); |
| 27519 | } else { |
| 27520 | gboolean _tmp218_ = FALSE(0); |
| 27521 | BalaStruct* _tmp219_; |
| 27522 | _tmp219_ = st; |
| 27523 | if (_tmp219_ != NULL((void*)0)) { |
| 27524 | BalaStruct* _tmp220_; |
| 27525 | gchar* _tmp221_; |
| 27526 | gchar* _tmp222_; |
| 27527 | _tmp220_ = st; |
| 27528 | _tmp221_ = bala_get_ccode_name ((BalaCodeNode*) _tmp220_); |
| 27529 | _tmp222_ = _tmp221_; |
| 27530 | _tmp218_ = g_strcmp0 (_tmp222_, "va_list") == 0; |
| 27531 | _g_free0 (_tmp222_)(_tmp222_ = (g_free (_tmp222_), ((void*)0))); |
| 27532 | } else { |
| 27533 | _tmp218_ = FALSE(0); |
| 27534 | } |
| 27535 | if (_tmp218_) { |
| 27536 | BalaCCodeFunctionCall* _tmp223_; |
| 27537 | BalaCCodeExpression* _tmp224_; |
| 27538 | BalaMethod* _tmp225_; |
| 27539 | gchar* _tmp226_; |
| 27540 | gchar* _tmp227_; |
| 27541 | gboolean _tmp228_; |
| 27542 | _tmp223_ = creation_call; |
| 27543 | _tmp224_ = instance; |
| 27544 | bala_ccode_function_call_add_argument (_tmp223_, _tmp224_); |
| 27545 | _tmp225_ = m; |
| 27546 | _tmp226_ = bala_get_ccode_name ((BalaCodeNode*) _tmp225_); |
| 27547 | _tmp227_ = _tmp226_; |
| 27548 | _tmp228_ = g_strcmp0 (_tmp227_, "va_start") == 0; |
| 27549 | _g_free0 (_tmp227_)(_tmp227_ = (g_free (_tmp227_), ((void*)0))); |
| 27550 | if (_tmp228_) { |
| 27551 | gboolean _tmp229_; |
| 27552 | gboolean _tmp230_; |
| 27553 | _tmp229_ = bala_ccode_base_module_get_in_creation_method (self); |
| 27554 | _tmp230_ = _tmp229_; |
| 27555 | if (_tmp230_) { |
| 27556 | BalaCCodeIdentifier* _tmp231_; |
| 27557 | BalaCCodeIdentifier* _tmp232_; |
| 27558 | BalaCCodeFunctionCall* _tmp233_; |
| 27559 | BalaCCodeFunctionCall* _tmp234_; |
| 27560 | BalaCCodeExpression* _tmp235_; |
| 27561 | BalaCCodeFunctionCall* _tmp236_; |
| 27562 | BalaCCodeIdentifier* _tmp237_; |
| 27563 | BalaCCodeIdentifier* _tmp238_; |
| 27564 | _tmp231_ = bala_ccode_identifier_new ("va_copy"); |
| 27565 | _tmp232_ = _tmp231_; |
| 27566 | _tmp233_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp232_); |
| 27567 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 27568 | creation_call = _tmp233_; |
| 27569 | _bala_ccode_node_unref0 (_tmp232_)((_tmp232_ == ((void*)0)) ? ((void*)0) : (_tmp232_ = (bala_ccode_node_unref (_tmp232_), ((void*)0)))); |
| 27570 | _tmp234_ = creation_call; |
| 27571 | _tmp235_ = instance; |
| 27572 | bala_ccode_function_call_add_argument (_tmp234_, _tmp235_); |
| 27573 | _tmp236_ = creation_call; |
| 27574 | _tmp237_ = bala_ccode_identifier_new ("_bala_va_list"); |
| 27575 | _tmp238_ = _tmp237_; |
| 27576 | bala_ccode_function_call_add_argument (_tmp236_, (BalaCCodeExpression*) _tmp238_); |
| 27577 | _bala_ccode_node_unref0 (_tmp238_)((_tmp238_ == ((void*)0)) ? ((void*)0) : (_tmp238_ = (bala_ccode_node_unref (_tmp238_), ((void*)0)))); |
| 27578 | } else { |
| 27579 | BalaParameter* last_param = NULL((void*)0); |
| 27580 | gint nParams = 0; |
| 27581 | BalaCCodeFunction* _tmp259_; |
| 27582 | BalaCCodeFunction* _tmp260_; |
| 27583 | gboolean _tmp261_ = FALSE(0); |
| 27584 | last_param = NULL((void*)0); |
| 27585 | { |
| 27586 | BalaList* _param_list = NULL((void*)0); |
| 27587 | BalaMethod* _tmp239_; |
| 27588 | BalaMethod* _tmp240_; |
| 27589 | BalaList* _tmp241_; |
| 27590 | BalaList* _tmp242_; |
| 27591 | gint _param_size = 0; |
| 27592 | BalaList* _tmp243_; |
| 27593 | gint _tmp244_; |
| 27594 | gint _tmp245_; |
| 27595 | gint _param_index = 0; |
| 27596 | _tmp239_ = bala_ccode_base_module_get_current_method (self); |
| 27597 | _tmp240_ = _tmp239_; |
| 27598 | _tmp241_ = bala_callable_get_parameters ((BalaCallable*) _tmp240_); |
| 27599 | _tmp242_ = _bala_iterable_ref0 (_tmp241_); |
| 27600 | _param_list = _tmp242_; |
| 27601 | _tmp243_ = _param_list; |
| 27602 | _tmp244_ = bala_collection_get_size ((BalaCollection*) _tmp243_); |
| 27603 | _tmp245_ = _tmp244_; |
| 27604 | _param_size = _tmp245_; |
| 27605 | _param_index = -1; |
| 27606 | while (TRUE(!(0))) { |
| 27607 | gint _tmp246_; |
| 27608 | gint _tmp247_; |
| 27609 | BalaParameter* param = NULL((void*)0); |
| 27610 | BalaList* _tmp248_; |
| 27611 | gpointer _tmp249_; |
| 27612 | gboolean _tmp250_ = FALSE(0); |
| 27613 | BalaParameter* _tmp251_; |
| 27614 | gboolean _tmp252_; |
| 27615 | gboolean _tmp253_; |
| 27616 | BalaParameter* _tmp257_; |
| 27617 | BalaParameter* _tmp258_; |
| 27618 | _param_index = _param_index + 1; |
| 27619 | _tmp246_ = _param_index; |
| 27620 | _tmp247_ = _param_size; |
| 27621 | if (!(_tmp246_ < _tmp247_)) { |
| 27622 | break; |
| 27623 | } |
| 27624 | _tmp248_ = _param_list; |
| 27625 | _tmp249_ = bala_list_get (_tmp248_, _param_index); |
| 27626 | param = (BalaParameter*) _tmp249_; |
| 27627 | _tmp251_ = param; |
| 27628 | _tmp252_ = bala_parameter_get_ellipsis (_tmp251_); |
| 27629 | _tmp253_ = _tmp252_; |
| 27630 | if (_tmp253_) { |
| 27631 | _tmp250_ = TRUE(!(0)); |
| 27632 | } else { |
| 27633 | BalaParameter* _tmp254_; |
| 27634 | gboolean _tmp255_; |
| 27635 | gboolean _tmp256_; |
| 27636 | _tmp254_ = param; |
| 27637 | _tmp255_ = bala_parameter_get_params_array (_tmp254_); |
| 27638 | _tmp256_ = _tmp255_; |
| 27639 | _tmp250_ = _tmp256_; |
| 27640 | } |
| 27641 | if (_tmp250_) { |
| 27642 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 27643 | break; |
| 27644 | } |
| 27645 | _tmp257_ = param; |
| 27646 | _tmp258_ = _bala_code_node_ref0 (_tmp257_); |
| 27647 | _bala_code_node_unref0 (last_param)((last_param == ((void*)0)) ? ((void*)0) : (last_param = (bala_code_node_unref (last_param), ((void*)0)))); |
| 27648 | last_param = _tmp258_; |
| 27649 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 27650 | } |
| 27651 | _bala_iterable_unref0 (_param_list)((_param_list == ((void*)0)) ? ((void*)0) : (_param_list = (bala_iterable_unref (_param_list), ((void*)0)))); |
| 27652 | } |
| 27653 | _tmp259_ = bala_ccode_base_module_get_ccode (self); |
| 27654 | _tmp260_ = _tmp259_; |
| 27655 | nParams = bala_ccode_function_get_parameter_count (_tmp260_); |
| 27656 | if (nParams == 0) { |
| 27657 | _tmp261_ = TRUE(!(0)); |
| 27658 | } else { |
| 27659 | BalaCCodeFunction* _tmp262_; |
| 27660 | BalaCCodeFunction* _tmp263_; |
| 27661 | BalaCCodeParameter* _tmp264_; |
| 27662 | BalaCCodeParameter* _tmp265_; |
| 27663 | gboolean _tmp266_; |
| 27664 | gboolean _tmp267_; |
| 27665 | _tmp262_ = bala_ccode_base_module_get_ccode (self); |
| 27666 | _tmp263_ = _tmp262_; |
| 27667 | _tmp264_ = bala_ccode_function_get_parameter (_tmp263_, nParams - 1); |
| 27668 | _tmp265_ = _tmp264_; |
| 27669 | _tmp266_ = bala_ccode_parameter_get_ellipsis (_tmp265_); |
| 27670 | _tmp267_ = _tmp266_; |
| 27671 | _tmp261_ = !_tmp267_; |
| 27672 | _bala_ccode_node_unref0 (_tmp265_)((_tmp265_ == ((void*)0)) ? ((void*)0) : (_tmp265_ = (bala_ccode_node_unref (_tmp265_), ((void*)0)))); |
| 27673 | } |
| 27674 | if (_tmp261_) { |
| 27675 | BalaSourceReference* _tmp268_; |
| 27676 | BalaSourceReference* _tmp269_; |
| 27677 | _tmp268_ = bala_code_node_get_source_reference ((BalaCodeNode*) expr); |
| 27678 | _tmp269_ = _tmp268_; |
| 27679 | bala_report_error (_tmp269_, "`va_list' used in method with fixed args"); |
| 27680 | } else { |
| 27681 | if (nParams == 1) { |
| 27682 | BalaSourceReference* _tmp270_; |
| 27683 | BalaSourceReference* _tmp271_; |
| 27684 | _tmp270_ = bala_code_node_get_source_reference ((BalaCodeNode*) expr); |
| 27685 | _tmp271_ = _tmp270_; |
| 27686 | bala_report_error (_tmp271_, "`va_list' used in method without parameter"); |
| 27687 | } else { |
| 27688 | BalaCCodeFunctionCall* _tmp272_; |
| 27689 | BalaCCodeFunction* _tmp273_; |
| 27690 | BalaCCodeFunction* _tmp274_; |
| 27691 | BalaCCodeParameter* _tmp275_; |
| 27692 | BalaCCodeParameter* _tmp276_; |
| 27693 | const gchar* _tmp277_; |
| 27694 | const gchar* _tmp278_; |
| 27695 | BalaCCodeIdentifier* _tmp279_; |
| 27696 | BalaCCodeIdentifier* _tmp280_; |
| 27697 | _tmp272_ = creation_call; |
| 27698 | _tmp273_ = bala_ccode_base_module_get_ccode (self); |
| 27699 | _tmp274_ = _tmp273_; |
| 27700 | _tmp275_ = bala_ccode_function_get_parameter (_tmp274_, nParams - 2); |
| 27701 | _tmp276_ = _tmp275_; |
| 27702 | _tmp277_ = bala_ccode_parameter_get_name (_tmp276_); |
| 27703 | _tmp278_ = _tmp277_; |
| 27704 | _tmp279_ = bala_ccode_identifier_new (_tmp278_); |
| 27705 | _tmp280_ = _tmp279_; |
| 27706 | bala_ccode_function_call_add_argument (_tmp272_, (BalaCCodeExpression*) _tmp280_); |
| 27707 | _bala_ccode_node_unref0 (_tmp280_)((_tmp280_ == ((void*)0)) ? ((void*)0) : (_tmp280_ = (bala_ccode_node_unref (_tmp280_), ((void*)0)))); |
| 27708 | _bala_ccode_node_unref0 (_tmp276_)((_tmp276_ == ((void*)0)) ? ((void*)0) : (_tmp276_ = (bala_ccode_node_unref (_tmp276_), ((void*)0)))); |
| 27709 | } |
| 27710 | } |
| 27711 | _bala_code_node_unref0 (last_param)((last_param == ((void*)0)) ? ((void*)0) : (last_param = (bala_code_node_unref (last_param), ((void*)0)))); |
| 27712 | } |
| 27713 | } |
| 27714 | } |
| 27715 | } |
| 27716 | _tmp281_ = bala_object_creation_expression_get_type_reference (expr); |
| 27717 | _tmp282_ = _tmp281_; |
| 27718 | _tmp283_ = self->cfile; |
| 27719 | bala_ccode_base_module_generate_type_declaration (self, _tmp282_, _tmp283_); |
| 27720 | _tmp284_ = g_direct_hash; |
| 27721 | _tmp285_ = g_direct_equal; |
| 27722 | _tmp286_ = g_direct_equal; |
| 27723 | _tmp287_ = bala_hash_map_new (G_TYPE_INT((GType) ((6) << (2))), NULL((void*)0), NULL((void*)0), BALA_TYPE_CCODE_EXPRESSION(bala_ccode_expression_get_type ()), (GBoxedCopyFunc) bala_ccode_node_ref, (GDestroyNotify) bala_ccode_node_unref, _tmp284_, _tmp285_, _tmp286_); |
| 27724 | in_arg_map = _tmp287_; |
| 27725 | _tmp288_ = in_arg_map; |
| 27726 | _tmp289_ = _bala_map_ref0 (_tmp288_); |
| 27727 | out_arg_map = _tmp289_; |
| 27728 | _tmp291_ = m; |
| 27729 | if (_tmp291_ != NULL((void*)0)) { |
| 27730 | BalaMethod* _tmp292_; |
| 27731 | gboolean _tmp293_; |
| 27732 | gboolean _tmp294_; |
| 27733 | _tmp292_ = m; |
| 27734 | _tmp293_ = bala_method_get_coroutine (_tmp292_); |
| 27735 | _tmp294_ = _tmp293_; |
| 27736 | _tmp290_ = _tmp294_; |
| 27737 | } else { |
| 27738 | _tmp290_ = FALSE(0); |
| 27739 | } |
| 27740 | if (_tmp290_) { |
| 27741 | BalaMethod* _tmp295_; |
| 27742 | gchar* _tmp296_; |
| 27743 | gchar* _tmp297_; |
| 27744 | BalaCCodeIdentifier* _tmp298_; |
| 27745 | BalaCCodeIdentifier* _tmp299_; |
| 27746 | BalaCCodeFunctionCall* _tmp300_; |
| 27747 | BalaMethod* _tmp301_; |
| 27748 | gchar* _tmp302_; |
| 27749 | gchar* _tmp303_; |
| 27750 | BalaCCodeIdentifier* _tmp304_; |
| 27751 | BalaCCodeIdentifier* _tmp305_; |
| 27752 | BalaCCodeFunctionCall* _tmp306_; |
| 27753 | BalaCCodeFunctionCall* _tmp307_; |
| 27754 | BalaCCodeFunctionCall* _tmp308_; |
| 27755 | GHashFunc _tmp309_; |
| 27756 | GEqualFunc _tmp310_; |
| 27757 | GEqualFunc _tmp311_; |
| 27758 | BalaHashMap* _tmp312_; |
| 27759 | BalaHashMap* _tmp313_; |
| 27760 | BalaMethod* _tmp314_; |
| 27761 | BalaCCodeIdentifier* _tmp315_; |
| 27762 | BalaCCodeIdentifier* _tmp316_; |
| 27763 | BalaCCodeMemberAccess* _tmp317_; |
| 27764 | BalaCCodeMemberAccess* _tmp318_; |
| 27765 | _tmp295_ = m; |
| 27766 | _tmp296_ = bala_get_ccode_name ((BalaCodeNode*) _tmp295_); |
| 27767 | _tmp297_ = _tmp296_; |
| 27768 | _tmp298_ = bala_ccode_identifier_new (_tmp297_); |
| 27769 | _tmp299_ = _tmp298_; |
| 27770 | _tmp300_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp299_); |
| 27771 | _bala_ccode_node_unref0 (async_call)((async_call == ((void*)0)) ? ((void*)0) : (async_call = (bala_ccode_node_unref (async_call), ((void*)0)))); |
| 27772 | async_call = _tmp300_; |
| 27773 | _bala_ccode_node_unref0 (_tmp299_)((_tmp299_ == ((void*)0)) ? ((void*)0) : (_tmp299_ = (bala_ccode_node_unref (_tmp299_), ((void*)0)))); |
| 27774 | _g_free0 (_tmp297_)(_tmp297_ = (g_free (_tmp297_), ((void*)0))); |
| 27775 | _tmp301_ = m; |
| 27776 | _tmp302_ = bala_get_ccode_finish_name (_tmp301_); |
| 27777 | _tmp303_ = _tmp302_; |
| 27778 | _tmp304_ = bala_ccode_identifier_new (_tmp303_); |
| 27779 | _tmp305_ = _tmp304_; |
| 27780 | _tmp306_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp305_); |
| 27781 | _bala_ccode_node_unref0 (finish_call)((finish_call == ((void*)0)) ? ((void*)0) : (finish_call = (bala_ccode_node_unref (finish_call), ((void*)0)))); |
| 27782 | finish_call = _tmp306_; |
| 27783 | _bala_ccode_node_unref0 (_tmp305_)((_tmp305_ == ((void*)0)) ? ((void*)0) : (_tmp305_ = (bala_ccode_node_unref (_tmp305_), ((void*)0)))); |
| 27784 | _g_free0 (_tmp303_)(_tmp303_ = (g_free (_tmp303_), ((void*)0))); |
| 27785 | _tmp307_ = finish_call; |
| 27786 | _tmp308_ = _bala_ccode_node_ref0 (_tmp307_); |
| 27787 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 27788 | creation_call = _tmp308_; |
| 27789 | _tmp309_ = g_direct_hash; |
| 27790 | _tmp310_ = g_direct_equal; |
| 27791 | _tmp311_ = g_direct_equal; |
| 27792 | _tmp312_ = bala_hash_map_new (G_TYPE_INT((GType) ((6) << (2))), NULL((void*)0), NULL((void*)0), BALA_TYPE_CCODE_EXPRESSION(bala_ccode_expression_get_type ()), (GBoxedCopyFunc) bala_ccode_node_ref, (GDestroyNotify) bala_ccode_node_unref, _tmp309_, _tmp310_, _tmp311_); |
| 27793 | _bala_map_unref0 (out_arg_map)((out_arg_map == ((void*)0)) ? ((void*)0) : (out_arg_map = (bala_map_unref (out_arg_map), ((void*)0)))); |
| 27794 | out_arg_map = _tmp312_; |
| 27795 | _tmp313_ = out_arg_map; |
| 27796 | _tmp314_ = m; |
| 27797 | _tmp315_ = bala_ccode_identifier_new ("_data_"); |
| 27798 | _tmp316_ = _tmp315_; |
| 27799 | _tmp317_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp316_, "_res_"); |
| 27800 | _tmp318_ = _tmp317_; |
| 27801 | bala_map_set ((BalaMap*) _tmp313_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, bala_get_ccode_async_result_pos (_tmp314_), FALSE(0))), (BalaCCodeExpression*) _tmp318_); |
| 27802 | _bala_ccode_node_unref0 (_tmp318_)((_tmp318_ == ((void*)0)) ? ((void*)0) : (_tmp318_ = (bala_ccode_node_unref (_tmp318_), ((void*)0)))); |
| 27803 | _bala_ccode_node_unref0 (_tmp316_)((_tmp316_ == ((void*)0)) ? ((void*)0) : (_tmp316_ = (bala_ccode_node_unref (_tmp316_), ((void*)0)))); |
| 27804 | } |
| 27805 | _tmp320_ = cl; |
| 27806 | if (_tmp320_ != NULL((void*)0)) { |
| 27807 | BalaClass* _tmp321_; |
| 27808 | gboolean _tmp322_; |
| 27809 | gboolean _tmp323_; |
| 27810 | _tmp321_ = cl; |
| 27811 | _tmp322_ = bala_class_get_is_compact (_tmp321_); |
| 27812 | _tmp323_ = _tmp322_; |
| 27813 | _tmp319_ = !_tmp323_; |
| 27814 | } else { |
| 27815 | _tmp319_ = FALSE(0); |
| 27816 | } |
| 27817 | if (_tmp319_) { |
| 27818 | BalaHashMap* _tmp324_; |
| 27819 | BalaDataType* _tmp325_; |
| 27820 | BalaDataType* _tmp326_; |
| 27821 | BalaList* _tmp327_; |
| 27822 | _tmp324_ = in_arg_map; |
| 27823 | _tmp325_ = bala_object_creation_expression_get_type_reference (expr); |
| 27824 | _tmp326_ = _tmp325_; |
| 27825 | _tmp327_ = bala_data_type_get_type_arguments (_tmp326_); |
| 27826 | bala_ccode_base_module_add_generic_type_arguments (self, (BalaMap*) _tmp324_, _tmp327_, (BalaCodeNode*) expr, FALSE(0), NULL((void*)0)); |
| 27827 | } else { |
| 27828 | gboolean _tmp328_ = FALSE(0); |
| 27829 | BalaClass* _tmp329_; |
| 27830 | _tmp329_ = cl; |
| 27831 | if (_tmp329_ != NULL((void*)0)) { |
| 27832 | BalaMethod* _tmp330_; |
| 27833 | _tmp330_ = m; |
| 27834 | _tmp328_ = bala_get_ccode_simple_generics (_tmp330_); |
| 27835 | } else { |
| 27836 | _tmp328_ = FALSE(0); |
| 27837 | } |
| 27838 | if (_tmp328_) { |
| 27839 | gint type_param_index = 0; |
| 27840 | type_param_index = 0; |
| 27841 | { |
| 27842 | BalaList* _type_arg_list = NULL((void*)0); |
| 27843 | BalaDataType* _tmp331_; |
| 27844 | BalaDataType* _tmp332_; |
| 27845 | BalaList* _tmp333_; |
| 27846 | BalaList* _tmp334_; |
| 27847 | gint _type_arg_size = 0; |
| 27848 | BalaList* _tmp335_; |
| 27849 | gint _tmp336_; |
| 27850 | gint _tmp337_; |
| 27851 | gint _type_arg_index = 0; |
| 27852 | _tmp331_ = bala_object_creation_expression_get_type_reference (expr); |
| 27853 | _tmp332_ = _tmp331_; |
| 27854 | _tmp333_ = bala_data_type_get_type_arguments (_tmp332_); |
| 27855 | _tmp334_ = _bala_iterable_ref0 (_tmp333_); |
| 27856 | _type_arg_list = _tmp334_; |
| 27857 | _tmp335_ = _type_arg_list; |
| 27858 | _tmp336_ = bala_collection_get_size ((BalaCollection*) _tmp335_); |
| 27859 | _tmp337_ = _tmp336_; |
| 27860 | _type_arg_size = _tmp337_; |
| 27861 | _type_arg_index = -1; |
| 27862 | while (TRUE(!(0))) { |
| 27863 | gint _tmp338_; |
| 27864 | gint _tmp339_; |
| 27865 | BalaDataType* type_arg = NULL((void*)0); |
| 27866 | BalaList* _tmp340_; |
| 27867 | gpointer _tmp341_; |
| 27868 | BalaDataType* _tmp342_; |
| 27869 | gint _tmp350_; |
| 27870 | _type_arg_index = _type_arg_index + 1; |
| 27871 | _tmp338_ = _type_arg_index; |
| 27872 | _tmp339_ = _type_arg_size; |
| 27873 | if (!(_tmp338_ < _tmp339_)) { |
| 27874 | break; |
| 27875 | } |
| 27876 | _tmp340_ = _type_arg_list; |
| 27877 | _tmp341_ = bala_list_get (_tmp340_, _type_arg_index); |
| 27878 | type_arg = (BalaDataType*) _tmp341_; |
| 27879 | _tmp342_ = type_arg; |
| 27880 | if (bala_ccode_base_module_requires_copy (_tmp342_)) { |
| 27881 | BalaHashMap* _tmp343_; |
| 27882 | BalaDataType* _tmp344_; |
| 27883 | BalaCCodeExpression* _tmp345_; |
| 27884 | BalaCCodeExpression* _tmp346_; |
| 27885 | _tmp343_ = in_arg_map; |
| 27886 | _tmp344_ = type_arg; |
| 27887 | _tmp345_ = bala_ccode_base_module_get_destroy0_func_expression (self, _tmp344_, FALSE(0)); |
| 27888 | _tmp346_ = _tmp345_; |
| 27889 | bala_map_set ((BalaMap*) _tmp343_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (-1 + (0.1 * type_param_index)) + 0.03, FALSE(0))), _tmp346_); |
| 27890 | _bala_ccode_node_unref0 (_tmp346_)((_tmp346_ == ((void*)0)) ? ((void*)0) : (_tmp346_ = (bala_ccode_node_unref (_tmp346_), ((void*)0)))); |
| 27891 | } else { |
| 27892 | BalaHashMap* _tmp347_; |
| 27893 | BalaCCodeConstant* _tmp348_; |
| 27894 | BalaCCodeConstant* _tmp349_; |
| 27895 | _tmp347_ = in_arg_map; |
| 27896 | _tmp348_ = bala_ccode_constant_new ("NULL"); |
| 27897 | _tmp349_ = _tmp348_; |
| 27898 | bala_map_set ((BalaMap*) _tmp347_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (-1 + (0.1 * type_param_index)) + 0.03, FALSE(0))), (BalaCCodeExpression*) _tmp349_); |
| 27899 | _bala_ccode_node_unref0 (_tmp349_)((_tmp349_ == ((void*)0)) ? ((void*)0) : (_tmp349_ = (bala_ccode_node_unref (_tmp349_), ((void*)0)))); |
| 27900 | } |
| 27901 | _tmp350_ = type_param_index; |
| 27902 | type_param_index = _tmp350_ + 1; |
| 27903 | _bala_code_node_unref0 (type_arg)((type_arg == ((void*)0)) ? ((void*)0) : (type_arg = (bala_code_node_unref (type_arg), ((void*)0)))); |
| 27904 | } |
| 27905 | _bala_iterable_unref0 (_type_arg_list)((_type_arg_list == ((void*)0)) ? ((void*)0) : (_type_arg_list = (bala_iterable_unref (_type_arg_list), ((void*)0)))); |
| 27906 | } |
| 27907 | } |
| 27908 | } |
| 27909 | ellipsis = FALSE(0); |
| 27910 | i = 1; |
| 27911 | _tmp351_ = params; |
| 27912 | _tmp352_ = bala_iterable_iterator ((BalaIterable*) _tmp351_); |
| 27913 | params_it = _tmp352_; |
| 27914 | { |
| 27915 | BalaList* _arg_list = NULL((void*)0); |
| 27916 | BalaList* _tmp353_; |
| 27917 | BalaList* _tmp354_; |
| 27918 | gint _arg_size = 0; |
| 27919 | BalaList* _tmp355_; |
| 27920 | gint _tmp356_; |
| 27921 | gint _tmp357_; |
| 27922 | gint _arg_index = 0; |
| 27923 | _tmp353_ = bala_object_creation_expression_get_argument_list (expr); |
| 27924 | _tmp354_ = _bala_iterable_ref0 (_tmp353_); |
| 27925 | _arg_list = _tmp354_; |
| 27926 | _tmp355_ = _arg_list; |
| 27927 | _tmp356_ = bala_collection_get_size ((BalaCollection*) _tmp355_); |
| 27928 | _tmp357_ = _tmp356_; |
| 27929 | _arg_size = _tmp357_; |
| 27930 | _arg_index = -1; |
| 27931 | while (TRUE(!(0))) { |
| 27932 | gint _tmp358_; |
| 27933 | gint _tmp359_; |
| 27934 | BalaExpression* arg = NULL((void*)0); |
| 27935 | BalaList* _tmp360_; |
| 27936 | gpointer _tmp361_; |
| 27937 | BalaCCodeExpression* cexpr = NULL((void*)0); |
| 27938 | BalaExpression* _tmp362_; |
| 27939 | BalaCCodeExpression* _tmp363_; |
| 27940 | BalaCCodeExpression* _tmp364_; |
| 27941 | BalaHashMap* carg_map = NULL((void*)0); |
| 27942 | BalaHashMap* _tmp365_; |
| 27943 | BalaHashMap* _tmp366_; |
| 27944 | BalaParameter* param = NULL((void*)0); |
| 27945 | BalaIterator* _tmp367_; |
| 27946 | BalaHashMap* _tmp447_; |
| 27947 | BalaCCodeExpression* _tmp448_; |
| 27948 | gint _tmp449_; |
| 27949 | _arg_index = _arg_index + 1; |
| 27950 | _tmp358_ = _arg_index; |
| 27951 | _tmp359_ = _arg_size; |
| 27952 | if (!(_tmp358_ < _tmp359_)) { |
| 27953 | break; |
| 27954 | } |
| 27955 | _tmp360_ = _arg_list; |
| 27956 | _tmp361_ = bala_list_get (_tmp360_, _arg_index); |
| 27957 | arg = (BalaExpression*) _tmp361_; |
| 27958 | _tmp362_ = arg; |
| 27959 | _tmp363_ = bala_get_cvalue (_tmp362_); |
| 27960 | _tmp364_ = _bala_ccode_node_ref0 (_tmp363_); |
| 27961 | cexpr = _tmp364_; |
| 27962 | _tmp365_ = in_arg_map; |
| 27963 | _tmp366_ = _bala_map_ref0 (_tmp365_); |
| 27964 | carg_map = _tmp366_; |
| 27965 | param = NULL((void*)0); |
| 27966 | _tmp367_ = params_it; |
| 27967 | if (bala_iterator_next (_tmp367_)) { |
| 27968 | BalaIterator* _tmp368_; |
| 27969 | gpointer _tmp369_; |
| 27970 | gboolean _tmp370_ = FALSE(0); |
| 27971 | BalaParameter* _tmp371_; |
| 27972 | gboolean _tmp372_; |
| 27973 | gboolean _tmp373_; |
| 27974 | BalaParameter* _tmp443_; |
| 27975 | _tmp368_ = params_it; |
| 27976 | _tmp369_ = bala_iterator_get (_tmp368_); |
| 27977 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 27978 | param = (BalaParameter*) _tmp369_; |
| 27979 | _tmp371_ = param; |
| 27980 | _tmp372_ = bala_parameter_get_ellipsis (_tmp371_); |
| 27981 | _tmp373_ = _tmp372_; |
| 27982 | if (_tmp373_) { |
| 27983 | _tmp370_ = TRUE(!(0)); |
| 27984 | } else { |
| 27985 | BalaParameter* _tmp374_; |
| 27986 | gboolean _tmp375_; |
| 27987 | gboolean _tmp376_; |
| 27988 | _tmp374_ = param; |
| 27989 | _tmp375_ = bala_parameter_get_params_array (_tmp374_); |
| 27990 | _tmp376_ = _tmp375_; |
| 27991 | _tmp370_ = _tmp376_; |
| 27992 | } |
| 27993 | ellipsis = _tmp370_; |
| 27994 | if (!ellipsis) { |
| 27995 | BalaParameter* _tmp377_; |
| 27996 | BalaParameterDirection _tmp378_; |
| 27997 | BalaParameterDirection _tmp379_; |
| 27998 | gboolean _tmp382_ = FALSE(0); |
| 27999 | BalaParameter* _tmp383_; |
| 28000 | BalaParameter* _tmp427_; |
| 28001 | BalaExpression* _tmp428_; |
| 28002 | BalaCCodeExpression* _tmp429_; |
| 28003 | BalaCCodeExpression* _tmp430_; |
| 28004 | BalaParameter* _tmp431_; |
| 28005 | gchar* _tmp432_; |
| 28006 | gchar* _tmp433_; |
| 28007 | gboolean _tmp434_; |
| 28008 | _tmp377_ = param; |
| 28009 | _tmp378_ = bala_parameter_get_direction (_tmp377_); |
| 28010 | _tmp379_ = _tmp378_; |
| 28011 | if (_tmp379_ == BALA_PARAMETER_DIRECTION_OUT) { |
| 28012 | BalaHashMap* _tmp380_; |
| 28013 | BalaHashMap* _tmp381_; |
| 28014 | _tmp380_ = out_arg_map; |
| 28015 | _tmp381_ = _bala_map_ref0 (_tmp380_); |
| 28016 | _bala_map_unref0 (carg_map)((carg_map == ((void*)0)) ? ((void*)0) : (carg_map = (bala_map_unref (carg_map), ((void*)0)))); |
| 28017 | carg_map = _tmp381_; |
| 28018 | } |
| 28019 | _tmp383_ = param; |
| 28020 | if (bala_get_ccode_array_length ((BalaCodeNode*) _tmp383_)) { |
| 28021 | BalaParameter* _tmp384_; |
| 28022 | BalaDataType* _tmp385_; |
| 28023 | BalaDataType* _tmp386_; |
| 28024 | _tmp384_ = param; |
| 28025 | _tmp385_ = bala_variable_get_variable_type ((BalaVariable*) _tmp384_); |
| 28026 | _tmp386_ = _tmp385_; |
| 28027 | _tmp382_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp386_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp386_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 28028 | } else { |
| 28029 | _tmp382_ = FALSE(0); |
| 28030 | } |
| 28031 | if (_tmp382_) { |
| 28032 | BalaArrayType* array_type = NULL((void*)0); |
| 28033 | BalaParameter* _tmp387_; |
| 28034 | BalaDataType* _tmp388_; |
| 28035 | BalaDataType* _tmp389_; |
| 28036 | BalaArrayType* _tmp390_; |
| 28037 | _tmp387_ = param; |
| 28038 | _tmp388_ = bala_variable_get_variable_type ((BalaVariable*) _tmp387_); |
| 28039 | _tmp389_ = _tmp388_; |
| 28040 | _tmp390_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp389_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp389_), ((bala_array_type_get_type ())))))); |
| 28041 | array_type = _tmp390_; |
| 28042 | { |
| 28043 | gint dim = 0; |
| 28044 | dim = 1; |
| 28045 | { |
| 28046 | gboolean _tmp391_ = FALSE(0); |
| 28047 | _tmp391_ = TRUE(!(0)); |
| 28048 | while (TRUE(!(0))) { |
| 28049 | BalaArrayType* _tmp393_; |
| 28050 | gint _tmp394_; |
| 28051 | gint _tmp395_; |
| 28052 | BalaHashMap* _tmp396_; |
| 28053 | BalaParameter* _tmp397_; |
| 28054 | BalaExpression* _tmp398_; |
| 28055 | BalaCCodeExpression* _tmp399_; |
| 28056 | BalaCCodeExpression* _tmp400_; |
| 28057 | if (!_tmp391_) { |
| 28058 | gint _tmp392_; |
| 28059 | _tmp392_ = dim; |
| 28060 | dim = _tmp392_ + 1; |
| 28061 | } |
| 28062 | _tmp391_ = FALSE(0); |
| 28063 | _tmp393_ = array_type; |
| 28064 | _tmp394_ = bala_array_type_get_rank (_tmp393_); |
| 28065 | _tmp395_ = _tmp394_; |
| 28066 | if (!(dim <= _tmp395_)) { |
| 28067 | break; |
| 28068 | } |
| 28069 | _tmp396_ = carg_map; |
| 28070 | _tmp397_ = param; |
| 28071 | _tmp398_ = arg; |
| 28072 | _tmp399_ = bala_ccode_base_module_get_array_length_cexpression (self, _tmp398_, dim); |
| 28073 | _tmp400_ = _tmp399_; |
| 28074 | bala_map_set ((BalaMap*) _tmp396_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, bala_get_ccode_array_length_pos ((BalaCodeNode*) _tmp397_) + (0.01 * dim), FALSE(0))), _tmp400_); |
| 28075 | _bala_ccode_node_unref0 (_tmp400_)((_tmp400_ == ((void*)0)) ? ((void*)0) : (_tmp400_ = (bala_ccode_node_unref (_tmp400_), ((void*)0)))); |
| 28076 | } |
| 28077 | } |
| 28078 | } |
| 28079 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 28080 | } else { |
| 28081 | gboolean _tmp401_ = FALSE(0); |
| 28082 | BalaParameter* _tmp402_; |
| 28083 | _tmp402_ = param; |
| 28084 | if (bala_get_ccode_delegate_target ((BalaCodeNode*) _tmp402_)) { |
| 28085 | BalaParameter* _tmp403_; |
| 28086 | BalaDataType* _tmp404_; |
| 28087 | BalaDataType* _tmp405_; |
| 28088 | _tmp403_ = param; |
| 28089 | _tmp404_ = bala_variable_get_variable_type ((BalaVariable*) _tmp403_); |
| 28090 | _tmp405_ = _tmp404_; |
| 28091 | _tmp401_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp405_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp405_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 28092 | } else { |
| 28093 | _tmp401_ = FALSE(0); |
| 28094 | } |
| 28095 | if (_tmp401_) { |
| 28096 | BalaDelegateType* deleg_type = NULL((void*)0); |
| 28097 | BalaParameter* _tmp406_; |
| 28098 | BalaDataType* _tmp407_; |
| 28099 | BalaDataType* _tmp408_; |
| 28100 | BalaDelegateType* _tmp409_; |
| 28101 | BalaDelegate* d = NULL((void*)0); |
| 28102 | BalaDelegateType* _tmp410_; |
| 28103 | BalaDelegate* _tmp411_; |
| 28104 | BalaDelegate* _tmp412_; |
| 28105 | BalaDelegate* _tmp413_; |
| 28106 | BalaDelegate* _tmp414_; |
| 28107 | gboolean _tmp415_; |
| 28108 | gboolean _tmp416_; |
| 28109 | _tmp406_ = param; |
| 28110 | _tmp407_ = bala_variable_get_variable_type ((BalaVariable*) _tmp406_); |
| 28111 | _tmp408_ = _tmp407_; |
| 28112 | _tmp409_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp408_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp408_), ((bala_delegate_type_get_type ())))))); |
| 28113 | deleg_type = _tmp409_; |
| 28114 | _tmp410_ = deleg_type; |
| 28115 | _tmp411_ = bala_delegate_type_get_delegate_symbol (_tmp410_); |
| 28116 | _tmp412_ = _tmp411_; |
| 28117 | _tmp413_ = _bala_code_node_ref0 (_tmp412_); |
| 28118 | d = _tmp413_; |
| 28119 | _tmp414_ = d; |
| 28120 | _tmp415_ = bala_delegate_get_has_target (_tmp414_); |
| 28121 | _tmp416_ = _tmp415_; |
| 28122 | if (_tmp416_) { |
| 28123 | BalaCCodeExpression* delegate_target_destroy_notify = NULL((void*)0); |
| 28124 | BalaCCodeExpression* delegate_target = NULL((void*)0); |
| 28125 | BalaExpression* _tmp417_; |
| 28126 | BalaCCodeExpression* _tmp418_ = NULL((void*)0); |
| 28127 | BalaCCodeExpression* _tmp419_; |
| 28128 | BalaHashMap* _tmp420_; |
| 28129 | BalaParameter* _tmp421_; |
| 28130 | BalaCCodeExpression* _tmp422_; |
| 28131 | BalaDelegateType* _tmp423_; |
| 28132 | _tmp417_ = arg; |
| 28133 | _tmp419_ = bala_ccode_base_module_get_delegate_target_cexpression (self, _tmp417_, &_tmp418_); |
| 28134 | _bala_ccode_node_unref0 (delegate_target_destroy_notify)((delegate_target_destroy_notify == ((void*)0)) ? ((void*)0) : (delegate_target_destroy_notify = (bala_ccode_node_unref (delegate_target_destroy_notify ), ((void*)0)))); |
| 28135 | delegate_target_destroy_notify = _tmp418_; |
| 28136 | delegate_target = _tmp419_; |
| 28137 | _tmp420_ = carg_map; |
| 28138 | _tmp421_ = param; |
| 28139 | _tmp422_ = delegate_target; |
| 28140 | bala_map_set ((BalaMap*) _tmp420_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, bala_get_ccode_delegate_target_pos ((BalaCodeNode*) _tmp421_), FALSE(0))), _tmp422_); |
| 28141 | _tmp423_ = deleg_type; |
| 28142 | if (bala_data_type_is_disposable ((BalaDataType*) _tmp423_)) { |
| 28143 | BalaHashMap* _tmp424_; |
| 28144 | BalaParameter* _tmp425_; |
| 28145 | BalaCCodeExpression* _tmp426_; |
| 28146 | _tmp424_ = carg_map; |
| 28147 | _tmp425_ = param; |
| 28148 | _tmp426_ = delegate_target_destroy_notify; |
| 28149 | bala_map_set ((BalaMap*) _tmp424_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, bala_get_ccode_destroy_notify_pos ((BalaCodeNode*) _tmp425_), FALSE(0))), _tmp426_); |
| 28150 | } |
| 28151 | _bala_ccode_node_unref0 (delegate_target)((delegate_target == ((void*)0)) ? ((void*)0) : (delegate_target = (bala_ccode_node_unref (delegate_target), ((void*)0)))); |
| 28152 | _bala_ccode_node_unref0 (delegate_target_destroy_notify)((delegate_target_destroy_notify == ((void*)0)) ? ((void*)0) : (delegate_target_destroy_notify = (bala_ccode_node_unref (delegate_target_destroy_notify ), ((void*)0)))); |
| 28153 | } |
| 28154 | _bala_code_node_unref0 (d)((d == ((void*)0)) ? ((void*)0) : (d = (bala_code_node_unref ( d), ((void*)0)))); |
| 28155 | _bala_code_node_unref0 (deleg_type)((deleg_type == ((void*)0)) ? ((void*)0) : (deleg_type = (bala_code_node_unref (deleg_type), ((void*)0)))); |
| 28156 | } |
| 28157 | } |
| 28158 | _tmp427_ = param; |
| 28159 | _tmp428_ = arg; |
| 28160 | _tmp429_ = cexpr; |
| 28161 | _tmp430_ = bala_ccode_base_module_handle_struct_argument (self, _tmp427_, _tmp428_, _tmp429_); |
| 28162 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 28163 | cexpr = _tmp430_; |
| 28164 | _tmp431_ = param; |
| 28165 | _tmp432_ = bala_get_ccode_type ((BalaCodeNode*) _tmp431_); |
| 28166 | _tmp433_ = _tmp432_; |
| 28167 | _tmp434_ = _tmp433_ != NULL((void*)0); |
| 28168 | _g_free0 (_tmp433_)(_tmp433_ = (g_free (_tmp433_), ((void*)0))); |
| 28169 | if (_tmp434_) { |
| 28170 | BalaCCodeExpression* _tmp435_; |
| 28171 | BalaParameter* _tmp436_; |
| 28172 | gchar* _tmp437_; |
| 28173 | gchar* _tmp438_; |
| 28174 | BalaCCodeCastExpression* _tmp439_; |
| 28175 | _tmp435_ = cexpr; |
| 28176 | _tmp436_ = param; |
| 28177 | _tmp437_ = bala_get_ccode_type ((BalaCodeNode*) _tmp436_); |
| 28178 | _tmp438_ = _tmp437_; |
| 28179 | _tmp439_ = bala_ccode_cast_expression_new (_tmp435_, _tmp438_); |
| 28180 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 28181 | cexpr = (BalaCCodeExpression*) _tmp439_; |
| 28182 | _g_free0 (_tmp438_)(_tmp438_ = (g_free (_tmp438_), ((void*)0))); |
| 28183 | } |
| 28184 | } else { |
| 28185 | BalaExpression* _tmp440_; |
| 28186 | BalaCCodeExpression* _tmp441_; |
| 28187 | BalaCCodeExpression* _tmp442_; |
| 28188 | _tmp440_ = arg; |
| 28189 | _tmp441_ = cexpr; |
| 28190 | _tmp442_ = bala_ccode_base_module_handle_struct_argument (self, NULL((void*)0), _tmp440_, _tmp441_); |
| 28191 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 28192 | cexpr = _tmp442_; |
| 28193 | } |
| 28194 | _tmp443_ = param; |
| 28195 | arg_pos = bala_ccode_base_module_get_param_pos (self, bala_get_ccode_pos (_tmp443_), ellipsis); |
| 28196 | } else { |
| 28197 | BalaExpression* _tmp444_; |
| 28198 | BalaCCodeExpression* _tmp445_; |
| 28199 | BalaCCodeExpression* _tmp446_; |
| 28200 | _tmp444_ = arg; |
| 28201 | _tmp445_ = cexpr; |
| 28202 | _tmp446_ = bala_ccode_base_module_handle_struct_argument (self, NULL((void*)0), _tmp444_, _tmp445_); |
| 28203 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 28204 | cexpr = _tmp446_; |
| 28205 | arg_pos = bala_ccode_base_module_get_param_pos (self, (gdouble) i, ellipsis); |
| 28206 | } |
| 28207 | _tmp447_ = carg_map; |
| 28208 | _tmp448_ = cexpr; |
| 28209 | bala_map_set ((BalaMap*) _tmp447_, (gpointer) ((gintptr) arg_pos), _tmp448_); |
| 28210 | _tmp449_ = i; |
| 28211 | i = _tmp449_ + 1; |
| 28212 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 28213 | _bala_map_unref0 (carg_map)((carg_map == ((void*)0)) ? ((void*)0) : (carg_map = (bala_map_unref (carg_map), ((void*)0)))); |
| 28214 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 28215 | _bala_code_node_unref0 (arg)((arg == ((void*)0)) ? ((void*)0) : (arg = (bala_code_node_unref (arg), ((void*)0)))); |
| 28216 | } |
| 28217 | _bala_iterable_unref0 (_arg_list)((_arg_list == ((void*)0)) ? ((void*)0) : (_arg_list = (bala_iterable_unref (_arg_list), ((void*)0)))); |
| 28218 | } |
| 28219 | _tmp450_ = params_it; |
| 28220 | if (bala_iterator_next (_tmp450_)) { |
| 28221 | BalaParameter* param = NULL((void*)0); |
| 28222 | BalaIterator* _tmp451_; |
| 28223 | gpointer _tmp452_; |
| 28224 | gboolean _tmp453_ = FALSE(0); |
| 28225 | BalaParameter* _tmp454_; |
| 28226 | gboolean _tmp455_; |
| 28227 | gboolean _tmp456_; |
| 28228 | _tmp451_ = params_it; |
| 28229 | _tmp452_ = bala_iterator_get (_tmp451_); |
| 28230 | param = (BalaParameter*) _tmp452_; |
| 28231 | _tmp454_ = param; |
| 28232 | _tmp455_ = bala_parameter_get_params_array (_tmp454_); |
| 28233 | _tmp456_ = _tmp455_; |
| 28234 | if (_tmp456_) { |
| 28235 | _tmp453_ = TRUE(!(0)); |
| 28236 | } else { |
| 28237 | BalaParameter* _tmp457_; |
| 28238 | gboolean _tmp458_; |
| 28239 | gboolean _tmp459_; |
| 28240 | _tmp457_ = param; |
| 28241 | _tmp458_ = bala_parameter_get_ellipsis (_tmp457_); |
| 28242 | _tmp459_ = _tmp458_; |
| 28243 | _tmp453_ = _tmp459_; |
| 28244 | } |
| 28245 | _bala_assert (_tmp453_, "param.params_array || param.ellipsis")if (_tmp453_) ; else g_assertion_message_expr ("bala-ccodegen" , "balaccodebasemodule.c", 28245, ((const char*) (__func__)), "param.params_array || param.ellipsis");; |
| 28246 | ellipsis = TRUE(!(0)); |
| 28247 | _bala_code_node_unref0 (param)((param == ((void*)0)) ? ((void*)0) : (param = (bala_code_node_unref (param), ((void*)0)))); |
| 28248 | } |
| 28249 | _tmp460_ = bala_code_node_get_tree_can_fail ((BalaCodeNode*) expr); |
| 28250 | _tmp461_ = _tmp460_; |
| 28251 | if (_tmp461_) { |
| 28252 | BalaHashMap* _tmp462_; |
| 28253 | BalaCCodeExpression* _tmp463_; |
| 28254 | BalaCCodeExpression* _tmp464_; |
| 28255 | BalaCCodeUnaryExpression* _tmp465_; |
| 28256 | BalaCCodeUnaryExpression* _tmp466_; |
| 28257 | bala_ccode_base_module_set_current_method_inner_error (self, TRUE(!(0))); |
| 28258 | _tmp462_ = out_arg_map; |
| 28259 | _tmp463_ = bala_ccode_base_module_get_inner_error_cexpression (self); |
| 28260 | _tmp464_ = _tmp463_; |
| 28261 | _tmp465_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp464_); |
| 28262 | _tmp466_ = _tmp465_; |
| 28263 | bala_map_set ((BalaMap*) _tmp462_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (gdouble) -1, FALSE(0))), (BalaCCodeExpression*) _tmp466_); |
| 28264 | _bala_ccode_node_unref0 (_tmp466_)((_tmp466_ == ((void*)0)) ? ((void*)0) : (_tmp466_ = (bala_ccode_node_unref (_tmp466_), ((void*)0)))); |
| 28265 | _bala_ccode_node_unref0 (_tmp464_)((_tmp464_ == ((void*)0)) ? ((void*)0) : (_tmp464_ = (bala_ccode_node_unref (_tmp464_), ((void*)0)))); |
| 28266 | } |
| 28267 | if (ellipsis) { |
| 28268 | BalaMethod* _tmp467_; |
| 28269 | _tmp467_ = m; |
| 28270 | if (_tmp467_ == NULL((void*)0)) { |
| 28271 | BalaHashMap* _tmp468_; |
| 28272 | BalaCCodeConstant* _tmp469_; |
| 28273 | BalaCCodeConstant* _tmp470_; |
| 28274 | _tmp468_ = in_arg_map; |
| 28275 | _tmp469_ = bala_ccode_constant_new ("NULL"); |
| 28276 | _tmp470_ = _tmp469_; |
| 28277 | bala_map_set ((BalaMap*) _tmp468_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (gdouble) -1, TRUE(!(0)))), (BalaCCodeExpression*) _tmp470_); |
| 28278 | _bala_ccode_node_unref0 (_tmp470_)((_tmp470_ == ((void*)0)) ? ((void*)0) : (_tmp470_ = (bala_ccode_node_unref (_tmp470_), ((void*)0)))); |
| 28279 | } else { |
| 28280 | gboolean _tmp471_ = FALSE(0); |
| 28281 | gboolean _tmp472_ = FALSE(0); |
| 28282 | BalaMethod* _tmp473_; |
| 28283 | gboolean _tmp474_; |
| 28284 | gboolean _tmp475_; |
| 28285 | _tmp473_ = m; |
| 28286 | _tmp474_ = bala_method_get_printf_format (_tmp473_); |
| 28287 | _tmp475_ = _tmp474_; |
| 28288 | if (!_tmp475_) { |
| 28289 | BalaMethod* _tmp476_; |
| 28290 | gboolean _tmp477_; |
| 28291 | gboolean _tmp478_; |
| 28292 | _tmp476_ = m; |
| 28293 | _tmp477_ = bala_method_get_scanf_format (_tmp476_); |
| 28294 | _tmp478_ = _tmp477_; |
| 28295 | _tmp472_ = !_tmp478_; |
| 28296 | } else { |
| 28297 | _tmp472_ = FALSE(0); |
| 28298 | } |
| 28299 | if (_tmp472_) { |
| 28300 | BalaMethod* _tmp479_; |
| 28301 | gchar* _tmp480_; |
| 28302 | gchar* _tmp481_; |
| 28303 | _tmp479_ = m; |
| 28304 | _tmp480_ = bala_get_ccode_sentinel (_tmp479_); |
| 28305 | _tmp481_ = _tmp480_; |
| 28306 | _tmp471_ = g_strcmp0 (_tmp481_, "") != 0; |
| 28307 | _g_free0 (_tmp481_)(_tmp481_ = (g_free (_tmp481_), ((void*)0))); |
| 28308 | } else { |
| 28309 | _tmp471_ = FALSE(0); |
| 28310 | } |
| 28311 | if (_tmp471_) { |
| 28312 | BalaHashMap* _tmp482_; |
| 28313 | BalaMethod* _tmp483_; |
| 28314 | gchar* _tmp484_; |
| 28315 | gchar* _tmp485_; |
| 28316 | BalaCCodeConstant* _tmp486_; |
| 28317 | BalaCCodeConstant* _tmp487_; |
| 28318 | _tmp482_ = in_arg_map; |
| 28319 | _tmp483_ = m; |
| 28320 | _tmp484_ = bala_get_ccode_sentinel (_tmp483_); |
| 28321 | _tmp485_ = _tmp484_; |
| 28322 | _tmp486_ = bala_ccode_constant_new (_tmp485_); |
| 28323 | _tmp487_ = _tmp486_; |
| 28324 | bala_map_set ((BalaMap*) _tmp482_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (gdouble) -1, TRUE(!(0)))), (BalaCCodeExpression*) _tmp487_); |
| 28325 | _bala_ccode_node_unref0 (_tmp487_)((_tmp487_ == ((void*)0)) ? ((void*)0) : (_tmp487_ = (bala_ccode_node_unref (_tmp487_), ((void*)0)))); |
| 28326 | _g_free0 (_tmp485_)(_tmp485_ = (g_free (_tmp485_), ((void*)0))); |
| 28327 | } |
| 28328 | } |
| 28329 | } |
| 28330 | _tmp490_ = st; |
| 28331 | if (_tmp490_ != NULL((void*)0)) { |
| 28332 | BalaStruct* _tmp491_; |
| 28333 | _tmp491_ = st; |
| 28334 | _tmp489_ = !bala_struct_is_simple_type (_tmp491_); |
| 28335 | } else { |
| 28336 | _tmp489_ = FALSE(0); |
| 28337 | } |
| 28338 | if (_tmp489_) { |
| 28339 | BalaMethod* _tmp492_; |
| 28340 | _tmp492_ = m; |
| 28341 | _tmp488_ = bala_get_ccode_instance_pos ((BalaCodeNode*) _tmp492_) < ((gdouble) 0); |
| 28342 | } else { |
| 28343 | _tmp488_ = FALSE(0); |
| 28344 | } |
| 28345 | if (_tmp488_) { |
| 28346 | BalaHashMap* _tmp493_; |
| 28347 | BalaCCodeExpression* _tmp494_; |
| 28348 | BalaCCodeUnaryExpression* _tmp495_; |
| 28349 | BalaCCodeUnaryExpression* _tmp496_; |
| 28350 | _tmp493_ = out_arg_map; |
| 28351 | _tmp494_ = instance; |
| 28352 | _tmp495_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp494_); |
| 28353 | _tmp496_ = _tmp495_; |
| 28354 | bala_map_set ((BalaMap*) _tmp493_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (gdouble) -3, FALSE(0))), (BalaCCodeExpression*) _tmp496_); |
| 28355 | _bala_ccode_node_unref0 (_tmp496_)((_tmp496_ == ((void*)0)) ? ((void*)0) : (_tmp496_ = (bala_ccode_node_unref (_tmp496_), ((void*)0)))); |
| 28356 | } |
| 28357 | _tmp498_ = m; |
| 28358 | if (_tmp498_ != NULL((void*)0)) { |
| 28359 | BalaMethod* _tmp499_; |
| 28360 | gboolean _tmp500_; |
| 28361 | gboolean _tmp501_; |
| 28362 | _tmp499_ = m; |
| 28363 | _tmp500_ = bala_method_get_coroutine (_tmp499_); |
| 28364 | _tmp501_ = _tmp500_; |
| 28365 | _tmp497_ = _tmp501_; |
| 28366 | } else { |
| 28367 | _tmp497_ = FALSE(0); |
| 28368 | } |
| 28369 | if (_tmp497_) { |
| 28370 | gboolean _tmp502_; |
| 28371 | gboolean _tmp503_; |
| 28372 | _tmp502_ = bala_object_creation_expression_get_is_yield_expression (expr); |
| 28373 | _tmp503_ = _tmp502_; |
| 28374 | if (_tmp503_) { |
| 28375 | BalaHashMap* _tmp504_; |
| 28376 | BalaMethod* _tmp505_; |
| 28377 | BalaMethod* _tmp506_; |
| 28378 | gchar* _tmp507_; |
| 28379 | gchar* _tmp508_; |
| 28380 | BalaCCodeIdentifier* _tmp509_; |
| 28381 | BalaCCodeIdentifier* _tmp510_; |
| 28382 | BalaHashMap* _tmp511_; |
| 28383 | BalaCCodeIdentifier* _tmp512_; |
| 28384 | BalaCCodeIdentifier* _tmp513_; |
| 28385 | _tmp504_ = in_arg_map; |
| 28386 | _tmp505_ = bala_ccode_base_module_get_current_method (self); |
| 28387 | _tmp506_ = _tmp505_; |
| 28388 | _tmp507_ = bala_ccode_base_module_generate_ready_function (self, _tmp506_); |
| 28389 | _tmp508_ = _tmp507_; |
| 28390 | _tmp509_ = bala_ccode_identifier_new (_tmp508_); |
| 28391 | _tmp510_ = _tmp509_; |
| 28392 | bala_map_set ((BalaMap*) _tmp504_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, (gdouble) -1, FALSE(0))), (BalaCCodeExpression*) _tmp510_); |
| 28393 | _bala_ccode_node_unref0 (_tmp510_)((_tmp510_ == ((void*)0)) ? ((void*)0) : (_tmp510_ = (bala_ccode_node_unref (_tmp510_), ((void*)0)))); |
| 28394 | _g_free0 (_tmp508_)(_tmp508_ = (g_free (_tmp508_), ((void*)0))); |
| 28395 | _tmp511_ = in_arg_map; |
| 28396 | _tmp512_ = bala_ccode_identifier_new ("_data_"); |
| 28397 | _tmp513_ = _tmp512_; |
| 28398 | bala_map_set ((BalaMap*) _tmp511_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, -0.9, FALSE(0))), (BalaCCodeExpression*) _tmp513_); |
| 28399 | _bala_ccode_node_unref0 (_tmp513_)((_tmp513_ == ((void*)0)) ? ((void*)0) : (_tmp513_ = (bala_ccode_node_unref (_tmp513_), ((void*)0)))); |
| 28400 | } |
| 28401 | } |
| 28402 | _tmp516_ = m; |
| 28403 | if (_tmp516_ != NULL((void*)0)) { |
| 28404 | BalaMethod* _tmp517_; |
| 28405 | gboolean _tmp518_; |
| 28406 | gboolean _tmp519_; |
| 28407 | _tmp517_ = m; |
| 28408 | _tmp518_ = bala_method_get_coroutine (_tmp517_); |
| 28409 | _tmp519_ = _tmp518_; |
| 28410 | _tmp515_ = _tmp519_; |
| 28411 | } else { |
| 28412 | _tmp515_ = FALSE(0); |
| 28413 | } |
| 28414 | if (_tmp515_) { |
| 28415 | BalaMethod* _tmp520_; |
| 28416 | BalaSymbol* _tmp521_; |
| 28417 | BalaSymbol* _tmp522_; |
| 28418 | _tmp520_ = m; |
| 28419 | _tmp521_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp520_); |
| 28420 | _tmp522_ = _tmp521_; |
| 28421 | _tmp514_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp522_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp522_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 28422 | } else { |
| 28423 | _tmp514_ = FALSE(0); |
| 28424 | } |
| 28425 | if (_tmp514_) { |
| 28426 | BalaMethod* _tmp523_; |
| 28427 | _tmp523_ = m; |
| 28428 | if (bala_get_ccode_finish_instance (_tmp523_)) { |
| 28429 | BalaCCodeMemberAccess* tmp = NULL((void*)0); |
| 28430 | BalaCCodeIdentifier* _tmp524_; |
| 28431 | BalaCCodeIdentifier* _tmp525_; |
| 28432 | BalaCCodeMemberAccess* _tmp526_; |
| 28433 | BalaCCodeMemberAccess* _tmp527_; |
| 28434 | BalaHashMap* _tmp528_; |
| 28435 | BalaMethod* _tmp529_; |
| 28436 | BalaCCodeMemberAccess* _tmp530_; |
| 28437 | _tmp524_ = bala_ccode_identifier_new ("_data_"); |
| 28438 | _tmp525_ = _tmp524_; |
| 28439 | _tmp526_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp525_, "_source_object_"); |
| 28440 | _tmp527_ = _tmp526_; |
| 28441 | _bala_ccode_node_unref0 (_tmp525_)((_tmp525_ == ((void*)0)) ? ((void*)0) : (_tmp525_ = (bala_ccode_node_unref (_tmp525_), ((void*)0)))); |
| 28442 | tmp = _tmp527_; |
| 28443 | _tmp528_ = out_arg_map; |
| 28444 | _tmp529_ = m; |
| 28445 | _tmp530_ = tmp; |
| 28446 | bala_map_set ((BalaMap*) _tmp528_, (gpointer) ((gintptr) bala_ccode_base_module_get_param_pos (self, bala_get_ccode_instance_pos ((BalaCodeNode*) _tmp529_), FALSE(0))), (BalaCCodeExpression*) _tmp530_); |
| 28447 | _bala_ccode_node_unref0 (tmp)((tmp == ((void*)0)) ? ((void*)0) : (tmp = (bala_ccode_node_unref (tmp), ((void*)0)))); |
| 28448 | } |
| 28449 | } |
| 28450 | _tmp531_ = async_call; |
| 28451 | _tmp532_ = creation_call; |
| 28452 | if (_tmp531_ != _tmp532_) { |
| 28453 | last_pos = -1; |
| 28454 | while (TRUE(!(0))) { |
| 28455 | BalaCCodeFunctionCall* _tmp543_; |
| 28456 | BalaHashMap* _tmp544_; |
| 28457 | gpointer _tmp545_; |
| 28458 | BalaCCodeExpression* _tmp546_; |
| 28459 | min_pos = -1; |
| 28460 | { |
| 28461 | BalaIterator* _pos_it = NULL((void*)0); |
| 28462 | BalaHashMap* _tmp533_; |
| 28463 | BalaSet* _tmp534_; |
| 28464 | BalaSet* _tmp535_; |
| 28465 | BalaIterator* _tmp536_; |
| 28466 | BalaIterator* _tmp537_; |
| 28467 | _tmp533_ = out_arg_map; |
| 28468 | _tmp534_ = bala_map_get_keys ((BalaMap*) _tmp533_); |
| 28469 | _tmp535_ = _tmp534_; |
| 28470 | _tmp536_ = bala_iterable_iterator ((BalaIterable*) _tmp535_); |
| 28471 | _tmp537_ = _tmp536_; |
| 28472 | _bala_iterable_unref0 (_tmp535_)((_tmp535_ == ((void*)0)) ? ((void*)0) : (_tmp535_ = (bala_iterable_unref (_tmp535_), ((void*)0)))); |
| 28473 | _pos_it = _tmp537_; |
| 28474 | while (TRUE(!(0))) { |
| 28475 | BalaIterator* _tmp538_; |
| 28476 | gint pos = 0; |
| 28477 | BalaIterator* _tmp539_; |
| 28478 | gpointer _tmp540_; |
| 28479 | gboolean _tmp541_ = FALSE(0); |
| 28480 | _tmp538_ = _pos_it; |
| 28481 | if (!bala_iterator_next (_tmp538_)) { |
| 28482 | break; |
| 28483 | } |
| 28484 | _tmp539_ = _pos_it; |
| 28485 | _tmp540_ = bala_iterator_get (_tmp539_); |
| 28486 | pos = (gint) ((gintptr) _tmp540_); |
| 28487 | if (pos > last_pos) { |
| 28488 | gboolean _tmp542_ = FALSE(0); |
| 28489 | if (min_pos == -1) { |
| 28490 | _tmp542_ = TRUE(!(0)); |
| 28491 | } else { |
| 28492 | _tmp542_ = pos < min_pos; |
| 28493 | } |
| 28494 | _tmp541_ = _tmp542_; |
| 28495 | } else { |
| 28496 | _tmp541_ = FALSE(0); |
| 28497 | } |
| 28498 | if (_tmp541_) { |
| 28499 | min_pos = pos; |
| 28500 | } |
| 28501 | } |
| 28502 | _bala_iterator_unref0 (_pos_it)((_pos_it == ((void*)0)) ? ((void*)0) : (_pos_it = (bala_iterator_unref (_pos_it), ((void*)0)))); |
| 28503 | } |
| 28504 | if (min_pos == -1) { |
| 28505 | break; |
| 28506 | } |
| 28507 | _tmp543_ = creation_call; |
| 28508 | _tmp544_ = out_arg_map; |
| 28509 | _tmp545_ = bala_map_get ((BalaMap*) _tmp544_, (gpointer) ((gintptr) min_pos)); |
| 28510 | _tmp546_ = (BalaCCodeExpression*) _tmp545_; |
| 28511 | bala_ccode_function_call_add_argument (_tmp543_, _tmp546_); |
| 28512 | _bala_ccode_node_unref0 (_tmp546_)((_tmp546_ == ((void*)0)) ? ((void*)0) : (_tmp546_ = (bala_ccode_node_unref (_tmp546_), ((void*)0)))); |
| 28513 | last_pos = min_pos; |
| 28514 | } |
| 28515 | } |
| 28516 | _tmp547_ = async_call; |
| 28517 | if (_tmp547_ != NULL((void*)0)) { |
| 28518 | last_pos = -1; |
| 28519 | while (TRUE(!(0))) { |
| 28520 | BalaCCodeFunctionCall* _tmp558_; |
| 28521 | BalaHashMap* _tmp559_; |
| 28522 | gpointer _tmp560_; |
| 28523 | BalaCCodeExpression* _tmp561_; |
| 28524 | min_pos = -1; |
| 28525 | { |
| 28526 | BalaIterator* _pos_it = NULL((void*)0); |
| 28527 | BalaHashMap* _tmp548_; |
| 28528 | BalaSet* _tmp549_; |
| 28529 | BalaSet* _tmp550_; |
| 28530 | BalaIterator* _tmp551_; |
| 28531 | BalaIterator* _tmp552_; |
| 28532 | _tmp548_ = in_arg_map; |
| 28533 | _tmp549_ = bala_map_get_keys ((BalaMap*) _tmp548_); |
| 28534 | _tmp550_ = _tmp549_; |
| 28535 | _tmp551_ = bala_iterable_iterator ((BalaIterable*) _tmp550_); |
| 28536 | _tmp552_ = _tmp551_; |
| 28537 | _bala_iterable_unref0 (_tmp550_)((_tmp550_ == ((void*)0)) ? ((void*)0) : (_tmp550_ = (bala_iterable_unref (_tmp550_), ((void*)0)))); |
| 28538 | _pos_it = _tmp552_; |
| 28539 | while (TRUE(!(0))) { |
| 28540 | BalaIterator* _tmp553_; |
| 28541 | gint pos = 0; |
| 28542 | BalaIterator* _tmp554_; |
| 28543 | gpointer _tmp555_; |
| 28544 | gboolean _tmp556_ = FALSE(0); |
| 28545 | _tmp553_ = _pos_it; |
| 28546 | if (!bala_iterator_next (_tmp553_)) { |
| 28547 | break; |
| 28548 | } |
| 28549 | _tmp554_ = _pos_it; |
| 28550 | _tmp555_ = bala_iterator_get (_tmp554_); |
| 28551 | pos = (gint) ((gintptr) _tmp555_); |
| 28552 | if (pos > last_pos) { |
| 28553 | gboolean _tmp557_ = FALSE(0); |
| 28554 | if (min_pos == -1) { |
| 28555 | _tmp557_ = TRUE(!(0)); |
| 28556 | } else { |
| 28557 | _tmp557_ = pos < min_pos; |
| 28558 | } |
| 28559 | _tmp556_ = _tmp557_; |
| 28560 | } else { |
| 28561 | _tmp556_ = FALSE(0); |
| 28562 | } |
| 28563 | if (_tmp556_) { |
| 28564 | min_pos = pos; |
| 28565 | } |
| 28566 | } |
| 28567 | _bala_iterator_unref0 (_pos_it)((_pos_it == ((void*)0)) ? ((void*)0) : (_pos_it = (bala_iterator_unref (_pos_it), ((void*)0)))); |
| 28568 | } |
| 28569 | if (min_pos == -1) { |
| 28570 | break; |
| 28571 | } |
| 28572 | _tmp558_ = async_call; |
| 28573 | _tmp559_ = in_arg_map; |
| 28574 | _tmp560_ = bala_map_get ((BalaMap*) _tmp559_, (gpointer) ((gintptr) min_pos)); |
| 28575 | _tmp561_ = (BalaCCodeExpression*) _tmp560_; |
| 28576 | bala_ccode_function_call_add_argument (_tmp558_, _tmp561_); |
| 28577 | _bala_ccode_node_unref0 (_tmp561_)((_tmp561_ == ((void*)0)) ? ((void*)0) : (_tmp561_ = (bala_ccode_node_unref (_tmp561_), ((void*)0)))); |
| 28578 | last_pos = min_pos; |
| 28579 | } |
| 28580 | } |
| 28581 | _tmp562_ = bala_object_creation_expression_get_is_yield_expression (expr); |
| 28582 | _tmp563_ = _tmp562_; |
| 28583 | if (_tmp563_) { |
| 28584 | gint state = 0; |
| 28585 | BalaCCodeBaseModuleEmitContext* _tmp564_; |
| 28586 | gint _tmp565_; |
| 28587 | BalaCCodeFunction* _tmp566_; |
| 28588 | BalaCCodeFunction* _tmp567_; |
| 28589 | BalaCCodeIdentifier* _tmp568_; |
| 28590 | BalaCCodeIdentifier* _tmp569_; |
| 28591 | BalaCCodeMemberAccess* _tmp570_; |
| 28592 | BalaCCodeMemberAccess* _tmp571_; |
| 28593 | gchar* _tmp572_; |
| 28594 | gchar* _tmp573_; |
| 28595 | BalaCCodeConstant* _tmp574_; |
| 28596 | BalaCCodeConstant* _tmp575_; |
| 28597 | BalaCCodeFunction* _tmp576_; |
| 28598 | BalaCCodeFunction* _tmp577_; |
| 28599 | BalaCCodeFunctionCall* _tmp578_; |
| 28600 | BalaCCodeFunction* _tmp579_; |
| 28601 | BalaCCodeFunction* _tmp580_; |
| 28602 | BalaCCodeConstant* _tmp581_; |
| 28603 | BalaCCodeConstant* _tmp582_; |
| 28604 | BalaCCodeFunction* _tmp583_; |
| 28605 | BalaCCodeFunction* _tmp584_; |
| 28606 | gchar* _tmp585_; |
| 28607 | gchar* _tmp586_; |
| 28608 | _tmp564_ = self->emit_context; |
| 28609 | _tmp565_ = _tmp564_->next_coroutine_state; |
| 28610 | _tmp564_->next_coroutine_state = _tmp565_ + 1; |
| 28611 | state = _tmp565_; |
| 28612 | _tmp566_ = bala_ccode_base_module_get_ccode (self); |
| 28613 | _tmp567_ = _tmp566_; |
| 28614 | _tmp568_ = bala_ccode_identifier_new ("_data_"); |
| 28615 | _tmp569_ = _tmp568_; |
| 28616 | _tmp570_ = bala_ccode_member_access_new_pointer ((BalaCCodeExpression*) _tmp569_, "_state_"); |
| 28617 | _tmp571_ = _tmp570_; |
| 28618 | _tmp572_ = g_strdup_printf ("%i", state); |
| 28619 | _tmp573_ = _tmp572_; |
| 28620 | _tmp574_ = bala_ccode_constant_new (_tmp573_); |
| 28621 | _tmp575_ = _tmp574_; |
| 28622 | bala_ccode_function_add_assignment (_tmp567_, (BalaCCodeExpression*) _tmp571_, (BalaCCodeExpression*) _tmp575_); |
| 28623 | _bala_ccode_node_unref0 (_tmp575_)((_tmp575_ == ((void*)0)) ? ((void*)0) : (_tmp575_ = (bala_ccode_node_unref (_tmp575_), ((void*)0)))); |
| 28624 | _g_free0 (_tmp573_)(_tmp573_ = (g_free (_tmp573_), ((void*)0))); |
| 28625 | _bala_ccode_node_unref0 (_tmp571_)((_tmp571_ == ((void*)0)) ? ((void*)0) : (_tmp571_ = (bala_ccode_node_unref (_tmp571_), ((void*)0)))); |
| 28626 | _bala_ccode_node_unref0 (_tmp569_)((_tmp569_ == ((void*)0)) ? ((void*)0) : (_tmp569_ = (bala_ccode_node_unref (_tmp569_), ((void*)0)))); |
| 28627 | _tmp576_ = bala_ccode_base_module_get_ccode (self); |
| 28628 | _tmp577_ = _tmp576_; |
| 28629 | _tmp578_ = async_call; |
| 28630 | bala_ccode_function_add_expression (_tmp577_, (BalaCCodeExpression*) _tmp578_); |
| 28631 | _tmp579_ = bala_ccode_base_module_get_ccode (self); |
| 28632 | _tmp580_ = _tmp579_; |
| 28633 | _tmp581_ = bala_ccode_constant_new ("FALSE"); |
| 28634 | _tmp582_ = _tmp581_; |
| 28635 | bala_ccode_function_add_return (_tmp580_, (BalaCCodeExpression*) _tmp582_); |
| 28636 | _bala_ccode_node_unref0 (_tmp582_)((_tmp582_ == ((void*)0)) ? ((void*)0) : (_tmp582_ = (bala_ccode_node_unref (_tmp582_), ((void*)0)))); |
| 28637 | _tmp583_ = bala_ccode_base_module_get_ccode (self); |
| 28638 | _tmp584_ = _tmp583_; |
| 28639 | _tmp585_ = g_strdup_printf ("_state_%d", state); |
| 28640 | _tmp586_ = _tmp585_; |
| 28641 | bala_ccode_function_add_label (_tmp584_, _tmp586_); |
| 28642 | _g_free0 (_tmp586_)(_tmp586_ = (g_free (_tmp586_), ((void*)0))); |
| 28643 | } |
| 28644 | _tmp587_ = creation_call; |
| 28645 | _tmp588_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp587_); |
| 28646 | _bala_ccode_node_unref0 (creation_expr)((creation_expr == ((void*)0)) ? ((void*)0) : (creation_expr = (bala_ccode_node_unref (creation_expr), ((void*)0)))); |
| 28647 | creation_expr = _tmp588_; |
| 28648 | _tmp589_ = m; |
| 28649 | _tmp590_ = bala_get_ccode_type ((BalaCodeNode*) _tmp589_); |
| 28650 | _tmp591_ = _tmp590_; |
| 28651 | _tmp592_ = _tmp591_ != NULL((void*)0); |
| 28652 | _g_free0 (_tmp591_)(_tmp591_ = (g_free (_tmp591_), ((void*)0))); |
| 28653 | if (_tmp592_) { |
| 28654 | BalaCCodeExpression* _tmp593_; |
| 28655 | BalaDataType* _tmp594_; |
| 28656 | BalaDataType* _tmp595_; |
| 28657 | gchar* _tmp596_; |
| 28658 | gchar* _tmp597_; |
| 28659 | BalaCCodeCastExpression* _tmp598_; |
| 28660 | _tmp593_ = creation_expr; |
| 28661 | _tmp594_ = bala_object_creation_expression_get_type_reference (expr); |
| 28662 | _tmp595_ = _tmp594_; |
| 28663 | _tmp596_ = bala_get_ccode_name ((BalaCodeNode*) _tmp595_); |
| 28664 | _tmp597_ = _tmp596_; |
| 28665 | _tmp598_ = bala_ccode_cast_expression_new (_tmp593_, _tmp597_); |
| 28666 | _bala_ccode_node_unref0 (creation_expr)((creation_expr == ((void*)0)) ? ((void*)0) : (creation_expr = (bala_ccode_node_unref (creation_expr), ((void*)0)))); |
| 28667 | creation_expr = (BalaCCodeExpression*) _tmp598_; |
| 28668 | _g_free0 (_tmp597_)(_tmp597_ = (g_free (_tmp597_), ((void*)0))); |
| 28669 | } |
| 28670 | _bala_iterator_unref0 (params_it)((params_it == ((void*)0)) ? ((void*)0) : (params_it = (bala_iterator_unref (params_it), ((void*)0)))); |
| 28671 | _bala_map_unref0 (out_arg_map)((out_arg_map == ((void*)0)) ? ((void*)0) : (out_arg_map = (bala_map_unref (out_arg_map), ((void*)0)))); |
| 28672 | _bala_map_unref0 (in_arg_map)((in_arg_map == ((void*)0)) ? ((void*)0) : (in_arg_map = (bala_map_unref (in_arg_map), ((void*)0)))); |
| 28673 | _bala_ccode_node_unref0 (finish_call)((finish_call == ((void*)0)) ? ((void*)0) : (finish_call = (bala_ccode_node_unref (finish_call), ((void*)0)))); |
| 28674 | _bala_ccode_node_unref0 (async_call)((async_call == ((void*)0)) ? ((void*)0) : (async_call = (bala_ccode_node_unref (async_call), ((void*)0)))); |
| 28675 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 28676 | _bala_iterable_unref0 (params)((params == ((void*)0)) ? ((void*)0) : (params = (bala_iterable_unref (params), ((void*)0)))); |
| 28677 | _bala_code_node_unref0 (m)((m == ((void*)0)) ? ((void*)0) : (m = (bala_code_node_unref ( m), ((void*)0)))); |
| 28678 | } else { |
| 28679 | BalaSymbol* _tmp599_; |
| 28680 | BalaSymbol* _tmp600_; |
| 28681 | _tmp599_ = bala_expression_get_symbol_reference ((BalaExpression*) expr); |
| 28682 | _tmp600_ = _tmp599_; |
| 28683 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp600_, BALA_TYPE_ERROR_CODE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp600_); GType __t = ((bala_error_code_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 28684 | BalaErrorCode* ecode = NULL((void*)0); |
| 28685 | BalaSymbol* _tmp601_; |
| 28686 | BalaSymbol* _tmp602_; |
| 28687 | BalaErrorCode* _tmp603_; |
| 28688 | BalaErrorDomain* edomain = NULL((void*)0); |
| 28689 | BalaErrorCode* _tmp604_; |
| 28690 | BalaSymbol* _tmp605_; |
| 28691 | BalaSymbol* _tmp606_; |
| 28692 | BalaErrorDomain* _tmp607_; |
| 28693 | BalaCCodeFunctionCall* creation_call = NULL((void*)0); |
| 28694 | BalaErrorDomain* _tmp608_; |
| 28695 | BalaCCodeFile* _tmp609_; |
| 28696 | BalaList* _tmp610_; |
| 28697 | gint _tmp611_; |
| 28698 | gint _tmp612_; |
| 28699 | BalaCCodeFunctionCall* _tmp619_; |
| 28700 | BalaErrorDomain* _tmp620_; |
| 28701 | gchar* _tmp621_; |
| 28702 | gchar* _tmp622_; |
| 28703 | BalaCCodeIdentifier* _tmp623_; |
| 28704 | BalaCCodeIdentifier* _tmp624_; |
| 28705 | BalaCCodeFunctionCall* _tmp625_; |
| 28706 | BalaErrorCode* _tmp626_; |
| 28707 | gchar* _tmp627_; |
| 28708 | gchar* _tmp628_; |
| 28709 | BalaCCodeIdentifier* _tmp629_; |
| 28710 | BalaCCodeIdentifier* _tmp630_; |
| 28711 | BalaCCodeFunctionCall* _tmp643_; |
| 28712 | BalaCCodeExpression* _tmp644_; |
| 28713 | _tmp601_ = bala_expression_get_symbol_reference ((BalaExpression*) expr); |
| 28714 | _tmp602_ = _tmp601_; |
| 28715 | _tmp603_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp602_, BALA_TYPE_ERROR_CODE, BalaErrorCode)(((BalaErrorCode*) g_type_check_instance_cast ((GTypeInstance *) (_tmp602_), ((bala_error_code_get_type ())))))); |
| 28716 | ecode = _tmp603_; |
| 28717 | _tmp604_ = ecode; |
| 28718 | _tmp605_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp604_); |
| 28719 | _tmp606_ = _tmp605_; |
| 28720 | _tmp607_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp606_, BALA_TYPE_ERROR_DOMAIN, BalaErrorDomain)(((BalaErrorDomain*) g_type_check_instance_cast ((GTypeInstance *) (_tmp606_), ((bala_error_domain_get_type ())))))); |
| 28721 | edomain = _tmp607_; |
| 28722 | _tmp608_ = edomain; |
| 28723 | _tmp609_ = self->cfile; |
| 28724 | bala_ccode_base_module_generate_error_domain_declaration (self, _tmp608_, _tmp609_); |
| 28725 | _tmp610_ = bala_object_creation_expression_get_argument_list (expr); |
| 28726 | _tmp611_ = bala_collection_get_size ((BalaCollection*) _tmp610_); |
| 28727 | _tmp612_ = _tmp611_; |
| 28728 | if (_tmp612_ == 1) { |
| 28729 | BalaCCodeIdentifier* _tmp613_; |
| 28730 | BalaCCodeIdentifier* _tmp614_; |
| 28731 | BalaCCodeFunctionCall* _tmp615_; |
| 28732 | _tmp613_ = bala_ccode_identifier_new ("g_error_new_literal"); |
| 28733 | _tmp614_ = _tmp613_; |
| 28734 | _tmp615_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp614_); |
| 28735 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 28736 | creation_call = _tmp615_; |
| 28737 | _bala_ccode_node_unref0 (_tmp614_)((_tmp614_ == ((void*)0)) ? ((void*)0) : (_tmp614_ = (bala_ccode_node_unref (_tmp614_), ((void*)0)))); |
| 28738 | } else { |
| 28739 | BalaCCodeIdentifier* _tmp616_; |
| 28740 | BalaCCodeIdentifier* _tmp617_; |
| 28741 | BalaCCodeFunctionCall* _tmp618_; |
| 28742 | _tmp616_ = bala_ccode_identifier_new ("g_error_new"); |
| 28743 | _tmp617_ = _tmp616_; |
| 28744 | _tmp618_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp617_); |
| 28745 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 28746 | creation_call = _tmp618_; |
| 28747 | _bala_ccode_node_unref0 (_tmp617_)((_tmp617_ == ((void*)0)) ? ((void*)0) : (_tmp617_ = (bala_ccode_node_unref (_tmp617_), ((void*)0)))); |
| 28748 | } |
| 28749 | _tmp619_ = creation_call; |
| 28750 | _tmp620_ = edomain; |
| 28751 | _tmp621_ = bala_get_ccode_upper_case_name ((BalaSymbol*) _tmp620_, NULL((void*)0)); |
| 28752 | _tmp622_ = _tmp621_; |
| 28753 | _tmp623_ = bala_ccode_identifier_new (_tmp622_); |
| 28754 | _tmp624_ = _tmp623_; |
| 28755 | bala_ccode_function_call_add_argument (_tmp619_, (BalaCCodeExpression*) _tmp624_); |
| 28756 | _bala_ccode_node_unref0 (_tmp624_)((_tmp624_ == ((void*)0)) ? ((void*)0) : (_tmp624_ = (bala_ccode_node_unref (_tmp624_), ((void*)0)))); |
| 28757 | _g_free0 (_tmp622_)(_tmp622_ = (g_free (_tmp622_), ((void*)0))); |
| 28758 | _tmp625_ = creation_call; |
| 28759 | _tmp626_ = ecode; |
| 28760 | _tmp627_ = bala_get_ccode_name ((BalaCodeNode*) _tmp626_); |
| 28761 | _tmp628_ = _tmp627_; |
| 28762 | _tmp629_ = bala_ccode_identifier_new (_tmp628_); |
| 28763 | _tmp630_ = _tmp629_; |
| 28764 | bala_ccode_function_call_add_argument (_tmp625_, (BalaCCodeExpression*) _tmp630_); |
| 28765 | _bala_ccode_node_unref0 (_tmp630_)((_tmp630_ == ((void*)0)) ? ((void*)0) : (_tmp630_ = (bala_ccode_node_unref (_tmp630_), ((void*)0)))); |
| 28766 | _g_free0 (_tmp628_)(_tmp628_ = (g_free (_tmp628_), ((void*)0))); |
| 28767 | { |
| 28768 | BalaList* _arg_list = NULL((void*)0); |
| 28769 | BalaList* _tmp631_; |
| 28770 | BalaList* _tmp632_; |
| 28771 | gint _arg_size = 0; |
| 28772 | BalaList* _tmp633_; |
| 28773 | gint _tmp634_; |
| 28774 | gint _tmp635_; |
| 28775 | gint _arg_index = 0; |
| 28776 | _tmp631_ = bala_object_creation_expression_get_argument_list (expr); |
| 28777 | _tmp632_ = _bala_iterable_ref0 (_tmp631_); |
| 28778 | _arg_list = _tmp632_; |
| 28779 | _tmp633_ = _arg_list; |
| 28780 | _tmp634_ = bala_collection_get_size ((BalaCollection*) _tmp633_); |
| 28781 | _tmp635_ = _tmp634_; |
| 28782 | _arg_size = _tmp635_; |
| 28783 | _arg_index = -1; |
| 28784 | while (TRUE(!(0))) { |
| 28785 | gint _tmp636_; |
| 28786 | gint _tmp637_; |
| 28787 | BalaExpression* arg = NULL((void*)0); |
| 28788 | BalaList* _tmp638_; |
| 28789 | gpointer _tmp639_; |
| 28790 | BalaCCodeFunctionCall* _tmp640_; |
| 28791 | BalaExpression* _tmp641_; |
| 28792 | BalaCCodeExpression* _tmp642_; |
| 28793 | _arg_index = _arg_index + 1; |
| 28794 | _tmp636_ = _arg_index; |
| 28795 | _tmp637_ = _arg_size; |
| 28796 | if (!(_tmp636_ < _tmp637_)) { |
| 28797 | break; |
| 28798 | } |
| 28799 | _tmp638_ = _arg_list; |
| 28800 | _tmp639_ = bala_list_get (_tmp638_, _arg_index); |
| 28801 | arg = (BalaExpression*) _tmp639_; |
| 28802 | _tmp640_ = creation_call; |
| 28803 | _tmp641_ = arg; |
| 28804 | _tmp642_ = bala_get_cvalue (_tmp641_); |
| 28805 | bala_ccode_function_call_add_argument (_tmp640_, _tmp642_); |
| 28806 | _bala_code_node_unref0 (arg)((arg == ((void*)0)) ? ((void*)0) : (arg = (bala_code_node_unref (arg), ((void*)0)))); |
| 28807 | } |
| 28808 | _bala_iterable_unref0 (_arg_list)((_arg_list == ((void*)0)) ? ((void*)0) : (_arg_list = (bala_iterable_unref (_arg_list), ((void*)0)))); |
| 28809 | } |
| 28810 | _tmp643_ = creation_call; |
| 28811 | _tmp644_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp643_); |
| 28812 | _bala_ccode_node_unref0 (creation_expr)((creation_expr == ((void*)0)) ? ((void*)0) : (creation_expr = (bala_ccode_node_unref (creation_expr), ((void*)0)))); |
| 28813 | creation_expr = _tmp644_; |
| 28814 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 28815 | _bala_code_node_unref0 (edomain)((edomain == ((void*)0)) ? ((void*)0) : (edomain = (bala_code_node_unref (edomain), ((void*)0)))); |
| 28816 | _bala_code_node_unref0 (ecode)((ecode == ((void*)0)) ? ((void*)0) : (ecode = (bala_code_node_unref (ecode), ((void*)0)))); |
| 28817 | } else { |
| 28818 | _bala_assert (FALSE, "false")if ((0)) ; else g_assertion_message_expr ("bala-ccodegen", "balaccodebasemodule.c" , 28818, ((const char*) (__func__)), "false");; |
| 28819 | } |
| 28820 | } |
| 28821 | } |
| 28822 | } |
| 28823 | _tmp645_ = bala_code_node_get_parent_node ((BalaCodeNode*) expr); |
| 28824 | _tmp646_ = _tmp645_; |
| 28825 | _tmp647_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp646_, BALA_TYPE_LOCAL_VARIABLE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp646_); GType __t = ((bala_local_variable_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaLocalVariable*) _tmp646_) : NULL((void*)0)); |
| 28826 | local = _tmp647_; |
| 28827 | _tmp649_ = local; |
| 28828 | if (_tmp649_ != NULL((void*)0)) { |
| 28829 | BalaLocalVariable* _tmp650_; |
| 28830 | BalaLocalVariable* _tmp651_; |
| 28831 | BalaExpression* _tmp652_; |
| 28832 | BalaExpression* _tmp653_; |
| 28833 | _tmp650_ = local; |
| 28834 | _tmp651_ = local; |
| 28835 | _tmp652_ = bala_variable_get_initializer ((BalaVariable*) _tmp651_); |
| 28836 | _tmp653_ = _tmp652_; |
| 28837 | _tmp648_ = bala_ccode_base_module_is_simple_struct_creation (self, (BalaVariable*) _tmp650_, _tmp653_); |
| 28838 | } else { |
| 28839 | _tmp648_ = FALSE(0); |
| 28840 | } |
| 28841 | if (_tmp648_) { |
| 28842 | BalaCCodeFunction* _tmp654_; |
| 28843 | BalaCCodeFunction* _tmp655_; |
| 28844 | BalaCCodeExpression* _tmp656_; |
| 28845 | BalaCCodeExpression* _tmp657_; |
| 28846 | _tmp654_ = bala_ccode_base_module_get_ccode (self); |
| 28847 | _tmp655_ = _tmp654_; |
| 28848 | _tmp656_ = creation_expr; |
| 28849 | bala_ccode_function_add_expression (_tmp655_, _tmp656_); |
| 28850 | _tmp657_ = instance; |
| 28851 | bala_set_cvalue ((BalaExpression*) expr, _tmp657_); |
| 28852 | } else { |
| 28853 | BalaCCodeExpression* _tmp658_; |
| 28854 | _tmp658_ = instance; |
| 28855 | if (_tmp658_ != NULL((void*)0)) { |
| 28856 | BalaDataType* _tmp659_; |
| 28857 | BalaDataType* _tmp660_; |
| 28858 | BalaTypeSymbol* _tmp661_; |
| 28859 | BalaTypeSymbol* _tmp662_; |
| 28860 | BalaCCodeExpression* _tmp787_; |
| 28861 | _tmp659_ = bala_object_creation_expression_get_type_reference (expr); |
| 28862 | _tmp660_ = _tmp659_; |
| 28863 | _tmp661_ = bala_data_type_get_type_symbol (_tmp660_); |
| 28864 | _tmp662_ = _tmp661_; |
| 28865 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp662_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp662_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 28866 | BalaCCodeFunction* _tmp663_; |
| 28867 | BalaCCodeFunction* _tmp664_; |
| 28868 | BalaCCodeExpression* _tmp665_; |
| 28869 | _tmp663_ = bala_ccode_base_module_get_ccode (self); |
| 28870 | _tmp664_ = _tmp663_; |
| 28871 | _tmp665_ = creation_expr; |
| 28872 | bala_ccode_function_add_expression (_tmp664_, _tmp665_); |
| 28873 | } else { |
| 28874 | BalaCCodeFunction* _tmp666_; |
| 28875 | BalaCCodeFunction* _tmp667_; |
| 28876 | BalaCCodeExpression* _tmp668_; |
| 28877 | BalaCCodeExpression* _tmp669_; |
| 28878 | _tmp666_ = bala_ccode_base_module_get_ccode (self); |
| 28879 | _tmp667_ = _tmp666_; |
| 28880 | _tmp668_ = instance; |
| 28881 | _tmp669_ = creation_expr; |
| 28882 | bala_ccode_function_add_assignment (_tmp667_, _tmp668_, _tmp669_); |
| 28883 | } |
| 28884 | { |
| 28885 | BalaList* _init_list = NULL((void*)0); |
| 28886 | BalaList* _tmp670_; |
| 28887 | BalaList* _tmp671_; |
| 28888 | gint _init_size = 0; |
| 28889 | BalaList* _tmp672_; |
| 28890 | gint _tmp673_; |
| 28891 | gint _tmp674_; |
| 28892 | gint _init_index = 0; |
| 28893 | _tmp670_ = bala_object_creation_expression_get_object_initializer (expr); |
| 28894 | _tmp671_ = _bala_iterable_ref0 (_tmp670_); |
| 28895 | _init_list = _tmp671_; |
| 28896 | _tmp672_ = _init_list; |
| 28897 | _tmp673_ = bala_collection_get_size ((BalaCollection*) _tmp672_); |
| 28898 | _tmp674_ = _tmp673_; |
| 28899 | _init_size = _tmp674_; |
| 28900 | _init_index = -1; |
| 28901 | while (TRUE(!(0))) { |
| 28902 | gint _tmp675_; |
| 28903 | gint _tmp676_; |
| 28904 | BalaMemberInitializer* init = NULL((void*)0); |
| 28905 | BalaList* _tmp677_; |
| 28906 | gpointer _tmp678_; |
| 28907 | BalaMemberInitializer* _tmp679_; |
| 28908 | BalaSymbol* _tmp680_; |
| 28909 | BalaSymbol* _tmp681_; |
| 28910 | _init_index = _init_index + 1; |
| 28911 | _tmp675_ = _init_index; |
| 28912 | _tmp676_ = _init_size; |
| 28913 | if (!(_tmp675_ < _tmp676_)) { |
| 28914 | break; |
| 28915 | } |
| 28916 | _tmp677_ = _init_list; |
| 28917 | _tmp678_ = bala_list_get (_tmp677_, _init_index); |
| 28918 | init = (BalaMemberInitializer*) _tmp678_; |
| 28919 | _tmp679_ = init; |
| 28920 | _tmp680_ = bala_member_initializer_get_symbol_reference (_tmp679_); |
| 28921 | _tmp681_ = _tmp680_; |
| 28922 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp681_, BALA_TYPE_FIELD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp681_); GType __t = ((bala_field_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 28923 | BalaField* f = NULL((void*)0); |
| 28924 | BalaMemberInitializer* _tmp682_; |
| 28925 | BalaSymbol* _tmp683_; |
| 28926 | BalaSymbol* _tmp684_; |
| 28927 | BalaField* _tmp685_; |
| 28928 | BalaDataType* instance_target_type = NULL((void*)0); |
| 28929 | BalaField* _tmp686_; |
| 28930 | BalaSymbol* _tmp687_; |
| 28931 | BalaSymbol* _tmp688_; |
| 28932 | BalaDataType* _tmp689_; |
| 28933 | BalaTargetValue* typed_inst = NULL((void*)0); |
| 28934 | BalaDataType* _tmp690_; |
| 28935 | BalaDataType* _tmp691_; |
| 28936 | BalaCCodeExpression* _tmp692_; |
| 28937 | BalaGLibValue* _tmp693_; |
| 28938 | BalaGLibValue* _tmp694_; |
| 28939 | BalaDataType* _tmp695_; |
| 28940 | BalaMemberInitializer* _tmp696_; |
| 28941 | BalaTargetValue* _tmp697_; |
| 28942 | BalaTargetValue* _tmp698_; |
| 28943 | BalaField* _tmp699_; |
| 28944 | BalaTargetValue* _tmp700_; |
| 28945 | BalaMemberInitializer* _tmp701_; |
| 28946 | BalaExpression* _tmp702_; |
| 28947 | BalaExpression* _tmp703_; |
| 28948 | BalaTargetValue* _tmp704_; |
| 28949 | BalaTargetValue* _tmp705_; |
| 28950 | BalaMemberInitializer* _tmp706_; |
| 28951 | BalaSourceReference* _tmp707_; |
| 28952 | BalaSourceReference* _tmp708_; |
| 28953 | BalaClass* cl = NULL((void*)0); |
| 28954 | BalaField* _tmp709_; |
| 28955 | BalaSymbol* _tmp710_; |
| 28956 | BalaSymbol* _tmp711_; |
| 28957 | BalaClass* _tmp712_; |
| 28958 | BalaClass* _tmp713_; |
| 28959 | _tmp682_ = init; |
| 28960 | _tmp683_ = bala_member_initializer_get_symbol_reference (_tmp682_); |
| 28961 | _tmp684_ = _tmp683_; |
| 28962 | _tmp685_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp684_, BALA_TYPE_FIELD, BalaField)(((BalaField*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp684_), ((bala_field_get_type ())))))); |
| 28963 | f = _tmp685_; |
| 28964 | _tmp686_ = f; |
| 28965 | _tmp687_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp686_); |
| 28966 | _tmp688_ = _tmp687_; |
| 28967 | _tmp689_ = bala_semantic_analyzer_get_data_type_for_symbol ((BalaSymbol*) G_TYPE_CHECK_INSTANCE_CAST (_tmp688_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp688_), ((bala_typesymbol_get_type ())))))); |
| 28968 | instance_target_type = _tmp689_; |
| 28969 | _tmp690_ = bala_object_creation_expression_get_type_reference (expr); |
| 28970 | _tmp691_ = _tmp690_; |
| 28971 | _tmp692_ = instance; |
| 28972 | _tmp693_ = bala_glib_value_new (_tmp691_, _tmp692_, TRUE(!(0))); |
| 28973 | _tmp694_ = _tmp693_; |
| 28974 | _tmp695_ = instance_target_type; |
| 28975 | _tmp696_ = init; |
| 28976 | _tmp697_ = bala_ccode_base_module_transform_value (self, (BalaTargetValue*) _tmp694_, _tmp695_, (BalaCodeNode*) _tmp696_); |
| 28977 | _tmp698_ = _tmp697_; |
| 28978 | _bala_target_value_unref0 (_tmp694_)((_tmp694_ == ((void*)0)) ? ((void*)0) : (_tmp694_ = (bala_target_value_unref (_tmp694_), ((void*)0)))); |
| 28979 | typed_inst = _tmp698_; |
| 28980 | _tmp699_ = f; |
| 28981 | _tmp700_ = typed_inst; |
| 28982 | _tmp701_ = init; |
| 28983 | _tmp702_ = bala_member_initializer_get_initializer (_tmp701_); |
| 28984 | _tmp703_ = _tmp702_; |
| 28985 | _tmp704_ = bala_expression_get_target_value (_tmp703_); |
| 28986 | _tmp705_ = _tmp704_; |
| 28987 | _tmp706_ = init; |
| 28988 | _tmp707_ = bala_code_node_get_source_reference ((BalaCodeNode*) _tmp706_); |
| 28989 | _tmp708_ = _tmp707_; |
| 28990 | bala_code_generator_store_field ((BalaCodeGenerator*) self, _tmp699_, _tmp700_, _tmp705_, _tmp708_); |
| 28991 | _tmp709_ = f; |
| 28992 | _tmp710_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp709_); |
| 28993 | _tmp711_ = _tmp710_; |
| 28994 | _tmp712_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp711_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp711_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp711_) : NULL((void*)0)); |
| 28995 | cl = _tmp712_; |
| 28996 | _tmp713_ = cl; |
| 28997 | if (_tmp713_ != NULL((void*)0)) { |
| 28998 | BalaClass* _tmp714_; |
| 28999 | BalaCCodeFile* _tmp715_; |
| 29000 | _tmp714_ = cl; |
| 29001 | _tmp715_ = self->cfile; |
| 29002 | bala_ccode_base_module_generate_class_struct_declaration (self, _tmp714_, _tmp715_); |
| 29003 | } |
| 29004 | _bala_code_node_unref0 (cl)((cl == ((void*)0)) ? ((void*)0) : (cl = (bala_code_node_unref (cl), ((void*)0)))); |
| 29005 | _bala_target_value_unref0 (typed_inst)((typed_inst == ((void*)0)) ? ((void*)0) : (typed_inst = (bala_target_value_unref (typed_inst), ((void*)0)))); |
| 29006 | _bala_code_node_unref0 (instance_target_type)((instance_target_type == ((void*)0)) ? ((void*)0) : (instance_target_type = (bala_code_node_unref (instance_target_type), ((void*)0))) ); |
| 29007 | _bala_code_node_unref0 (f)((f == ((void*)0)) ? ((void*)0) : (f = (bala_code_node_unref ( f), ((void*)0)))); |
| 29008 | } else { |
| 29009 | BalaMemberInitializer* _tmp716_; |
| 29010 | BalaSymbol* _tmp717_; |
| 29011 | BalaSymbol* _tmp718_; |
| 29012 | _tmp716_ = init; |
| 29013 | _tmp717_ = bala_member_initializer_get_symbol_reference (_tmp716_); |
| 29014 | _tmp718_ = _tmp717_; |
| 29015 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp718_, BALA_TYPE_PROPERTY)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp718_); GType __t = ((bala_property_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 29016 | BalaProperty* p = NULL((void*)0); |
| 29017 | BalaMemberInitializer* _tmp719_; |
| 29018 | BalaSymbol* _tmp720_; |
| 29019 | BalaSymbol* _tmp721_; |
| 29020 | BalaProperty* _tmp722_; |
| 29021 | BalaProperty* _tmp723_; |
| 29022 | BalaProperty* _tmp724_; |
| 29023 | BalaProperty* _tmp725_; |
| 29024 | BalaDataType* instance_target_type = NULL((void*)0); |
| 29025 | BalaProperty* _tmp737_; |
| 29026 | BalaSymbol* _tmp738_; |
| 29027 | BalaSymbol* _tmp739_; |
| 29028 | BalaDataType* _tmp740_; |
| 29029 | BalaTargetValue* typed_inst = NULL((void*)0); |
| 29030 | BalaDataType* _tmp741_; |
| 29031 | BalaDataType* _tmp742_; |
| 29032 | BalaCCodeExpression* _tmp743_; |
| 29033 | BalaGLibValue* _tmp744_; |
| 29034 | BalaGLibValue* _tmp745_; |
| 29035 | BalaDataType* _tmp746_; |
| 29036 | BalaMemberInitializer* _tmp747_; |
| 29037 | BalaTargetValue* _tmp748_; |
| 29038 | BalaTargetValue* _tmp749_; |
| 29039 | BalaMemberAccess* inst_ma = NULL((void*)0); |
| 29040 | BalaMemberAccess* _tmp750_; |
| 29041 | BalaMemberAccess* _tmp751_; |
| 29042 | BalaTargetValue* _tmp752_; |
| 29043 | BalaProperty* _tmp753_; |
| 29044 | BalaMemberAccess* _tmp754_; |
| 29045 | BalaMemberInitializer* _tmp755_; |
| 29046 | BalaExpression* _tmp756_; |
| 29047 | BalaExpression* _tmp757_; |
| 29048 | BalaTargetValue* _tmp758_; |
| 29049 | BalaTargetValue* _tmp759_; |
| 29050 | gboolean _tmp760_ = FALSE(0); |
| 29051 | BalaProperty* _tmp761_; |
| 29052 | BalaPropertyAccessor* _tmp762_; |
| 29053 | BalaPropertyAccessor* _tmp763_; |
| 29054 | BalaDataType* _tmp764_; |
| 29055 | BalaDataType* _tmp765_; |
| 29056 | gboolean _tmp766_; |
| 29057 | gboolean _tmp767_; |
| 29058 | _tmp719_ = init; |
| 29059 | _tmp720_ = bala_member_initializer_get_symbol_reference (_tmp719_); |
| 29060 | _tmp721_ = _tmp720_; |
| 29061 | _tmp722_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp721_, BALA_TYPE_PROPERTY, BalaProperty)(((BalaProperty*) g_type_check_instance_cast ((GTypeInstance* ) (_tmp721_), ((bala_property_get_type ())))))); |
| 29062 | p = _tmp722_; |
| 29063 | _tmp723_ = p; |
| 29064 | _tmp724_ = bala_property_get_base_property (_tmp723_); |
| 29065 | _tmp725_ = _tmp724_; |
| 29066 | if (_tmp725_ != NULL((void*)0)) { |
| 29067 | BalaProperty* _tmp726_; |
| 29068 | BalaProperty* _tmp727_; |
| 29069 | BalaProperty* _tmp728_; |
| 29070 | BalaProperty* _tmp729_; |
| 29071 | _tmp726_ = p; |
| 29072 | _tmp727_ = bala_property_get_base_property (_tmp726_); |
| 29073 | _tmp728_ = _tmp727_; |
| 29074 | _tmp729_ = _bala_code_node_ref0 (_tmp728_); |
| 29075 | _bala_code_node_unref0 (p)((p == ((void*)0)) ? ((void*)0) : (p = (bala_code_node_unref ( p), ((void*)0)))); |
| 29076 | p = _tmp729_; |
| 29077 | } else { |
| 29078 | BalaProperty* _tmp730_; |
| 29079 | BalaProperty* _tmp731_; |
| 29080 | BalaProperty* _tmp732_; |
| 29081 | _tmp730_ = p; |
| 29082 | _tmp731_ = bala_property_get_base_interface_property (_tmp730_); |
| 29083 | _tmp732_ = _tmp731_; |
| 29084 | if (_tmp732_ != NULL((void*)0)) { |
| 29085 | BalaProperty* _tmp733_; |
| 29086 | BalaProperty* _tmp734_; |
| 29087 | BalaProperty* _tmp735_; |
| 29088 | BalaProperty* _tmp736_; |
| 29089 | _tmp733_ = p; |
| 29090 | _tmp734_ = bala_property_get_base_interface_property (_tmp733_); |
| 29091 | _tmp735_ = _tmp734_; |
| 29092 | _tmp736_ = _bala_code_node_ref0 (_tmp735_); |
| 29093 | _bala_code_node_unref0 (p)((p == ((void*)0)) ? ((void*)0) : (p = (bala_code_node_unref ( p), ((void*)0)))); |
| 29094 | p = _tmp736_; |
| 29095 | } |
| 29096 | } |
| 29097 | _tmp737_ = p; |
| 29098 | _tmp738_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp737_); |
| 29099 | _tmp739_ = _tmp738_; |
| 29100 | _tmp740_ = bala_semantic_analyzer_get_data_type_for_symbol ((BalaSymbol*) G_TYPE_CHECK_INSTANCE_CAST (_tmp739_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp739_), ((bala_typesymbol_get_type ())))))); |
| 29101 | instance_target_type = _tmp740_; |
| 29102 | _tmp741_ = bala_object_creation_expression_get_type_reference (expr); |
| 29103 | _tmp742_ = _tmp741_; |
| 29104 | _tmp743_ = instance; |
| 29105 | _tmp744_ = bala_glib_value_new (_tmp742_, _tmp743_, FALSE(0)); |
| 29106 | _tmp745_ = _tmp744_; |
| 29107 | _tmp746_ = instance_target_type; |
| 29108 | _tmp747_ = init; |
| 29109 | _tmp748_ = bala_ccode_base_module_transform_value (self, (BalaTargetValue*) _tmp745_, _tmp746_, (BalaCodeNode*) _tmp747_); |
| 29110 | _tmp749_ = _tmp748_; |
| 29111 | _bala_target_value_unref0 (_tmp745_)((_tmp745_ == ((void*)0)) ? ((void*)0) : (_tmp745_ = (bala_target_value_unref (_tmp745_), ((void*)0)))); |
| 29112 | typed_inst = _tmp749_; |
| 29113 | _tmp750_ = bala_member_access_new_simple ("fake", NULL((void*)0)); |
| 29114 | inst_ma = _tmp750_; |
| 29115 | _tmp751_ = inst_ma; |
| 29116 | _tmp752_ = typed_inst; |
| 29117 | bala_expression_set_target_value ((BalaExpression*) _tmp751_, _tmp752_); |
| 29118 | _tmp753_ = p; |
| 29119 | _tmp754_ = inst_ma; |
| 29120 | _tmp755_ = init; |
| 29121 | _tmp756_ = bala_member_initializer_get_initializer (_tmp755_); |
| 29122 | _tmp757_ = _tmp756_; |
| 29123 | _tmp758_ = bala_expression_get_target_value (_tmp757_); |
| 29124 | _tmp759_ = _tmp758_; |
| 29125 | bala_ccode_base_module_store_property (self, _tmp753_, (BalaExpression*) _tmp754_, _tmp759_); |
| 29126 | _tmp761_ = p; |
| 29127 | _tmp762_ = bala_property_get_set_accessor (_tmp761_); |
| 29128 | _tmp763_ = _tmp762_; |
| 29129 | _tmp764_ = bala_property_accessor_get_value_type (_tmp763_); |
| 29130 | _tmp765_ = _tmp764_; |
| 29131 | _tmp766_ = bala_data_type_get_value_owned (_tmp765_); |
| 29132 | _tmp767_ = _tmp766_; |
| 29133 | if (!_tmp767_) { |
| 29134 | BalaMemberInitializer* _tmp768_; |
| 29135 | BalaExpression* _tmp769_; |
| 29136 | BalaExpression* _tmp770_; |
| 29137 | BalaTargetValue* _tmp771_; |
| 29138 | BalaTargetValue* _tmp772_; |
| 29139 | BalaDataType* _tmp773_; |
| 29140 | BalaDataType* _tmp774_; |
| 29141 | _tmp768_ = init; |
| 29142 | _tmp769_ = bala_member_initializer_get_initializer (_tmp768_); |
| 29143 | _tmp770_ = _tmp769_; |
| 29144 | _tmp771_ = bala_expression_get_target_value (_tmp770_); |
| 29145 | _tmp772_ = _tmp771_; |
| 29146 | _tmp773_ = bala_target_value_get_value_type (_tmp772_); |
| 29147 | _tmp774_ = _tmp773_; |
| 29148 | _tmp760_ = bala_ccode_base_module_requires_destroy (_tmp774_); |
| 29149 | } else { |
| 29150 | _tmp760_ = FALSE(0); |
| 29151 | } |
| 29152 | if (_tmp760_) { |
| 29153 | BalaCCodeFunction* _tmp775_; |
| 29154 | BalaCCodeFunction* _tmp776_; |
| 29155 | BalaMemberInitializer* _tmp777_; |
| 29156 | BalaExpression* _tmp778_; |
| 29157 | BalaExpression* _tmp779_; |
| 29158 | BalaTargetValue* _tmp780_; |
| 29159 | BalaTargetValue* _tmp781_; |
| 29160 | BalaCCodeExpression* _tmp782_; |
| 29161 | BalaCCodeExpression* _tmp783_; |
| 29162 | _tmp775_ = bala_ccode_base_module_get_ccode (self); |
| 29163 | _tmp776_ = _tmp775_; |
| 29164 | _tmp777_ = init; |
| 29165 | _tmp778_ = bala_member_initializer_get_initializer (_tmp777_); |
| 29166 | _tmp779_ = _tmp778_; |
| 29167 | _tmp780_ = bala_expression_get_target_value (_tmp779_); |
| 29168 | _tmp781_ = _tmp780_; |
| 29169 | _tmp782_ = bala_ccode_base_module_destroy_value (self, _tmp781_, FALSE(0)); |
| 29170 | _tmp783_ = _tmp782_; |
| 29171 | bala_ccode_function_add_expression (_tmp776_, _tmp783_); |
| 29172 | _bala_ccode_node_unref0 (_tmp783_)((_tmp783_ == ((void*)0)) ? ((void*)0) : (_tmp783_ = (bala_ccode_node_unref (_tmp783_), ((void*)0)))); |
| 29173 | } |
| 29174 | _bala_code_node_unref0 (inst_ma)((inst_ma == ((void*)0)) ? ((void*)0) : (inst_ma = (bala_code_node_unref (inst_ma), ((void*)0)))); |
| 29175 | _bala_target_value_unref0 (typed_inst)((typed_inst == ((void*)0)) ? ((void*)0) : (typed_inst = (bala_target_value_unref (typed_inst), ((void*)0)))); |
| 29176 | _bala_code_node_unref0 (instance_target_type)((instance_target_type == ((void*)0)) ? ((void*)0) : (instance_target_type = (bala_code_node_unref (instance_target_type), ((void*)0))) ); |
| 29177 | _bala_code_node_unref0 (p)((p == ((void*)0)) ? ((void*)0) : (p = (bala_code_node_unref ( p), ((void*)0)))); |
| 29178 | } else { |
| 29179 | BalaMemberInitializer* _tmp784_; |
| 29180 | BalaSourceReference* _tmp785_; |
| 29181 | BalaSourceReference* _tmp786_; |
| 29182 | _tmp784_ = init; |
| 29183 | _tmp785_ = bala_code_node_get_source_reference ((BalaCodeNode*) _tmp784_); |
| 29184 | _tmp786_ = _tmp785_; |
| 29185 | bala_report_error (_tmp786_, "internal: Unsupported symbol"); |
| 29186 | } |
| 29187 | } |
| 29188 | _bala_code_node_unref0 (init)((init == ((void*)0)) ? ((void*)0) : (init = (bala_code_node_unref (init), ((void*)0)))); |
| 29189 | } |
| 29190 | _bala_iterable_unref0 (_init_list)((_init_list == ((void*)0)) ? ((void*)0) : (_init_list = (bala_iterable_unref (_init_list), ((void*)0)))); |
| 29191 | } |
| 29192 | _tmp787_ = instance; |
| 29193 | bala_set_cvalue ((BalaExpression*) expr, _tmp787_); |
| 29194 | } else { |
| 29195 | BalaCCodeExpression* _tmp788_; |
| 29196 | _tmp788_ = creation_expr; |
| 29197 | if (_tmp788_ != NULL((void*)0)) { |
| 29198 | BalaTargetValue* temp_value = NULL((void*)0); |
| 29199 | BalaDataType* _tmp789_; |
| 29200 | BalaDataType* _tmp790_; |
| 29201 | BalaTargetValue* _tmp791_; |
| 29202 | BalaCCodeFunction* _tmp792_; |
| 29203 | BalaCCodeFunction* _tmp793_; |
| 29204 | BalaTargetValue* _tmp794_; |
| 29205 | BalaCCodeExpression* _tmp795_; |
| 29206 | BalaCCodeExpression* _tmp796_; |
| 29207 | BalaTargetValue* _tmp797_; |
| 29208 | BalaClass* cl = NULL((void*)0); |
| 29209 | BalaDataType* _tmp798_; |
| 29210 | BalaDataType* _tmp799_; |
| 29211 | BalaTypeSymbol* _tmp800_; |
| 29212 | BalaTypeSymbol* _tmp801_; |
| 29213 | BalaCodeContext* _tmp802_; |
| 29214 | gboolean _tmp803_; |
| 29215 | gboolean _tmp804_; |
| 29216 | gboolean _tmp849_ = FALSE(0); |
| 29217 | BalaClass* _tmp850_; |
| 29218 | _tmp789_ = bala_expression_get_value_type ((BalaExpression*) expr); |
| 29219 | _tmp790_ = _tmp789_; |
| 29220 | _tmp791_ = bala_ccode_base_module_create_temp_value (self, _tmp790_, FALSE(0), (BalaCodeNode*) expr, NULL((void*)0)); |
| 29221 | temp_value = _tmp791_; |
| 29222 | _tmp792_ = bala_ccode_base_module_get_ccode (self); |
| 29223 | _tmp793_ = _tmp792_; |
| 29224 | _tmp794_ = temp_value; |
| 29225 | _tmp795_ = bala_get_cvalue_ (_tmp794_); |
| 29226 | _tmp796_ = creation_expr; |
| 29227 | bala_ccode_function_add_assignment (_tmp793_, _tmp795_, _tmp796_); |
| 29228 | _tmp797_ = temp_value; |
| 29229 | bala_expression_set_target_value ((BalaExpression*) expr, _tmp797_); |
| 29230 | _tmp798_ = bala_object_creation_expression_get_type_reference (expr); |
| 29231 | _tmp799_ = _tmp798_; |
| 29232 | _tmp800_ = bala_data_type_get_type_symbol (_tmp799_); |
| 29233 | _tmp801_ = _tmp800_; |
| 29234 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp801_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp801_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp801_) : NULL((void*)0); |
| 29235 | _tmp802_ = self->priv->_context; |
| 29236 | _tmp803_ = bala_code_context_get_gobject_tracing (_tmp802_); |
| 29237 | _tmp804_ = _tmp803_; |
| 29238 | if (_tmp804_) { |
| 29239 | gboolean _tmp805_ = FALSE(0); |
| 29240 | BalaClass* _tmp806_; |
| 29241 | _tmp806_ = cl; |
| 29242 | if (_tmp806_ != NULL((void*)0)) { |
| 29243 | BalaClass* _tmp807_; |
| 29244 | BalaTypeSymbol* _tmp808_; |
| 29245 | _tmp807_ = cl; |
| 29246 | _tmp808_ = self->gobject_type; |
| 29247 | _tmp805_ = bala_typesymbol_is_subtype_of ((BalaTypeSymbol*) _tmp807_, _tmp808_); |
| 29248 | } else { |
| 29249 | _tmp805_ = FALSE(0); |
| 29250 | } |
| 29251 | if (_tmp805_) { |
| 29252 | BalaCCodeFunction* _tmp809_; |
| 29253 | BalaCCodeFunction* _tmp810_; |
| 29254 | BalaTargetValue* _tmp811_; |
| 29255 | BalaTargetValue* _tmp812_; |
| 29256 | BalaCCodeExpression* _tmp813_; |
| 29257 | BalaCCodeFunctionCall* set_data_call = NULL((void*)0); |
| 29258 | BalaCCodeIdentifier* _tmp814_; |
| 29259 | BalaCCodeIdentifier* _tmp815_; |
| 29260 | BalaCCodeFunctionCall* _tmp816_; |
| 29261 | BalaCCodeFunctionCall* _tmp817_; |
| 29262 | BalaCCodeFunctionCall* _tmp818_; |
| 29263 | BalaTargetValue* _tmp819_; |
| 29264 | BalaTargetValue* _tmp820_; |
| 29265 | BalaCCodeExpression* _tmp821_; |
| 29266 | BalaCCodeCastExpression* _tmp822_; |
| 29267 | BalaCCodeCastExpression* _tmp823_; |
| 29268 | BalaCCodeFunctionCall* _tmp824_; |
| 29269 | BalaCCodeConstant* _tmp825_; |
| 29270 | BalaCCodeConstant* _tmp826_; |
| 29271 | gchar* func_name = NULL((void*)0); |
| 29272 | gchar* _tmp827_; |
| 29273 | BalaMethod* _tmp828_; |
| 29274 | BalaMethod* _tmp829_; |
| 29275 | BalaCCodeFunctionCall* _tmp838_; |
| 29276 | const gchar* _tmp839_; |
| 29277 | gchar* _tmp840_; |
| 29278 | gchar* _tmp841_; |
| 29279 | BalaCCodeConstant* _tmp842_; |
| 29280 | BalaCCodeConstant* _tmp843_; |
| 29281 | BalaCCodeFunction* _tmp844_; |
| 29282 | BalaCCodeFunction* _tmp845_; |
| 29283 | BalaCCodeFunctionCall* _tmp846_; |
| 29284 | BalaCCodeFunction* _tmp847_; |
| 29285 | BalaCCodeFunction* _tmp848_; |
| 29286 | _tmp809_ = bala_ccode_base_module_get_ccode (self); |
| 29287 | _tmp810_ = _tmp809_; |
| 29288 | _tmp811_ = bala_expression_get_target_value ((BalaExpression*) expr); |
| 29289 | _tmp812_ = _tmp811_; |
| 29290 | _tmp813_ = bala_get_cvalue_ (_tmp812_); |
| 29291 | bala_ccode_function_open_if (_tmp810_, _tmp813_); |
| 29292 | _tmp814_ = bala_ccode_identifier_new ("g_object_set_data"); |
| 29293 | _tmp815_ = _tmp814_; |
| 29294 | _tmp816_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp815_); |
| 29295 | _tmp817_ = _tmp816_; |
| 29296 | _bala_ccode_node_unref0 (_tmp815_)((_tmp815_ == ((void*)0)) ? ((void*)0) : (_tmp815_ = (bala_ccode_node_unref (_tmp815_), ((void*)0)))); |
| 29297 | set_data_call = _tmp817_; |
| 29298 | _tmp818_ = set_data_call; |
| 29299 | _tmp819_ = bala_expression_get_target_value ((BalaExpression*) expr); |
| 29300 | _tmp820_ = _tmp819_; |
| 29301 | _tmp821_ = bala_get_cvalue_ (_tmp820_); |
| 29302 | _tmp822_ = bala_ccode_cast_expression_new (_tmp821_, "GObject *"); |
| 29303 | _tmp823_ = _tmp822_; |
| 29304 | bala_ccode_function_call_add_argument (_tmp818_, (BalaCCodeExpression*) _tmp823_); |
| 29305 | _bala_ccode_node_unref0 (_tmp823_)((_tmp823_ == ((void*)0)) ? ((void*)0) : (_tmp823_ = (bala_ccode_node_unref (_tmp823_), ((void*)0)))); |
| 29306 | _tmp824_ = set_data_call; |
| 29307 | _tmp825_ = bala_ccode_constant_new ("\"bala-creation-function\""); |
| 29308 | _tmp826_ = _tmp825_; |
| 29309 | bala_ccode_function_call_add_argument (_tmp824_, (BalaCCodeExpression*) _tmp826_); |
| 29310 | _bala_ccode_node_unref0 (_tmp826_)((_tmp826_ == ((void*)0)) ? ((void*)0) : (_tmp826_ = (bala_ccode_node_unref (_tmp826_), ((void*)0)))); |
| 29311 | _tmp827_ = g_strdup (""); |
| 29312 | func_name = _tmp827_; |
| 29313 | _tmp828_ = bala_ccode_base_module_get_current_method (self); |
| 29314 | _tmp829_ = _tmp828_; |
| 29315 | if (_tmp829_ != NULL((void*)0)) { |
| 29316 | BalaMethod* _tmp830_; |
| 29317 | BalaMethod* _tmp831_; |
| 29318 | gchar* _tmp832_; |
| 29319 | _tmp830_ = bala_ccode_base_module_get_current_method (self); |
| 29320 | _tmp831_ = _tmp830_; |
| 29321 | _tmp832_ = bala_symbol_get_full_name ((BalaSymbol*) _tmp831_); |
| 29322 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 29323 | func_name = _tmp832_; |
| 29324 | } else { |
| 29325 | BalaPropertyAccessor* _tmp833_; |
| 29326 | BalaPropertyAccessor* _tmp834_; |
| 29327 | _tmp833_ = bala_ccode_base_module_get_current_property_accessor (self); |
| 29328 | _tmp834_ = _tmp833_; |
| 29329 | if (_tmp834_ != NULL((void*)0)) { |
| 29330 | BalaPropertyAccessor* _tmp835_; |
| 29331 | BalaPropertyAccessor* _tmp836_; |
| 29332 | gchar* _tmp837_; |
| 29333 | _tmp835_ = bala_ccode_base_module_get_current_property_accessor (self); |
| 29334 | _tmp836_ = _tmp835_; |
| 29335 | _tmp837_ = bala_symbol_get_full_name ((BalaSymbol*) _tmp836_); |
| 29336 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 29337 | func_name = _tmp837_; |
| 29338 | } |
| 29339 | } |
| 29340 | _tmp838_ = set_data_call; |
| 29341 | _tmp839_ = func_name; |
| 29342 | _tmp840_ = g_strdup_printf ("\"%s\"", _tmp839_); |
| 29343 | _tmp841_ = _tmp840_; |
| 29344 | _tmp842_ = bala_ccode_constant_new (_tmp841_); |
| 29345 | _tmp843_ = _tmp842_; |
| 29346 | bala_ccode_function_call_add_argument (_tmp838_, (BalaCCodeExpression*) _tmp843_); |
| 29347 | _bala_ccode_node_unref0 (_tmp843_)((_tmp843_ == ((void*)0)) ? ((void*)0) : (_tmp843_ = (bala_ccode_node_unref (_tmp843_), ((void*)0)))); |
| 29348 | _g_free0 (_tmp841_)(_tmp841_ = (g_free (_tmp841_), ((void*)0))); |
| 29349 | _tmp844_ = bala_ccode_base_module_get_ccode (self); |
| 29350 | _tmp845_ = _tmp844_; |
| 29351 | _tmp846_ = set_data_call; |
| 29352 | bala_ccode_function_add_expression (_tmp845_, (BalaCCodeExpression*) _tmp846_); |
| 29353 | _tmp847_ = bala_ccode_base_module_get_ccode (self); |
| 29354 | _tmp848_ = _tmp847_; |
| 29355 | bala_ccode_function_close (_tmp848_); |
| 29356 | _g_free0 (func_name)(func_name = (g_free (func_name), ((void*)0))); |
| 29357 | _bala_ccode_node_unref0 (set_data_call)((set_data_call == ((void*)0)) ? ((void*)0) : (set_data_call = (bala_ccode_node_unref (set_data_call), ((void*)0)))); |
| 29358 | } |
| 29359 | } |
| 29360 | _tmp850_ = cl; |
| 29361 | if (_tmp850_ != NULL((void*)0)) { |
| 29362 | BalaClass* _tmp851_; |
| 29363 | BalaTypeSymbol* _tmp852_; |
| 29364 | _tmp851_ = cl; |
| 29365 | _tmp852_ = self->garray_type; |
| 29366 | _tmp849_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp851_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp851_), ((bala_typesymbol_get_type ()))))) == _tmp852_; |
| 29367 | } else { |
| 29368 | _tmp849_ = FALSE(0); |
| 29369 | } |
| 29370 | if (_tmp849_) { |
| 29371 | BalaDataType* type_arg = NULL((void*)0); |
| 29372 | BalaDataType* _tmp853_; |
| 29373 | BalaDataType* _tmp854_; |
| 29374 | BalaList* _tmp855_; |
| 29375 | gpointer _tmp856_; |
| 29376 | BalaDataType* _tmp857_; |
| 29377 | _tmp853_ = bala_object_creation_expression_get_type_reference (expr); |
| 29378 | _tmp854_ = _tmp853_; |
| 29379 | _tmp855_ = bala_data_type_get_type_arguments (_tmp854_); |
| 29380 | _tmp856_ = bala_list_get (_tmp855_, 0); |
| 29381 | type_arg = (BalaDataType*) _tmp856_; |
| 29382 | _tmp857_ = type_arg; |
| 29383 | if (bala_ccode_base_module_requires_destroy (_tmp857_)) { |
| 29384 | BalaCCodeFunctionCall* clear_func = NULL((void*)0); |
| 29385 | BalaCCodeIdentifier* _tmp858_; |
| 29386 | BalaCCodeIdentifier* _tmp859_; |
| 29387 | BalaCCodeFunctionCall* _tmp860_; |
| 29388 | BalaCCodeFunctionCall* _tmp861_; |
| 29389 | BalaCCodeFunctionCall* _tmp862_; |
| 29390 | BalaTargetValue* _tmp863_; |
| 29391 | BalaTargetValue* _tmp864_; |
| 29392 | BalaCCodeExpression* _tmp865_; |
| 29393 | gchar* destroy_func = NULL((void*)0); |
| 29394 | gboolean _tmp866_ = FALSE(0); |
| 29395 | BalaDataType* _tmp867_; |
| 29396 | BalaCCodeFunctionCall* _tmp875_; |
| 29397 | const gchar* _tmp876_; |
| 29398 | BalaCCodeIdentifier* _tmp877_; |
| 29399 | BalaCCodeIdentifier* _tmp878_; |
| 29400 | BalaCCodeCastExpression* _tmp879_; |
| 29401 | BalaCCodeCastExpression* _tmp880_; |
| 29402 | BalaCCodeFunction* _tmp881_; |
| 29403 | BalaCCodeFunction* _tmp882_; |
| 29404 | BalaCCodeFunctionCall* _tmp883_; |
| 29405 | _tmp858_ = bala_ccode_identifier_new ("g_array_set_clear_func"); |
| 29406 | _tmp859_ = _tmp858_; |
| 29407 | _tmp860_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp859_); |
| 29408 | _tmp861_ = _tmp860_; |
| 29409 | _bala_ccode_node_unref0 (_tmp859_)((_tmp859_ == ((void*)0)) ? ((void*)0) : (_tmp859_ = (bala_ccode_node_unref (_tmp859_), ((void*)0)))); |
| 29410 | clear_func = _tmp861_; |
| 29411 | _tmp862_ = clear_func; |
| 29412 | _tmp863_ = bala_expression_get_target_value ((BalaExpression*) expr); |
| 29413 | _tmp864_ = _tmp863_; |
| 29414 | _tmp865_ = bala_get_cvalue_ (_tmp864_); |
| 29415 | bala_ccode_function_call_add_argument (_tmp862_, _tmp865_); |
| 29416 | _tmp867_ = type_arg; |
| 29417 | if (bala_data_type_is_non_null_simple_type (_tmp867_)) { |
| 29418 | _tmp866_ = TRUE(!(0)); |
| 29419 | } else { |
| 29420 | BalaDataType* _tmp868_; |
| 29421 | _tmp868_ = type_arg; |
| 29422 | _tmp866_ = bala_data_type_is_real_non_null_struct_type (_tmp868_); |
| 29423 | } |
| 29424 | if (_tmp866_) { |
| 29425 | BalaDataType* _tmp869_; |
| 29426 | BalaTypeSymbol* _tmp870_; |
| 29427 | BalaTypeSymbol* _tmp871_; |
| 29428 | gchar* _tmp872_; |
| 29429 | _tmp869_ = type_arg; |
| 29430 | _tmp870_ = bala_data_type_get_type_symbol (_tmp869_); |
| 29431 | _tmp871_ = _tmp870_; |
| 29432 | _tmp872_ = bala_get_ccode_destroy_function (_tmp871_); |
| 29433 | _g_free0 (destroy_func)(destroy_func = (g_free (destroy_func), ((void*)0))); |
| 29434 | destroy_func = _tmp872_; |
| 29435 | } else { |
| 29436 | BalaDataType* _tmp873_; |
| 29437 | gchar* _tmp874_; |
| 29438 | _tmp873_ = type_arg; |
| 29439 | _tmp874_ = bala_ccode_base_module_generate_destroy_function_content_of_wrapper (self, _tmp873_); |
| 29440 | _g_free0 (destroy_func)(destroy_func = (g_free (destroy_func), ((void*)0))); |
| 29441 | destroy_func = _tmp874_; |
| 29442 | } |
| 29443 | _tmp875_ = clear_func; |
| 29444 | _tmp876_ = destroy_func; |
| 29445 | _tmp877_ = bala_ccode_identifier_new (_tmp876_); |
| 29446 | _tmp878_ = _tmp877_; |
| 29447 | _tmp879_ = bala_ccode_cast_expression_new ((BalaCCodeExpression*) _tmp878_, "GDestroyNotify"); |
| 29448 | _tmp880_ = _tmp879_; |
| 29449 | bala_ccode_function_call_add_argument (_tmp875_, (BalaCCodeExpression*) _tmp880_); |
| 29450 | _bala_ccode_node_unref0 (_tmp880_)((_tmp880_ == ((void*)0)) ? ((void*)0) : (_tmp880_ = (bala_ccode_node_unref (_tmp880_), ((void*)0)))); |
| 29451 | _bala_ccode_node_unref0 (_tmp878_)((_tmp878_ == ((void*)0)) ? ((void*)0) : (_tmp878_ = (bala_ccode_node_unref (_tmp878_), ((void*)0)))); |
| 29452 | _tmp881_ = bala_ccode_base_module_get_ccode (self); |
| 29453 | _tmp882_ = _tmp881_; |
| 29454 | _tmp883_ = clear_func; |
| 29455 | bala_ccode_function_add_expression (_tmp882_, (BalaCCodeExpression*) _tmp883_); |
| 29456 | _g_free0 (destroy_func)(destroy_func = (g_free (destroy_func), ((void*)0))); |
| 29457 | _bala_ccode_node_unref0 (clear_func)((clear_func == ((void*)0)) ? ((void*)0) : (clear_func = (bala_ccode_node_unref (clear_func), ((void*)0)))); |
| 29458 | } |
| 29459 | _bala_code_node_unref0 (type_arg)((type_arg == ((void*)0)) ? ((void*)0) : (type_arg = (bala_code_node_unref (type_arg), ((void*)0)))); |
| 29460 | } |
| 29461 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 29462 | } |
| 29463 | } |
| 29464 | } |
| 29465 | _tmp884_ = bala_expression_get_target_value ((BalaExpression*) expr); |
| 29466 | _tmp885_ = _tmp884_; |
| 29467 | G_TYPE_CHECK_INSTANCE_CAST (_tmp885_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp885_), ((bala_glib_value_get_type ())))))->lvalue = TRUE(!(0)); |
| 29468 | _bala_code_node_unref0 (local)((local == ((void*)0)) ? ((void*)0) : (local = (bala_code_node_unref (local), ((void*)0)))); |
| 29469 | _bala_ccode_node_unref0 (creation_expr)((creation_expr == ((void*)0)) ? ((void*)0) : (creation_expr = (bala_ccode_node_unref (creation_expr), ((void*)0)))); |
| 29470 | _bala_ccode_node_unref0 (instance)((instance == ((void*)0)) ? ((void*)0) : (instance = (bala_ccode_node_unref (instance), ((void*)0)))); |
| 29471 | } |
| 29472 | |
| 29473 | BalaCCodeExpression* |
| 29474 | bala_ccode_base_module_handle_struct_argument (BalaCCodeBaseModule* self, |
| 29475 | BalaParameter* param, |
| 29476 | BalaExpression* arg, |
| 29477 | BalaCCodeExpression* cexpr) |
| 29478 | { |
| 29479 | BalaDataType* type = NULL((void*)0); |
| 29480 | BalaUnaryExpression* unary = NULL((void*)0); |
| 29481 | BalaUnaryExpression* _tmp6_; |
| 29482 | gboolean _tmp7_ = FALSE(0); |
| 29483 | BalaDataType* _tmp8_; |
| 29484 | BalaDataType* _tmp9_; |
| 29485 | BalaCCodeExpression* _tmp35_; |
| 29486 | BalaCCodeExpression* result = NULL((void*)0); |
| 29487 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 29488 | g_return_val_if_fail (arg != NULL, NULL)do { if ((arg != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "arg != NULL") ; return (((void*)0)); } } while (0); |
| 29489 | if (param != NULL((void*)0)) { |
| 29490 | BalaDataType* _tmp0_; |
| 29491 | BalaDataType* _tmp1_; |
| 29492 | BalaDataType* _tmp2_; |
| 29493 | _tmp0_ = bala_variable_get_variable_type ((BalaVariable*) param); |
| 29494 | _tmp1_ = _tmp0_; |
| 29495 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 29496 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 29497 | type = _tmp2_; |
| 29498 | } else { |
| 29499 | BalaDataType* _tmp3_; |
| 29500 | BalaDataType* _tmp4_; |
| 29501 | BalaDataType* _tmp5_; |
| 29502 | _tmp3_ = bala_expression_get_value_type (arg); |
| 29503 | _tmp4_ = _tmp3_; |
| 29504 | _tmp5_ = _bala_code_node_ref0 (_tmp4_); |
| 29505 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 29506 | type = _tmp5_; |
| 29507 | } |
| 29508 | _tmp6_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (arg, BALA_TYPE_UNARY_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( arg); GType __t = ((bala_unary_expression_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaUnaryExpression*) arg) : NULL((void*)0)); |
| 29509 | unary = _tmp6_; |
| 29510 | _tmp8_ = bala_expression_get_value_type (arg); |
| 29511 | _tmp9_ = _tmp8_; |
| 29512 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, BALA_TYPE_NULL_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp9_); GType __t = ((bala_null_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 29513 | BalaDataType* _tmp10_; |
| 29514 | _tmp10_ = type; |
| 29515 | _tmp7_ = bala_data_type_is_real_struct_type (_tmp10_); |
| 29516 | } else { |
| 29517 | _tmp7_ = FALSE(0); |
| 29518 | } |
| 29519 | if (_tmp7_) { |
| 29520 | gboolean _tmp11_ = FALSE(0); |
| 29521 | gboolean _tmp12_ = FALSE(0); |
| 29522 | BalaUnaryExpression* _tmp13_; |
| 29523 | _tmp13_ = unary; |
| 29524 | if (_tmp13_ != NULL((void*)0)) { |
| 29525 | gboolean _tmp14_ = FALSE(0); |
| 29526 | BalaUnaryExpression* _tmp15_; |
| 29527 | BalaUnaryOperator _tmp16_; |
| 29528 | BalaUnaryOperator _tmp17_; |
| 29529 | _tmp15_ = unary; |
| 29530 | _tmp16_ = bala_unary_expression_get_operator (_tmp15_); |
| 29531 | _tmp17_ = _tmp16_; |
| 29532 | if (_tmp17_ == BALA_UNARY_OPERATOR_OUT) { |
| 29533 | _tmp14_ = TRUE(!(0)); |
| 29534 | } else { |
| 29535 | BalaUnaryExpression* _tmp18_; |
| 29536 | BalaUnaryOperator _tmp19_; |
| 29537 | BalaUnaryOperator _tmp20_; |
| 29538 | _tmp18_ = unary; |
| 29539 | _tmp19_ = bala_unary_expression_get_operator (_tmp18_); |
| 29540 | _tmp20_ = _tmp19_; |
| 29541 | _tmp14_ = _tmp20_ == BALA_UNARY_OPERATOR_REF; |
| 29542 | } |
| 29543 | _tmp12_ = _tmp14_; |
| 29544 | } else { |
| 29545 | _tmp12_ = FALSE(0); |
| 29546 | } |
| 29547 | if (!_tmp12_) { |
| 29548 | BalaDataType* _tmp21_; |
| 29549 | gboolean _tmp22_; |
| 29550 | gboolean _tmp23_; |
| 29551 | _tmp21_ = type; |
| 29552 | _tmp22_ = bala_data_type_get_nullable (_tmp21_); |
| 29553 | _tmp23_ = _tmp22_; |
| 29554 | _tmp11_ = !_tmp23_; |
| 29555 | } else { |
| 29556 | _tmp11_ = FALSE(0); |
| 29557 | } |
| 29558 | if (_tmp11_) { |
| 29559 | gboolean _tmp24_ = FALSE(0); |
| 29560 | if (G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_IDENTIFIER)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_identifier_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 29561 | _tmp24_ = TRUE(!(0)); |
| 29562 | } else { |
| 29563 | _tmp24_ = G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_MEMBER_ACCESS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_member_access_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } ))); |
| 29564 | } |
| 29565 | if (_tmp24_) { |
| 29566 | BalaCCodeUnaryExpression* _tmp25_; |
| 29567 | _tmp25_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, cexpr); |
| 29568 | result = (BalaCCodeExpression*) _tmp25_; |
| 29569 | _bala_code_node_unref0 (unary)((unary == ((void*)0)) ? ((void*)0) : (unary = (bala_code_node_unref (unary), ((void*)0)))); |
| 29570 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 29571 | return result; |
| 29572 | } else { |
| 29573 | BalaTargetValue* temp_value = NULL((void*)0); |
| 29574 | BalaDataType* _tmp26_; |
| 29575 | BalaTargetValue* _tmp27_; |
| 29576 | BalaCCodeFunction* _tmp28_; |
| 29577 | BalaCCodeFunction* _tmp29_; |
| 29578 | BalaTargetValue* _tmp30_; |
| 29579 | BalaCCodeExpression* _tmp31_; |
| 29580 | BalaTargetValue* _tmp32_; |
| 29581 | BalaCCodeExpression* _tmp33_; |
| 29582 | BalaCCodeUnaryExpression* _tmp34_; |
| 29583 | _tmp26_ = type; |
| 29584 | _tmp27_ = bala_ccode_base_module_create_temp_value (self, _tmp26_, FALSE(0), (BalaCodeNode*) arg, NULL((void*)0)); |
| 29585 | temp_value = _tmp27_; |
| 29586 | _tmp28_ = bala_ccode_base_module_get_ccode (self); |
| 29587 | _tmp29_ = _tmp28_; |
| 29588 | _tmp30_ = temp_value; |
| 29589 | _tmp31_ = bala_get_cvalue_ (_tmp30_); |
| 29590 | bala_ccode_function_add_assignment (_tmp29_, _tmp31_, cexpr); |
| 29591 | _tmp32_ = temp_value; |
| 29592 | _tmp33_ = bala_get_cvalue_ (_tmp32_); |
| 29593 | _tmp34_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp33_); |
| 29594 | result = (BalaCCodeExpression*) _tmp34_; |
| 29595 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 29596 | _bala_code_node_unref0 (unary)((unary == ((void*)0)) ? ((void*)0) : (unary = (bala_code_node_unref (unary), ((void*)0)))); |
| 29597 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 29598 | return result; |
| 29599 | } |
| 29600 | } |
| 29601 | } |
| 29602 | _tmp35_ = _bala_ccode_node_ref0 (cexpr); |
| 29603 | result = _tmp35_; |
| 29604 | _bala_code_node_unref0 (unary)((unary == ((void*)0)) ? ((void*)0) : (unary = (bala_code_node_unref (unary), ((void*)0)))); |
| 29605 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 29606 | return result; |
| 29607 | } |
| 29608 | |
| 29609 | static void |
| 29610 | bala_ccode_base_module_real_visit_sizeof_expression (BalaCodeVisitor* base, |
| 29611 | BalaSizeofExpression* expr) |
| 29612 | { |
| 29613 | BalaCCodeBaseModule * self; |
| 29614 | BalaDataType* _tmp0_; |
| 29615 | BalaDataType* _tmp1_; |
| 29616 | BalaCCodeFile* _tmp2_; |
| 29617 | BalaCCodeFunctionCall* csizeof = NULL((void*)0); |
| 29618 | BalaCCodeIdentifier* _tmp3_; |
| 29619 | BalaCCodeIdentifier* _tmp4_; |
| 29620 | BalaCCodeFunctionCall* _tmp5_; |
| 29621 | BalaCCodeFunctionCall* _tmp6_; |
| 29622 | BalaDataType* _tmp7_; |
| 29623 | BalaDataType* _tmp8_; |
| 29624 | gchar* _tmp9_; |
| 29625 | gchar* _tmp10_; |
| 29626 | BalaCCodeIdentifier* _tmp11_; |
| 29627 | BalaCCodeIdentifier* _tmp12_; |
| 29628 | self = (BalaCCodeBaseModule*) base; |
| 29629 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 29630 | _tmp0_ = bala_sizeof_expression_get_type_reference (expr); |
| 29631 | _tmp1_ = _tmp0_; |
| 29632 | _tmp2_ = self->cfile; |
| 29633 | bala_ccode_base_module_generate_type_declaration (self, _tmp1_, _tmp2_); |
| 29634 | _tmp3_ = bala_ccode_identifier_new ("sizeof"); |
| 29635 | _tmp4_ = _tmp3_; |
| 29636 | _tmp5_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp4_); |
| 29637 | _tmp6_ = _tmp5_; |
| 29638 | _bala_ccode_node_unref0 (_tmp4_)((_tmp4_ == ((void*)0)) ? ((void*)0) : (_tmp4_ = (bala_ccode_node_unref (_tmp4_), ((void*)0)))); |
| 29639 | csizeof = _tmp6_; |
| 29640 | _tmp7_ = bala_sizeof_expression_get_type_reference (expr); |
| 29641 | _tmp8_ = _tmp7_; |
| 29642 | _tmp9_ = bala_get_ccode_name ((BalaCodeNode*) _tmp8_); |
| 29643 | _tmp10_ = _tmp9_; |
| 29644 | _tmp11_ = bala_ccode_identifier_new (_tmp10_); |
| 29645 | _tmp12_ = _tmp11_; |
| 29646 | bala_ccode_function_call_add_argument (csizeof, (BalaCCodeExpression*) _tmp12_); |
| 29647 | _bala_ccode_node_unref0 (_tmp12_)((_tmp12_ == ((void*)0)) ? ((void*)0) : (_tmp12_ = (bala_ccode_node_unref (_tmp12_), ((void*)0)))); |
| 29648 | _g_free0 (_tmp10_)(_tmp10_ = (g_free (_tmp10_), ((void*)0))); |
| 29649 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) csizeof); |
| 29650 | _bala_ccode_node_unref0 (csizeof)((csizeof == ((void*)0)) ? ((void*)0) : (csizeof = (bala_ccode_node_unref (csizeof), ((void*)0)))); |
| 29651 | } |
| 29652 | |
| 29653 | static void |
| 29654 | bala_ccode_base_module_real_visit_typeof_expression (BalaCodeVisitor* base, |
| 29655 | BalaTypeofExpression* expr) |
| 29656 | { |
| 29657 | BalaCCodeBaseModule * self; |
| 29658 | BalaCCodeFile* _tmp0_; |
| 29659 | BalaDataType* _tmp1_; |
| 29660 | BalaDataType* _tmp2_; |
| 29661 | BalaCCodeExpression* _tmp3_; |
| 29662 | BalaCCodeExpression* _tmp4_; |
| 29663 | self = (BalaCCodeBaseModule*) base; |
| 29664 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 29665 | _tmp0_ = self->cfile; |
| 29666 | bala_ccode_file_add_include (_tmp0_, "glib-object.h", FALSE(0)); |
| 29667 | _tmp1_ = bala_typeof_expression_get_type_reference (expr); |
| 29668 | _tmp2_ = _tmp1_; |
| 29669 | _tmp3_ = bala_ccode_base_module_get_type_id_expression (self, _tmp2_, FALSE(0)); |
| 29670 | _tmp4_ = _tmp3_; |
| 29671 | bala_set_cvalue ((BalaExpression*) expr, _tmp4_); |
| 29672 | _bala_ccode_node_unref0 (_tmp4_)((_tmp4_ == ((void*)0)) ? ((void*)0) : (_tmp4_ = (bala_ccode_node_unref (_tmp4_), ((void*)0)))); |
| 29673 | } |
| 29674 | |
| 29675 | static void |
| 29676 | bala_ccode_base_module_real_visit_unary_expression (BalaCodeVisitor* base, |
| 29677 | BalaUnaryExpression* expr) |
| 29678 | { |
| 29679 | BalaCCodeBaseModule * self; |
| 29680 | gboolean _tmp0_ = FALSE(0); |
| 29681 | BalaUnaryOperator _tmp1_; |
| 29682 | BalaUnaryOperator _tmp2_; |
| 29683 | gboolean _tmp66_ = FALSE(0); |
| 29684 | BalaUnaryOperator _tmp67_; |
| 29685 | BalaUnaryOperator _tmp68_; |
| 29686 | BalaCCodeUnaryOperator op = 0; |
| 29687 | BalaUnaryOperator _tmp109_; |
| 29688 | BalaUnaryOperator _tmp110_; |
| 29689 | BalaCCodeUnaryOperator _tmp111_; |
| 29690 | BalaExpression* _tmp112_; |
| 29691 | BalaExpression* _tmp113_; |
| 29692 | BalaCCodeExpression* _tmp114_; |
| 29693 | BalaCCodeUnaryExpression* _tmp115_; |
| 29694 | BalaCCodeUnaryExpression* _tmp116_; |
| 29695 | self = (BalaCCodeBaseModule*) base; |
| 29696 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 29697 | _tmp1_ = bala_unary_expression_get_operator (expr); |
| 29698 | _tmp2_ = _tmp1_; |
| 29699 | if (_tmp2_ == BALA_UNARY_OPERATOR_REF) { |
| 29700 | _tmp0_ = TRUE(!(0)); |
| 29701 | } else { |
| 29702 | BalaUnaryOperator _tmp3_; |
| 29703 | BalaUnaryOperator _tmp4_; |
| 29704 | _tmp3_ = bala_unary_expression_get_operator (expr); |
| 29705 | _tmp4_ = _tmp3_; |
| 29706 | _tmp0_ = _tmp4_ == BALA_UNARY_OPERATOR_OUT; |
| 29707 | } |
| 29708 | if (_tmp0_) { |
| 29709 | BalaGLibValue* glib_value = NULL((void*)0); |
| 29710 | BalaExpression* _tmp5_; |
| 29711 | BalaExpression* _tmp6_; |
| 29712 | BalaTargetValue* _tmp7_; |
| 29713 | BalaTargetValue* _tmp8_; |
| 29714 | BalaGLibValue* _tmp9_; |
| 29715 | BalaGLibValue* ref_value = NULL((void*)0); |
| 29716 | BalaGLibValue* _tmp10_; |
| 29717 | BalaDataType* _tmp11_; |
| 29718 | BalaDataType* _tmp12_; |
| 29719 | BalaGLibValue* _tmp13_; |
| 29720 | gboolean _tmp14_ = FALSE(0); |
| 29721 | gboolean _tmp15_ = FALSE(0); |
| 29722 | BalaDataType* _tmp16_; |
| 29723 | BalaDataType* _tmp17_; |
| 29724 | BalaGLibValue* _tmp38_; |
| 29725 | BalaList* _tmp39_; |
| 29726 | BalaGLibValue* _tmp53_; |
| 29727 | BalaCCodeExpression* _tmp54_; |
| 29728 | BalaGLibValue* _tmp59_; |
| 29729 | BalaCCodeExpression* _tmp60_; |
| 29730 | BalaGLibValue* _tmp65_; |
| 29731 | _tmp5_ = bala_unary_expression_get_inner (expr); |
| 29732 | _tmp6_ = _tmp5_; |
| 29733 | _tmp7_ = bala_expression_get_target_value (_tmp6_); |
| 29734 | _tmp8_ = _tmp7_; |
| 29735 | _tmp9_ = _bala_target_value_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp8_), ((bala_glib_value_get_type ())))))); |
| 29736 | glib_value = _tmp9_; |
| 29737 | _tmp10_ = glib_value; |
| 29738 | _tmp11_ = bala_target_value_get_value_type ((BalaTargetValue*) _tmp10_); |
| 29739 | _tmp12_ = _tmp11_; |
| 29740 | _tmp13_ = bala_glib_value_new (_tmp12_, NULL((void*)0), FALSE(0)); |
| 29741 | ref_value = _tmp13_; |
| 29742 | _tmp16_ = bala_expression_get_target_type ((BalaExpression*) expr); |
| 29743 | _tmp17_ = _tmp16_; |
| 29744 | if (_tmp17_ != NULL((void*)0)) { |
| 29745 | BalaGLibValue* _tmp18_; |
| 29746 | BalaDataType* _tmp19_; |
| 29747 | BalaDataType* _tmp20_; |
| 29748 | _tmp18_ = glib_value; |
| 29749 | _tmp19_ = bala_target_value_get_value_type ((BalaTargetValue*) _tmp18_); |
| 29750 | _tmp20_ = _tmp19_; |
| 29751 | _tmp15_ = bala_data_type_is_real_struct_type (_tmp20_); |
| 29752 | } else { |
| 29753 | _tmp15_ = FALSE(0); |
| 29754 | } |
| 29755 | if (_tmp15_) { |
| 29756 | BalaGLibValue* _tmp21_; |
| 29757 | BalaDataType* _tmp22_; |
| 29758 | BalaDataType* _tmp23_; |
| 29759 | gboolean _tmp24_; |
| 29760 | gboolean _tmp25_; |
| 29761 | BalaDataType* _tmp26_; |
| 29762 | BalaDataType* _tmp27_; |
| 29763 | gboolean _tmp28_; |
| 29764 | gboolean _tmp29_; |
| 29765 | _tmp21_ = glib_value; |
| 29766 | _tmp22_ = bala_target_value_get_value_type ((BalaTargetValue*) _tmp21_); |
| 29767 | _tmp23_ = _tmp22_; |
| 29768 | _tmp24_ = bala_data_type_get_nullable (_tmp23_); |
| 29769 | _tmp25_ = _tmp24_; |
| 29770 | _tmp26_ = bala_expression_get_target_type ((BalaExpression*) expr); |
| 29771 | _tmp27_ = _tmp26_; |
| 29772 | _tmp28_ = bala_data_type_get_nullable (_tmp27_); |
| 29773 | _tmp29_ = _tmp28_; |
| 29774 | _tmp14_ = _tmp25_ != _tmp29_; |
| 29775 | } else { |
| 29776 | _tmp14_ = FALSE(0); |
| 29777 | } |
| 29778 | if (_tmp14_) { |
| 29779 | BalaGLibValue* _tmp30_; |
| 29780 | BalaGLibValue* _tmp31_; |
| 29781 | BalaCCodeExpression* _tmp32_; |
| 29782 | BalaCCodeExpression* _tmp33_; |
| 29783 | _tmp30_ = ref_value; |
| 29784 | _tmp31_ = glib_value; |
| 29785 | _tmp32_ = _tmp31_->cvalue; |
| 29786 | _tmp33_ = _bala_ccode_node_ref0 (_tmp32_); |
| 29787 | _bala_ccode_node_unref0 (_tmp30_->cvalue)((_tmp30_->cvalue == ((void*)0)) ? ((void*)0) : (_tmp30_-> cvalue = (bala_ccode_node_unref (_tmp30_->cvalue), ((void* )0)))); |
| 29788 | _tmp30_->cvalue = _tmp33_; |
| 29789 | } else { |
| 29790 | BalaGLibValue* _tmp34_; |
| 29791 | BalaGLibValue* _tmp35_; |
| 29792 | BalaCCodeExpression* _tmp36_; |
| 29793 | BalaCCodeUnaryExpression* _tmp37_; |
| 29794 | _tmp34_ = ref_value; |
| 29795 | _tmp35_ = glib_value; |
| 29796 | _tmp36_ = _tmp35_->cvalue; |
| 29797 | _tmp37_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp36_); |
| 29798 | _bala_ccode_node_unref0 (_tmp34_->cvalue)((_tmp34_->cvalue == ((void*)0)) ? ((void*)0) : (_tmp34_-> cvalue = (bala_ccode_node_unref (_tmp34_->cvalue), ((void* )0)))); |
| 29799 | _tmp34_->cvalue = (BalaCCodeExpression*) _tmp37_; |
| 29800 | } |
| 29801 | _tmp38_ = glib_value; |
| 29802 | _tmp39_ = _tmp38_->array_length_cvalues; |
| 29803 | if (_tmp39_ != NULL((void*)0)) { |
| 29804 | { |
| 29805 | gint i = 0; |
| 29806 | i = 0; |
| 29807 | { |
| 29808 | gboolean _tmp40_ = FALSE(0); |
| 29809 | _tmp40_ = TRUE(!(0)); |
| 29810 | while (TRUE(!(0))) { |
| 29811 | BalaGLibValue* _tmp42_; |
| 29812 | BalaList* _tmp43_; |
| 29813 | gint _tmp44_; |
| 29814 | gint _tmp45_; |
| 29815 | BalaGLibValue* _tmp46_; |
| 29816 | BalaGLibValue* _tmp47_; |
| 29817 | BalaList* _tmp48_; |
| 29818 | gpointer _tmp49_; |
| 29819 | BalaCCodeExpression* _tmp50_; |
| 29820 | BalaCCodeUnaryExpression* _tmp51_; |
| 29821 | BalaCCodeUnaryExpression* _tmp52_; |
| 29822 | if (!_tmp40_) { |
| 29823 | gint _tmp41_; |
| 29824 | _tmp41_ = i; |
| 29825 | i = _tmp41_ + 1; |
| 29826 | } |
| 29827 | _tmp40_ = FALSE(0); |
| 29828 | _tmp42_ = glib_value; |
| 29829 | _tmp43_ = _tmp42_->array_length_cvalues; |
| 29830 | _tmp44_ = bala_collection_get_size ((BalaCollection*) _tmp43_); |
| 29831 | _tmp45_ = _tmp44_; |
| 29832 | if (!(i < _tmp45_)) { |
| 29833 | break; |
| 29834 | } |
| 29835 | _tmp46_ = ref_value; |
| 29836 | _tmp47_ = glib_value; |
| 29837 | _tmp48_ = _tmp47_->array_length_cvalues; |
| 29838 | _tmp49_ = bala_list_get (_tmp48_, i); |
| 29839 | _tmp50_ = (BalaCCodeExpression*) _tmp49_; |
| 29840 | _tmp51_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp50_); |
| 29841 | _tmp52_ = _tmp51_; |
| 29842 | bala_glib_value_append_array_length_cvalue (_tmp46_, (BalaCCodeExpression*) _tmp52_); |
| 29843 | _bala_ccode_node_unref0 (_tmp52_)((_tmp52_ == ((void*)0)) ? ((void*)0) : (_tmp52_ = (bala_ccode_node_unref (_tmp52_), ((void*)0)))); |
| 29844 | _bala_ccode_node_unref0 (_tmp50_)((_tmp50_ == ((void*)0)) ? ((void*)0) : (_tmp50_ = (bala_ccode_node_unref (_tmp50_), ((void*)0)))); |
| 29845 | } |
| 29846 | } |
| 29847 | } |
| 29848 | } |
| 29849 | _tmp53_ = glib_value; |
| 29850 | _tmp54_ = _tmp53_->delegate_target_cvalue; |
| 29851 | if (_tmp54_ != NULL((void*)0)) { |
| 29852 | BalaGLibValue* _tmp55_; |
| 29853 | BalaGLibValue* _tmp56_; |
| 29854 | BalaCCodeExpression* _tmp57_; |
| 29855 | BalaCCodeUnaryExpression* _tmp58_; |
| 29856 | _tmp55_ = ref_value; |
| 29857 | _tmp56_ = glib_value; |
| 29858 | _tmp57_ = _tmp56_->delegate_target_cvalue; |
| 29859 | _tmp58_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp57_); |
| 29860 | _bala_ccode_node_unref0 (_tmp55_->delegate_target_cvalue)((_tmp55_->delegate_target_cvalue == ((void*)0)) ? ((void* )0) : (_tmp55_->delegate_target_cvalue = (bala_ccode_node_unref (_tmp55_->delegate_target_cvalue), ((void*)0)))); |
| 29861 | _tmp55_->delegate_target_cvalue = (BalaCCodeExpression*) _tmp58_; |
| 29862 | } |
| 29863 | _tmp59_ = glib_value; |
| 29864 | _tmp60_ = _tmp59_->delegate_target_destroy_notify_cvalue; |
| 29865 | if (_tmp60_ != NULL((void*)0)) { |
| 29866 | BalaGLibValue* _tmp61_; |
| 29867 | BalaGLibValue* _tmp62_; |
| 29868 | BalaCCodeExpression* _tmp63_; |
| 29869 | BalaCCodeUnaryExpression* _tmp64_; |
| 29870 | _tmp61_ = ref_value; |
| 29871 | _tmp62_ = glib_value; |
| 29872 | _tmp63_ = _tmp62_->delegate_target_destroy_notify_cvalue; |
| 29873 | _tmp64_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp63_); |
| 29874 | _bala_ccode_node_unref0 (_tmp61_->delegate_target_destroy_notify_cvalue)((_tmp61_->delegate_target_destroy_notify_cvalue == ((void *)0)) ? ((void*)0) : (_tmp61_->delegate_target_destroy_notify_cvalue = (bala_ccode_node_unref (_tmp61_->delegate_target_destroy_notify_cvalue ), ((void*)0)))); |
| 29875 | _tmp61_->delegate_target_destroy_notify_cvalue = (BalaCCodeExpression*) _tmp64_; |
| 29876 | } |
| 29877 | _tmp65_ = ref_value; |
| 29878 | bala_expression_set_target_value ((BalaExpression*) expr, (BalaTargetValue*) _tmp65_); |
| 29879 | _bala_target_value_unref0 (ref_value)((ref_value == ((void*)0)) ? ((void*)0) : (ref_value = (bala_target_value_unref (ref_value), ((void*)0)))); |
| 29880 | _bala_target_value_unref0 (glib_value)((glib_value == ((void*)0)) ? ((void*)0) : (glib_value = (bala_target_value_unref (glib_value), ((void*)0)))); |
| 29881 | return; |
| 29882 | } |
| 29883 | _tmp67_ = bala_unary_expression_get_operator (expr); |
| 29884 | _tmp68_ = _tmp67_; |
| 29885 | if (_tmp68_ == BALA_UNARY_OPERATOR_INCREMENT) { |
| 29886 | _tmp66_ = TRUE(!(0)); |
| 29887 | } else { |
| 29888 | BalaUnaryOperator _tmp69_; |
| 29889 | BalaUnaryOperator _tmp70_; |
| 29890 | _tmp69_ = bala_unary_expression_get_operator (expr); |
| 29891 | _tmp70_ = _tmp69_; |
| 29892 | _tmp66_ = _tmp70_ == BALA_UNARY_OPERATOR_DECREMENT; |
| 29893 | } |
| 29894 | if (_tmp66_) { |
| 29895 | BalaCCodeBinaryOperator _tmp71_ = 0; |
| 29896 | BalaUnaryOperator _tmp72_; |
| 29897 | BalaUnaryOperator _tmp73_; |
| 29898 | BalaCCodeBinaryOperator op = 0; |
| 29899 | BalaCCodeBinaryExpression* cexpr = NULL((void*)0); |
| 29900 | BalaCCodeBinaryOperator _tmp74_; |
| 29901 | BalaExpression* _tmp75_; |
| 29902 | BalaExpression* _tmp76_; |
| 29903 | BalaTargetValue* _tmp77_; |
| 29904 | BalaTargetValue* _tmp78_; |
| 29905 | BalaCCodeExpression* _tmp79_; |
| 29906 | BalaCCodeConstant* _tmp80_; |
| 29907 | BalaCCodeConstant* _tmp81_; |
| 29908 | BalaCCodeBinaryExpression* _tmp82_; |
| 29909 | BalaCCodeBinaryExpression* _tmp83_; |
| 29910 | BalaCCodeFunction* _tmp84_; |
| 29911 | BalaCCodeFunction* _tmp85_; |
| 29912 | BalaExpression* _tmp86_; |
| 29913 | BalaExpression* _tmp87_; |
| 29914 | BalaCCodeExpression* _tmp88_; |
| 29915 | BalaCCodeBinaryExpression* _tmp89_; |
| 29916 | BalaTargetValue* temp_value = NULL((void*)0); |
| 29917 | BalaExpression* _tmp90_; |
| 29918 | BalaExpression* _tmp91_; |
| 29919 | BalaTargetValue* _tmp92_; |
| 29920 | BalaTargetValue* _tmp93_; |
| 29921 | BalaTargetValue* _tmp94_; |
| 29922 | BalaMemberAccess* ma = NULL((void*)0); |
| 29923 | BalaExpression* _tmp95_; |
| 29924 | BalaExpression* _tmp96_; |
| 29925 | BalaMemberAccess* _tmp97_; |
| 29926 | BalaMemberAccess* _tmp98_; |
| 29927 | BalaTargetValue* _tmp108_; |
| 29928 | _tmp72_ = bala_unary_expression_get_operator (expr); |
| 29929 | _tmp73_ = _tmp72_; |
| 29930 | if (_tmp73_ == BALA_UNARY_OPERATOR_INCREMENT) { |
| 29931 | _tmp71_ = BALA_CCODE_BINARY_OPERATOR_PLUS; |
| 29932 | } else { |
| 29933 | _tmp71_ = BALA_CCODE_BINARY_OPERATOR_MINUS; |
| 29934 | } |
| 29935 | op = _tmp71_; |
| 29936 | _tmp74_ = op; |
| 29937 | _tmp75_ = bala_unary_expression_get_inner (expr); |
| 29938 | _tmp76_ = _tmp75_; |
| 29939 | _tmp77_ = bala_expression_get_target_value (_tmp76_); |
| 29940 | _tmp78_ = _tmp77_; |
| 29941 | _tmp79_ = bala_get_cvalue_ (_tmp78_); |
| 29942 | _tmp80_ = bala_ccode_constant_new ("1"); |
| 29943 | _tmp81_ = _tmp80_; |
| 29944 | _tmp82_ = bala_ccode_binary_expression_new (_tmp74_, _tmp79_, (BalaCCodeExpression*) _tmp81_); |
| 29945 | _tmp83_ = _tmp82_; |
| 29946 | _bala_ccode_node_unref0 (_tmp81_)((_tmp81_ == ((void*)0)) ? ((void*)0) : (_tmp81_ = (bala_ccode_node_unref (_tmp81_), ((void*)0)))); |
| 29947 | cexpr = _tmp83_; |
| 29948 | _tmp84_ = bala_ccode_base_module_get_ccode (self); |
| 29949 | _tmp85_ = _tmp84_; |
| 29950 | _tmp86_ = bala_unary_expression_get_inner (expr); |
| 29951 | _tmp87_ = _tmp86_; |
| 29952 | _tmp88_ = bala_get_cvalue (_tmp87_); |
| 29953 | _tmp89_ = cexpr; |
| 29954 | bala_ccode_function_add_assignment (_tmp85_, _tmp88_, (BalaCCodeExpression*) _tmp89_); |
| 29955 | _tmp90_ = bala_unary_expression_get_inner (expr); |
| 29956 | _tmp91_ = _tmp90_; |
| 29957 | _tmp92_ = bala_expression_get_target_value (_tmp91_); |
| 29958 | _tmp93_ = _tmp92_; |
| 29959 | _tmp94_ = bala_ccode_base_module_store_temp_value (self, _tmp93_, (BalaCodeNode*) expr, NULL((void*)0)); |
| 29960 | temp_value = _tmp94_; |
| 29961 | _tmp95_ = bala_unary_expression_get_inner (expr); |
| 29962 | _tmp96_ = _tmp95_; |
| 29963 | _tmp97_ = bala_ccode_base_module_find_property_access (self, _tmp96_); |
| 29964 | ma = _tmp97_; |
| 29965 | _tmp98_ = ma; |
| 29966 | if (_tmp98_ != NULL((void*)0)) { |
| 29967 | BalaProperty* prop = NULL((void*)0); |
| 29968 | BalaMemberAccess* _tmp99_; |
| 29969 | BalaSymbol* _tmp100_; |
| 29970 | BalaSymbol* _tmp101_; |
| 29971 | BalaProperty* _tmp102_; |
| 29972 | BalaProperty* _tmp103_; |
| 29973 | BalaMemberAccess* _tmp104_; |
| 29974 | BalaExpression* _tmp105_; |
| 29975 | BalaExpression* _tmp106_; |
| 29976 | BalaTargetValue* _tmp107_; |
| 29977 | _tmp99_ = ma; |
| 29978 | _tmp100_ = bala_expression_get_symbol_reference ((BalaExpression*) _tmp99_); |
| 29979 | _tmp101_ = _tmp100_; |
| 29980 | _tmp102_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp101_, BALA_TYPE_PROPERTY, BalaProperty)(((BalaProperty*) g_type_check_instance_cast ((GTypeInstance* ) (_tmp101_), ((bala_property_get_type ())))))); |
| 29981 | prop = _tmp102_; |
| 29982 | _tmp103_ = prop; |
| 29983 | _tmp104_ = ma; |
| 29984 | _tmp105_ = bala_member_access_get_inner (_tmp104_); |
| 29985 | _tmp106_ = _tmp105_; |
| 29986 | _tmp107_ = temp_value; |
| 29987 | bala_ccode_base_module_store_property (self, _tmp103_, _tmp106_, _tmp107_); |
| 29988 | _bala_code_node_unref0 (prop)((prop == ((void*)0)) ? ((void*)0) : (prop = (bala_code_node_unref (prop), ((void*)0)))); |
| 29989 | } |
| 29990 | _tmp108_ = temp_value; |
| 29991 | bala_expression_set_target_value ((BalaExpression*) expr, _tmp108_); |
| 29992 | _bala_code_node_unref0 (ma)((ma == ((void*)0)) ? ((void*)0) : (ma = (bala_code_node_unref (ma), ((void*)0)))); |
| 29993 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 29994 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 29995 | return; |
| 29996 | } |
| 29997 | _tmp109_ = bala_unary_expression_get_operator (expr); |
| 29998 | _tmp110_ = _tmp109_; |
| 29999 | switch (_tmp110_) { |
| 30000 | case BALA_UNARY_OPERATOR_PLUS: |
| 30001 | { |
| 30002 | op = BALA_CCODE_UNARY_OPERATOR_PLUS; |
| 30003 | break; |
| 30004 | } |
| 30005 | case BALA_UNARY_OPERATOR_MINUS: |
| 30006 | { |
| 30007 | op = BALA_CCODE_UNARY_OPERATOR_MINUS; |
| 30008 | break; |
| 30009 | } |
| 30010 | case BALA_UNARY_OPERATOR_LOGICAL_NEGATION: |
| 30011 | { |
| 30012 | op = BALA_CCODE_UNARY_OPERATOR_LOGICAL_NEGATION; |
| 30013 | break; |
| 30014 | } |
| 30015 | case BALA_UNARY_OPERATOR_BITWISE_COMPLEMENT: |
| 30016 | { |
| 30017 | op = BALA_CCODE_UNARY_OPERATOR_BITWISE_COMPLEMENT; |
| 30018 | break; |
| 30019 | } |
| 30020 | case BALA_UNARY_OPERATOR_INCREMENT: |
| 30021 | { |
| 30022 | op = BALA_CCODE_UNARY_OPERATOR_PREFIX_INCREMENT; |
| 30023 | break; |
| 30024 | } |
| 30025 | case BALA_UNARY_OPERATOR_DECREMENT: |
| 30026 | { |
| 30027 | op = BALA_CCODE_UNARY_OPERATOR_PREFIX_DECREMENT; |
| 30028 | break; |
| 30029 | } |
| 30030 | default: |
| 30031 | { |
| 30032 | g_assert_not_reached ()do { g_assertion_message_expr ("bala-ccodegen", "balaccodebasemodule.c" , 30032, ((const char*) (__func__)), ((void*)0)); } while (0); |
| 30033 | } |
| 30034 | } |
| 30035 | _tmp111_ = op; |
| 30036 | _tmp112_ = bala_unary_expression_get_inner (expr); |
| 30037 | _tmp113_ = _tmp112_; |
| 30038 | _tmp114_ = bala_get_cvalue (_tmp113_); |
| 30039 | _tmp115_ = bala_ccode_unary_expression_new (_tmp111_, _tmp114_); |
| 30040 | _tmp116_ = _tmp115_; |
| 30041 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp116_); |
| 30042 | _bala_ccode_node_unref0 (_tmp116_)((_tmp116_ == ((void*)0)) ? ((void*)0) : (_tmp116_ = (bala_ccode_node_unref (_tmp116_), ((void*)0)))); |
| 30043 | } |
| 30044 | |
| 30045 | static BalaCCodeExpression* |
| 30046 | bala_ccode_base_module_real_deserialize_expression (BalaCCodeBaseModule* self, |
| 30047 | BalaDataType* type, |
| 30048 | BalaCCodeExpression* variant_expr, |
| 30049 | BalaCCodeExpression* expr, |
| 30050 | BalaCCodeExpression* error_expr, |
| 30051 | gboolean* may_fail) |
| 30052 | { |
| 30053 | gboolean _bala_may_fail = FALSE(0); |
| 30054 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 30055 | g_return_val_if_fail (variant_expr != NULL, NULL)do { if ((variant_expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "variant_expr != NULL" ); return (((void*)0)); } } while (0); |
| 30056 | g_assert_not_reached ()do { g_assertion_message_expr ("bala-ccodegen", "balaccodebasemodule.c" , 30056, ((const char*) (__func__)), ((void*)0)); } while (0); |
| 30057 | if (may_fail) { |
| 30058 | *may_fail = _bala_may_fail; |
| 30059 | } |
| 30060 | } |
| 30061 | |
| 30062 | BalaCCodeExpression* |
| 30063 | bala_ccode_base_module_deserialize_expression (BalaCCodeBaseModule* self, |
| 30064 | BalaDataType* type, |
| 30065 | BalaCCodeExpression* variant_expr, |
| 30066 | BalaCCodeExpression* expr, |
| 30067 | BalaCCodeExpression* error_expr, |
| 30068 | gboolean* may_fail) |
| 30069 | { |
| 30070 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 30071 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->deserialize_expression (self, type, variant_expr, expr, error_expr, may_fail); |
| 30072 | } |
| 30073 | |
| 30074 | static BalaCCodeExpression* |
| 30075 | bala_ccode_base_module_real_serialize_expression (BalaCCodeBaseModule* self, |
| 30076 | BalaDataType* type, |
| 30077 | BalaCCodeExpression* expr) |
| 30078 | { |
| 30079 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 30080 | g_return_val_if_fail (expr != NULL, NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return (((void*)0)); } } while (0); |
| 30081 | g_assert_not_reached ()do { g_assertion_message_expr ("bala-ccodegen", "balaccodebasemodule.c" , 30081, ((const char*) (__func__)), ((void*)0)); } while (0); |
| 30082 | } |
| 30083 | |
| 30084 | BalaCCodeExpression* |
| 30085 | bala_ccode_base_module_serialize_expression (BalaCCodeBaseModule* self, |
| 30086 | BalaDataType* type, |
| 30087 | BalaCCodeExpression* expr) |
| 30088 | { |
| 30089 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 30090 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->serialize_expression (self, type, expr); |
| 30091 | } |
| 30092 | |
| 30093 | static void |
| 30094 | bala_ccode_base_module_real_visit_cast_expression (BalaCodeVisitor* base, |
| 30095 | BalaCastExpression* expr) |
| 30096 | { |
| 30097 | BalaCCodeBaseModule * self; |
| 30098 | gboolean _tmp0_; |
| 30099 | gboolean _tmp1_; |
| 30100 | BalaDataType* _tmp6_; |
| 30101 | BalaDataType* _tmp7_; |
| 30102 | BalaCCodeFile* _tmp8_; |
| 30103 | BalaArrayType* array_type = NULL((void*)0); |
| 30104 | BalaDataType* _tmp9_; |
| 30105 | BalaDataType* _tmp10_; |
| 30106 | BalaArrayType* _tmp11_; |
| 30107 | gboolean _tmp12_ = FALSE(0); |
| 30108 | BalaArrayType* _tmp13_; |
| 30109 | BalaCCodeExpression* innercexpr = NULL((void*)0); |
| 30110 | BalaExpression* _tmp138_; |
| 30111 | BalaExpression* _tmp139_; |
| 30112 | BalaCCodeExpression* _tmp140_; |
| 30113 | BalaCCodeExpression* _tmp141_; |
| 30114 | gboolean _tmp142_ = FALSE(0); |
| 30115 | gboolean _tmp143_ = FALSE(0); |
| 30116 | gboolean _tmp144_ = FALSE(0); |
| 30117 | BalaDataType* _tmp145_; |
| 30118 | BalaDataType* _tmp146_; |
| 30119 | BalaCCodeExpression* _tmp223_; |
| 30120 | BalaDataType* _tmp224_; |
| 30121 | BalaDataType* _tmp225_; |
| 30122 | gchar* _tmp226_; |
| 30123 | gchar* _tmp227_; |
| 30124 | BalaCCodeCastExpression* _tmp228_; |
| 30125 | BalaCCodeCastExpression* _tmp229_; |
| 30126 | BalaDataType* _tmp230_; |
| 30127 | BalaDataType* _tmp231_; |
| 30128 | self = (BalaCCodeBaseModule*) base; |
| 30129 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 30130 | _tmp0_ = bala_cast_expression_get_is_silent_cast (expr); |
| 30131 | _tmp1_ = _tmp0_; |
| 30132 | if (_tmp1_) { |
| 30133 | BalaCCodeInvalidExpression* _tmp2_; |
| 30134 | BalaCCodeInvalidExpression* _tmp3_; |
| 30135 | BalaSourceReference* _tmp4_; |
| 30136 | BalaSourceReference* _tmp5_; |
| 30137 | _tmp2_ = bala_ccode_invalid_expression_new (); |
| 30138 | _tmp3_ = _tmp2_; |
| 30139 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp3_); |
| 30140 | _bala_ccode_node_unref0 (_tmp3_)((_tmp3_ == ((void*)0)) ? ((void*)0) : (_tmp3_ = (bala_ccode_node_unref (_tmp3_), ((void*)0)))); |
| 30141 | bala_code_node_set_error ((BalaCodeNode*) expr, TRUE(!(0))); |
| 30142 | _tmp4_ = bala_code_node_get_source_reference ((BalaCodeNode*) expr); |
| 30143 | _tmp5_ = _tmp4_; |
| 30144 | bala_report_error (_tmp5_, "Operation not supported for this type"); |
| 30145 | return; |
| 30146 | } |
| 30147 | _tmp6_ = bala_cast_expression_get_type_reference (expr); |
| 30148 | _tmp7_ = _tmp6_; |
| 30149 | _tmp8_ = self->cfile; |
| 30150 | bala_ccode_base_module_generate_type_declaration (self, _tmp7_, _tmp8_); |
| 30151 | _tmp9_ = bala_cast_expression_get_type_reference (expr); |
| 30152 | _tmp10_ = _tmp9_; |
| 30153 | _tmp11_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp10_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) _tmp10_) : NULL((void*)0)); |
| 30154 | array_type = _tmp11_; |
| 30155 | _tmp13_ = array_type; |
| 30156 | if (_tmp13_ != NULL((void*)0)) { |
| 30157 | BalaExpression* _tmp14_; |
| 30158 | BalaExpression* _tmp15_; |
| 30159 | BalaDataType* _tmp16_; |
| 30160 | BalaDataType* _tmp17_; |
| 30161 | _tmp14_ = bala_cast_expression_get_inner (expr); |
| 30162 | _tmp15_ = _tmp14_; |
| 30163 | _tmp16_ = bala_expression_get_value_type (_tmp15_); |
| 30164 | _tmp17_ = _tmp16_; |
| 30165 | _tmp12_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp17_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 30166 | } else { |
| 30167 | _tmp12_ = FALSE(0); |
| 30168 | } |
| 30169 | if (_tmp12_) { |
| 30170 | gboolean _tmp18_ = FALSE(0); |
| 30171 | BalaArrayType* _tmp19_; |
| 30172 | BalaDataType* _tmp20_; |
| 30173 | BalaDataType* _tmp21_; |
| 30174 | _tmp19_ = array_type; |
| 30175 | _tmp20_ = bala_array_type_get_element_type (_tmp19_); |
| 30176 | _tmp21_ = _tmp20_; |
| 30177 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp21_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 30178 | _tmp18_ = TRUE(!(0)); |
| 30179 | } else { |
| 30180 | BalaExpression* _tmp22_; |
| 30181 | BalaExpression* _tmp23_; |
| 30182 | BalaDataType* _tmp24_; |
| 30183 | BalaDataType* _tmp25_; |
| 30184 | BalaDataType* _tmp26_; |
| 30185 | BalaDataType* _tmp27_; |
| 30186 | _tmp22_ = bala_cast_expression_get_inner (expr); |
| 30187 | _tmp23_ = _tmp22_; |
| 30188 | _tmp24_ = bala_expression_get_value_type (_tmp23_); |
| 30189 | _tmp25_ = _tmp24_; |
| 30190 | _tmp26_ = bala_array_type_get_element_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp25_), ((bala_array_type_get_type ())))))); |
| 30191 | _tmp27_ = _tmp26_; |
| 30192 | _tmp18_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp27_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp27_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 30193 | } |
| 30194 | if (_tmp18_) { |
| 30195 | { |
| 30196 | gint dim = 0; |
| 30197 | dim = 1; |
| 30198 | { |
| 30199 | gboolean _tmp28_ = FALSE(0); |
| 30200 | _tmp28_ = TRUE(!(0)); |
| 30201 | while (TRUE(!(0))) { |
| 30202 | BalaArrayType* _tmp30_; |
| 30203 | gint _tmp31_; |
| 30204 | gint _tmp32_; |
| 30205 | BalaExpression* _tmp33_; |
| 30206 | BalaExpression* _tmp34_; |
| 30207 | BalaCCodeExpression* _tmp35_; |
| 30208 | BalaCCodeExpression* _tmp36_; |
| 30209 | if (!_tmp28_) { |
| 30210 | gint _tmp29_; |
| 30211 | _tmp29_ = dim; |
| 30212 | dim = _tmp29_ + 1; |
| 30213 | } |
| 30214 | _tmp28_ = FALSE(0); |
| 30215 | _tmp30_ = array_type; |
| 30216 | _tmp31_ = bala_array_type_get_rank (_tmp30_); |
| 30217 | _tmp32_ = _tmp31_; |
| 30218 | if (!(dim <= _tmp32_)) { |
| 30219 | break; |
| 30220 | } |
| 30221 | _tmp33_ = bala_cast_expression_get_inner (expr); |
| 30222 | _tmp34_ = _tmp33_; |
| 30223 | _tmp35_ = bala_ccode_base_module_get_array_length_cexpression (self, _tmp34_, dim); |
| 30224 | _tmp36_ = _tmp35_; |
| 30225 | bala_append_array_length ((BalaExpression*) expr, _tmp36_); |
| 30226 | _bala_ccode_node_unref0 (_tmp36_)((_tmp36_ == ((void*)0)) ? ((void*)0) : (_tmp36_ = (bala_ccode_node_unref (_tmp36_), ((void*)0)))); |
| 30227 | } |
| 30228 | } |
| 30229 | } |
| 30230 | } else { |
| 30231 | BalaCCodeFunctionCall* sizeof_to = NULL((void*)0); |
| 30232 | BalaCCodeIdentifier* _tmp37_; |
| 30233 | BalaCCodeIdentifier* _tmp38_; |
| 30234 | BalaCCodeFunctionCall* _tmp39_; |
| 30235 | BalaCCodeFunctionCall* _tmp40_; |
| 30236 | BalaCCodeFunctionCall* _tmp41_; |
| 30237 | BalaArrayType* _tmp42_; |
| 30238 | BalaDataType* _tmp43_; |
| 30239 | BalaDataType* _tmp44_; |
| 30240 | gchar* _tmp45_; |
| 30241 | gchar* _tmp46_; |
| 30242 | BalaCCodeConstant* _tmp47_; |
| 30243 | BalaCCodeConstant* _tmp48_; |
| 30244 | BalaCCodeFunctionCall* sizeof_from = NULL((void*)0); |
| 30245 | BalaCCodeIdentifier* _tmp49_; |
| 30246 | BalaCCodeIdentifier* _tmp50_; |
| 30247 | BalaCCodeFunctionCall* _tmp51_; |
| 30248 | BalaCCodeFunctionCall* _tmp52_; |
| 30249 | BalaCCodeFunctionCall* _tmp53_; |
| 30250 | BalaExpression* _tmp54_; |
| 30251 | BalaExpression* _tmp55_; |
| 30252 | BalaDataType* _tmp56_; |
| 30253 | BalaDataType* _tmp57_; |
| 30254 | BalaDataType* _tmp58_; |
| 30255 | BalaDataType* _tmp59_; |
| 30256 | gchar* _tmp60_; |
| 30257 | gchar* _tmp61_; |
| 30258 | BalaCCodeConstant* _tmp62_; |
| 30259 | BalaCCodeConstant* _tmp63_; |
| 30260 | _tmp37_ = bala_ccode_identifier_new ("sizeof"); |
| 30261 | _tmp38_ = _tmp37_; |
| 30262 | _tmp39_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp38_); |
| 30263 | _tmp40_ = _tmp39_; |
| 30264 | _bala_ccode_node_unref0 (_tmp38_)((_tmp38_ == ((void*)0)) ? ((void*)0) : (_tmp38_ = (bala_ccode_node_unref (_tmp38_), ((void*)0)))); |
| 30265 | sizeof_to = _tmp40_; |
| 30266 | _tmp41_ = sizeof_to; |
| 30267 | _tmp42_ = array_type; |
| 30268 | _tmp43_ = bala_array_type_get_element_type (_tmp42_); |
| 30269 | _tmp44_ = _tmp43_; |
| 30270 | _tmp45_ = bala_get_ccode_name ((BalaCodeNode*) _tmp44_); |
| 30271 | _tmp46_ = _tmp45_; |
| 30272 | _tmp47_ = bala_ccode_constant_new (_tmp46_); |
| 30273 | _tmp48_ = _tmp47_; |
| 30274 | bala_ccode_function_call_add_argument (_tmp41_, (BalaCCodeExpression*) _tmp48_); |
| 30275 | _bala_ccode_node_unref0 (_tmp48_)((_tmp48_ == ((void*)0)) ? ((void*)0) : (_tmp48_ = (bala_ccode_node_unref (_tmp48_), ((void*)0)))); |
| 30276 | _g_free0 (_tmp46_)(_tmp46_ = (g_free (_tmp46_), ((void*)0))); |
| 30277 | _tmp49_ = bala_ccode_identifier_new ("sizeof"); |
| 30278 | _tmp50_ = _tmp49_; |
| 30279 | _tmp51_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp50_); |
| 30280 | _tmp52_ = _tmp51_; |
| 30281 | _bala_ccode_node_unref0 (_tmp50_)((_tmp50_ == ((void*)0)) ? ((void*)0) : (_tmp50_ = (bala_ccode_node_unref (_tmp50_), ((void*)0)))); |
| 30282 | sizeof_from = _tmp52_; |
| 30283 | _tmp53_ = sizeof_from; |
| 30284 | _tmp54_ = bala_cast_expression_get_inner (expr); |
| 30285 | _tmp55_ = _tmp54_; |
| 30286 | _tmp56_ = bala_expression_get_value_type (_tmp55_); |
| 30287 | _tmp57_ = _tmp56_; |
| 30288 | _tmp58_ = bala_array_type_get_element_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp57_), ((bala_array_type_get_type ())))))); |
| 30289 | _tmp59_ = _tmp58_; |
| 30290 | _tmp60_ = bala_get_ccode_name ((BalaCodeNode*) _tmp59_); |
| 30291 | _tmp61_ = _tmp60_; |
| 30292 | _tmp62_ = bala_ccode_constant_new (_tmp61_); |
| 30293 | _tmp63_ = _tmp62_; |
| 30294 | bala_ccode_function_call_add_argument (_tmp53_, (BalaCCodeExpression*) _tmp63_); |
| 30295 | _bala_ccode_node_unref0 (_tmp63_)((_tmp63_ == ((void*)0)) ? ((void*)0) : (_tmp63_ = (bala_ccode_node_unref (_tmp63_), ((void*)0)))); |
| 30296 | _g_free0 (_tmp61_)(_tmp61_ = (g_free (_tmp61_), ((void*)0))); |
| 30297 | { |
| 30298 | gint dim = 0; |
| 30299 | dim = 1; |
| 30300 | { |
| 30301 | gboolean _tmp64_ = FALSE(0); |
| 30302 | _tmp64_ = TRUE(!(0)); |
| 30303 | while (TRUE(!(0))) { |
| 30304 | BalaArrayType* _tmp66_; |
| 30305 | gint _tmp67_; |
| 30306 | gint _tmp68_; |
| 30307 | BalaExpression* _tmp69_; |
| 30308 | BalaExpression* _tmp70_; |
| 30309 | BalaCCodeExpression* _tmp71_; |
| 30310 | BalaCCodeExpression* _tmp72_; |
| 30311 | BalaCCodeFunctionCall* _tmp73_; |
| 30312 | BalaCCodeBinaryExpression* _tmp74_; |
| 30313 | BalaCCodeBinaryExpression* _tmp75_; |
| 30314 | BalaCCodeFunctionCall* _tmp76_; |
| 30315 | BalaCCodeBinaryExpression* _tmp77_; |
| 30316 | BalaCCodeBinaryExpression* _tmp78_; |
| 30317 | if (!_tmp64_) { |
| 30318 | gint _tmp65_; |
| 30319 | _tmp65_ = dim; |
| 30320 | dim = _tmp65_ + 1; |
| 30321 | } |
| 30322 | _tmp64_ = FALSE(0); |
| 30323 | _tmp66_ = array_type; |
| 30324 | _tmp67_ = bala_array_type_get_rank (_tmp66_); |
| 30325 | _tmp68_ = _tmp67_; |
| 30326 | if (!(dim <= _tmp68_)) { |
| 30327 | break; |
| 30328 | } |
| 30329 | _tmp69_ = bala_cast_expression_get_inner (expr); |
| 30330 | _tmp70_ = _tmp69_; |
| 30331 | _tmp71_ = bala_ccode_base_module_get_array_length_cexpression (self, _tmp70_, dim); |
| 30332 | _tmp72_ = _tmp71_; |
| 30333 | _tmp73_ = sizeof_from; |
| 30334 | _tmp74_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_MUL, _tmp72_, (BalaCCodeExpression*) _tmp73_); |
| 30335 | _tmp75_ = _tmp74_; |
| 30336 | _tmp76_ = sizeof_to; |
| 30337 | _tmp77_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_DIV, (BalaCCodeExpression*) _tmp75_, (BalaCCodeExpression*) _tmp76_); |
| 30338 | _tmp78_ = _tmp77_; |
| 30339 | bala_append_array_length ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp78_); |
| 30340 | _bala_ccode_node_unref0 (_tmp78_)((_tmp78_ == ((void*)0)) ? ((void*)0) : (_tmp78_ = (bala_ccode_node_unref (_tmp78_), ((void*)0)))); |
| 30341 | _bala_ccode_node_unref0 (_tmp75_)((_tmp75_ == ((void*)0)) ? ((void*)0) : (_tmp75_ = (bala_ccode_node_unref (_tmp75_), ((void*)0)))); |
| 30342 | _bala_ccode_node_unref0 (_tmp72_)((_tmp72_ == ((void*)0)) ? ((void*)0) : (_tmp72_ = (bala_ccode_node_unref (_tmp72_), ((void*)0)))); |
| 30343 | } |
| 30344 | } |
| 30345 | } |
| 30346 | _bala_ccode_node_unref0 (sizeof_from)((sizeof_from == ((void*)0)) ? ((void*)0) : (sizeof_from = (bala_ccode_node_unref (sizeof_from), ((void*)0)))); |
| 30347 | _bala_ccode_node_unref0 (sizeof_to)((sizeof_to == ((void*)0)) ? ((void*)0) : (sizeof_to = (bala_ccode_node_unref (sizeof_to), ((void*)0)))); |
| 30348 | } |
| 30349 | } else { |
| 30350 | BalaArrayType* _tmp79_; |
| 30351 | _tmp79_ = array_type; |
| 30352 | if (_tmp79_ != NULL((void*)0)) { |
| 30353 | BalaCCodeExpression* array_length_expr = NULL((void*)0); |
| 30354 | BalaCCodeFunctionCall* sizeof_to = NULL((void*)0); |
| 30355 | BalaCCodeIdentifier* _tmp80_; |
| 30356 | BalaCCodeIdentifier* _tmp81_; |
| 30357 | BalaCCodeFunctionCall* _tmp82_; |
| 30358 | BalaCCodeFunctionCall* _tmp83_; |
| 30359 | BalaCCodeFunctionCall* _tmp84_; |
| 30360 | BalaArrayType* _tmp85_; |
| 30361 | BalaDataType* _tmp86_; |
| 30362 | BalaDataType* _tmp87_; |
| 30363 | gchar* _tmp88_; |
| 30364 | gchar* _tmp89_; |
| 30365 | BalaCCodeConstant* _tmp90_; |
| 30366 | BalaCCodeConstant* _tmp91_; |
| 30367 | BalaCCodeFunctionCall* sizeof_from = NULL((void*)0); |
| 30368 | BalaCCodeIdentifier* _tmp92_; |
| 30369 | BalaCCodeIdentifier* _tmp93_; |
| 30370 | BalaCCodeFunctionCall* _tmp94_; |
| 30371 | BalaCCodeFunctionCall* _tmp95_; |
| 30372 | BalaDataType* value_type = NULL((void*)0); |
| 30373 | BalaExpression* _tmp96_; |
| 30374 | BalaExpression* _tmp97_; |
| 30375 | BalaDataType* _tmp98_; |
| 30376 | BalaDataType* _tmp99_; |
| 30377 | BalaDataType* _tmp100_; |
| 30378 | BalaDataType* _tmp101_; |
| 30379 | _tmp80_ = bala_ccode_identifier_new ("sizeof"); |
| 30380 | _tmp81_ = _tmp80_; |
| 30381 | _tmp82_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp81_); |
| 30382 | _tmp83_ = _tmp82_; |
| 30383 | _bala_ccode_node_unref0 (_tmp81_)((_tmp81_ == ((void*)0)) ? ((void*)0) : (_tmp81_ = (bala_ccode_node_unref (_tmp81_), ((void*)0)))); |
| 30384 | sizeof_to = _tmp83_; |
| 30385 | _tmp84_ = sizeof_to; |
| 30386 | _tmp85_ = array_type; |
| 30387 | _tmp86_ = bala_array_type_get_element_type (_tmp85_); |
| 30388 | _tmp87_ = _tmp86_; |
| 30389 | _tmp88_ = bala_get_ccode_name ((BalaCodeNode*) _tmp87_); |
| 30390 | _tmp89_ = _tmp88_; |
| 30391 | _tmp90_ = bala_ccode_constant_new (_tmp89_); |
| 30392 | _tmp91_ = _tmp90_; |
| 30393 | bala_ccode_function_call_add_argument (_tmp84_, (BalaCCodeExpression*) _tmp91_); |
| 30394 | _bala_ccode_node_unref0 (_tmp91_)((_tmp91_ == ((void*)0)) ? ((void*)0) : (_tmp91_ = (bala_ccode_node_unref (_tmp91_), ((void*)0)))); |
| 30395 | _g_free0 (_tmp89_)(_tmp89_ = (g_free (_tmp89_), ((void*)0))); |
| 30396 | _tmp92_ = bala_ccode_identifier_new ("sizeof"); |
| 30397 | _tmp93_ = _tmp92_; |
| 30398 | _tmp94_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp93_); |
| 30399 | _tmp95_ = _tmp94_; |
| 30400 | _bala_ccode_node_unref0 (_tmp93_)((_tmp93_ == ((void*)0)) ? ((void*)0) : (_tmp93_ = (bala_ccode_node_unref (_tmp93_), ((void*)0)))); |
| 30401 | sizeof_from = _tmp95_; |
| 30402 | _tmp96_ = bala_cast_expression_get_inner (expr); |
| 30403 | _tmp97_ = _tmp96_; |
| 30404 | _tmp98_ = bala_expression_get_value_type (_tmp97_); |
| 30405 | _tmp99_ = _tmp98_; |
| 30406 | _tmp100_ = _bala_code_node_ref0 (_tmp99_); |
| 30407 | value_type = _tmp100_; |
| 30408 | _tmp101_ = value_type; |
| 30409 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp101_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp101_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 30410 | BalaCCodeFunctionCall* _tmp102_; |
| 30411 | BalaDataType* _tmp103_; |
| 30412 | BalaTypeSymbol* _tmp104_; |
| 30413 | BalaTypeSymbol* _tmp105_; |
| 30414 | gchar* _tmp106_; |
| 30415 | gchar* _tmp107_; |
| 30416 | BalaCCodeConstant* _tmp108_; |
| 30417 | BalaCCodeConstant* _tmp109_; |
| 30418 | BalaCCodeFunctionCall* _tmp110_; |
| 30419 | BalaCCodeFunctionCall* _tmp111_; |
| 30420 | BalaCCodeBinaryExpression* _tmp112_; |
| 30421 | _tmp102_ = sizeof_from; |
| 30422 | _tmp103_ = value_type; |
| 30423 | _tmp104_ = bala_data_type_get_type_symbol (_tmp103_); |
| 30424 | _tmp105_ = _tmp104_; |
| 30425 | _tmp106_ = bala_get_ccode_name ((BalaCodeNode*) _tmp105_); |
| 30426 | _tmp107_ = _tmp106_; |
| 30427 | _tmp108_ = bala_ccode_constant_new (_tmp107_); |
| 30428 | _tmp109_ = _tmp108_; |
| 30429 | bala_ccode_function_call_add_argument (_tmp102_, (BalaCCodeExpression*) _tmp109_); |
| 30430 | _bala_ccode_node_unref0 (_tmp109_)((_tmp109_ == ((void*)0)) ? ((void*)0) : (_tmp109_ = (bala_ccode_node_unref (_tmp109_), ((void*)0)))); |
| 30431 | _g_free0 (_tmp107_)(_tmp107_ = (g_free (_tmp107_), ((void*)0))); |
| 30432 | _tmp110_ = sizeof_from; |
| 30433 | _tmp111_ = sizeof_to; |
| 30434 | _tmp112_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_DIV, (BalaCCodeExpression*) _tmp110_, (BalaCCodeExpression*) _tmp111_); |
| 30435 | _bala_ccode_node_unref0 (array_length_expr)((array_length_expr == ((void*)0)) ? ((void*)0) : (array_length_expr = (bala_ccode_node_unref (array_length_expr), ((void*)0)))); |
| 30436 | array_length_expr = (BalaCCodeExpression*) _tmp112_; |
| 30437 | } else { |
| 30438 | gboolean _tmp113_ = FALSE(0); |
| 30439 | BalaDataType* _tmp114_; |
| 30440 | _tmp114_ = value_type; |
| 30441 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp114_, BALA_TYPE_POINTER_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp114_); GType __t = ((bala_pointer_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 30442 | BalaDataType* _tmp115_; |
| 30443 | BalaDataType* _tmp116_; |
| 30444 | BalaDataType* _tmp117_; |
| 30445 | _tmp115_ = value_type; |
| 30446 | _tmp116_ = bala_pointer_type_get_base_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp115_, BALA_TYPE_POINTER_TYPE, BalaPointerType)(((BalaPointerType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp115_), ((bala_pointer_type_get_type ())))))); |
| 30447 | _tmp117_ = _tmp116_; |
| 30448 | _tmp113_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp117_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp117_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 30449 | } else { |
| 30450 | _tmp113_ = FALSE(0); |
| 30451 | } |
| 30452 | if (_tmp113_) { |
| 30453 | BalaCCodeFunctionCall* _tmp118_; |
| 30454 | BalaDataType* _tmp119_; |
| 30455 | BalaDataType* _tmp120_; |
| 30456 | BalaDataType* _tmp121_; |
| 30457 | BalaTypeSymbol* _tmp122_; |
| 30458 | BalaTypeSymbol* _tmp123_; |
| 30459 | gchar* _tmp124_; |
| 30460 | gchar* _tmp125_; |
| 30461 | BalaCCodeConstant* _tmp126_; |
| 30462 | BalaCCodeConstant* _tmp127_; |
| 30463 | BalaCCodeFunctionCall* _tmp128_; |
| 30464 | BalaCCodeFunctionCall* _tmp129_; |
| 30465 | BalaCCodeBinaryExpression* _tmp130_; |
| 30466 | _tmp118_ = sizeof_from; |
| 30467 | _tmp119_ = value_type; |
| 30468 | _tmp120_ = bala_pointer_type_get_base_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp119_, BALA_TYPE_POINTER_TYPE, BalaPointerType)(((BalaPointerType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp119_), ((bala_pointer_type_get_type ())))))); |
| 30469 | _tmp121_ = _tmp120_; |
| 30470 | _tmp122_ = bala_data_type_get_type_symbol (_tmp121_); |
| 30471 | _tmp123_ = _tmp122_; |
| 30472 | _tmp124_ = bala_get_ccode_name ((BalaCodeNode*) _tmp123_); |
| 30473 | _tmp125_ = _tmp124_; |
| 30474 | _tmp126_ = bala_ccode_constant_new (_tmp125_); |
| 30475 | _tmp127_ = _tmp126_; |
| 30476 | bala_ccode_function_call_add_argument (_tmp118_, (BalaCCodeExpression*) _tmp127_); |
| 30477 | _bala_ccode_node_unref0 (_tmp127_)((_tmp127_ == ((void*)0)) ? ((void*)0) : (_tmp127_ = (bala_ccode_node_unref (_tmp127_), ((void*)0)))); |
| 30478 | _g_free0 (_tmp125_)(_tmp125_ = (g_free (_tmp125_), ((void*)0))); |
| 30479 | _tmp128_ = sizeof_from; |
| 30480 | _tmp129_ = sizeof_to; |
| 30481 | _tmp130_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_DIV, (BalaCCodeExpression*) _tmp128_, (BalaCCodeExpression*) _tmp129_); |
| 30482 | _bala_ccode_node_unref0 (array_length_expr)((array_length_expr == ((void*)0)) ? ((void*)0) : (array_length_expr = (bala_ccode_node_unref (array_length_expr), ((void*)0)))); |
| 30483 | array_length_expr = (BalaCCodeExpression*) _tmp130_; |
| 30484 | } else { |
| 30485 | BalaCCodeConstant* _tmp131_; |
| 30486 | _tmp131_ = bala_ccode_constant_new ("-1"); |
| 30487 | _bala_ccode_node_unref0 (array_length_expr)((array_length_expr == ((void*)0)) ? ((void*)0) : (array_length_expr = (bala_ccode_node_unref (array_length_expr), ((void*)0)))); |
| 30488 | array_length_expr = (BalaCCodeExpression*) _tmp131_; |
| 30489 | } |
| 30490 | } |
| 30491 | { |
| 30492 | gint dim = 0; |
| 30493 | dim = 1; |
| 30494 | { |
| 30495 | gboolean _tmp132_ = FALSE(0); |
| 30496 | _tmp132_ = TRUE(!(0)); |
| 30497 | while (TRUE(!(0))) { |
| 30498 | BalaArrayType* _tmp134_; |
| 30499 | gint _tmp135_; |
| 30500 | gint _tmp136_; |
| 30501 | BalaCCodeExpression* _tmp137_; |
| 30502 | if (!_tmp132_) { |
| 30503 | gint _tmp133_; |
| 30504 | _tmp133_ = dim; |
| 30505 | dim = _tmp133_ + 1; |
| 30506 | } |
| 30507 | _tmp132_ = FALSE(0); |
| 30508 | _tmp134_ = array_type; |
| 30509 | _tmp135_ = bala_array_type_get_rank (_tmp134_); |
| 30510 | _tmp136_ = _tmp135_; |
| 30511 | if (!(dim <= _tmp136_)) { |
| 30512 | break; |
| 30513 | } |
| 30514 | _tmp137_ = array_length_expr; |
| 30515 | bala_append_array_length ((BalaExpression*) expr, _tmp137_); |
| 30516 | } |
| 30517 | } |
| 30518 | } |
| 30519 | _bala_code_node_unref0 (value_type)((value_type == ((void*)0)) ? ((void*)0) : (value_type = (bala_code_node_unref (value_type), ((void*)0)))); |
| 30520 | _bala_ccode_node_unref0 (sizeof_from)((sizeof_from == ((void*)0)) ? ((void*)0) : (sizeof_from = (bala_ccode_node_unref (sizeof_from), ((void*)0)))); |
| 30521 | _bala_ccode_node_unref0 (sizeof_to)((sizeof_to == ((void*)0)) ? ((void*)0) : (sizeof_to = (bala_ccode_node_unref (sizeof_to), ((void*)0)))); |
| 30522 | _bala_ccode_node_unref0 (array_length_expr)((array_length_expr == ((void*)0)) ? ((void*)0) : (array_length_expr = (bala_ccode_node_unref (array_length_expr), ((void*)0)))); |
| 30523 | } |
| 30524 | } |
| 30525 | _tmp138_ = bala_cast_expression_get_inner (expr); |
| 30526 | _tmp139_ = _tmp138_; |
| 30527 | _tmp140_ = bala_get_cvalue (_tmp139_); |
| 30528 | _tmp141_ = _bala_ccode_node_ref0 (_tmp140_); |
| 30529 | innercexpr = _tmp141_; |
| 30530 | _tmp145_ = bala_cast_expression_get_type_reference (expr); |
| 30531 | _tmp146_ = _tmp145_; |
| 30532 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp146_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp146_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 30533 | BalaDataType* _tmp147_; |
| 30534 | BalaDataType* _tmp148_; |
| 30535 | gboolean _tmp149_; |
| 30536 | gboolean _tmp150_; |
| 30537 | _tmp147_ = bala_cast_expression_get_type_reference (expr); |
| 30538 | _tmp148_ = _tmp147_; |
| 30539 | _tmp149_ = bala_data_type_get_nullable (_tmp148_); |
| 30540 | _tmp150_ = _tmp149_; |
| 30541 | _tmp144_ = !_tmp150_; |
| 30542 | } else { |
| 30543 | _tmp144_ = FALSE(0); |
| 30544 | } |
| 30545 | if (_tmp144_) { |
| 30546 | BalaExpression* _tmp151_; |
| 30547 | BalaExpression* _tmp152_; |
| 30548 | BalaDataType* _tmp153_; |
| 30549 | BalaDataType* _tmp154_; |
| 30550 | _tmp151_ = bala_cast_expression_get_inner (expr); |
| 30551 | _tmp152_ = _tmp151_; |
| 30552 | _tmp153_ = bala_expression_get_value_type (_tmp152_); |
| 30553 | _tmp154_ = _tmp153_; |
| 30554 | _tmp143_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp154_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp154_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 30555 | } else { |
| 30556 | _tmp143_ = FALSE(0); |
| 30557 | } |
| 30558 | if (_tmp143_) { |
| 30559 | BalaExpression* _tmp155_; |
| 30560 | BalaExpression* _tmp156_; |
| 30561 | BalaDataType* _tmp157_; |
| 30562 | BalaDataType* _tmp158_; |
| 30563 | gboolean _tmp159_; |
| 30564 | gboolean _tmp160_; |
| 30565 | _tmp155_ = bala_cast_expression_get_inner (expr); |
| 30566 | _tmp156_ = _tmp155_; |
| 30567 | _tmp157_ = bala_expression_get_value_type (_tmp156_); |
| 30568 | _tmp158_ = _tmp157_; |
| 30569 | _tmp159_ = bala_data_type_get_nullable (_tmp158_); |
| 30570 | _tmp160_ = _tmp159_; |
| 30571 | _tmp142_ = _tmp160_; |
| 30572 | } else { |
| 30573 | _tmp142_ = FALSE(0); |
| 30574 | } |
| 30575 | if (_tmp142_) { |
| 30576 | BalaExpression* inner_expr = NULL((void*)0); |
| 30577 | BalaExpression* _tmp161_; |
| 30578 | BalaExpression* _tmp162_; |
| 30579 | gboolean _tmp167_ = FALSE(0); |
| 30580 | BalaExpression* _tmp168_; |
| 30581 | BalaDataType* _tmp169_; |
| 30582 | BalaDataType* _tmp170_; |
| 30583 | gboolean _tmp171_; |
| 30584 | gboolean _tmp172_; |
| 30585 | BalaCCodeExpression* _tmp188_; |
| 30586 | BalaCCodeUnaryExpression* _tmp189_; |
| 30587 | _tmp161_ = bala_cast_expression_get_inner (expr); |
| 30588 | _tmp162_ = _tmp161_; |
| 30589 | inner_expr = _tmp162_; |
| 30590 | while (TRUE(!(0))) { |
| 30591 | BalaExpression* _tmp163_; |
| 30592 | BalaExpression* _tmp164_; |
| 30593 | BalaExpression* _tmp165_; |
| 30594 | BalaExpression* _tmp166_; |
| 30595 | _tmp163_ = inner_expr; |
| 30596 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp163_, BALA_TYPE_CAST_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp163_); GType __t = ((bala_cast_expression_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 30597 | break; |
| 30598 | } |
| 30599 | _tmp164_ = inner_expr; |
| 30600 | _tmp165_ = bala_cast_expression_get_inner (G_TYPE_CHECK_INSTANCE_CAST (_tmp164_, BALA_TYPE_CAST_EXPRESSION, BalaCastExpression)(((BalaCastExpression*) g_type_check_instance_cast ((GTypeInstance *) (_tmp164_), ((bala_cast_expression_get_type ())))))); |
| 30601 | _tmp166_ = _tmp165_; |
| 30602 | inner_expr = _tmp166_; |
| 30603 | } |
| 30604 | _tmp168_ = inner_expr; |
| 30605 | _tmp169_ = bala_expression_get_value_type (_tmp168_); |
| 30606 | _tmp170_ = _tmp169_; |
| 30607 | _tmp171_ = bala_data_type_get_value_owned (_tmp170_); |
| 30608 | _tmp172_ = _tmp171_; |
| 30609 | if (_tmp172_) { |
| 30610 | gboolean _tmp173_ = FALSE(0); |
| 30611 | BalaExpression* _tmp174_; |
| 30612 | BalaSymbol* _tmp175_; |
| 30613 | BalaSymbol* _tmp176_; |
| 30614 | _tmp174_ = inner_expr; |
| 30615 | _tmp175_ = bala_expression_get_symbol_reference (_tmp174_); |
| 30616 | _tmp176_ = _tmp175_; |
| 30617 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp176_, BALA_TYPE_VARIABLE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp176_); GType __t = ((bala_variable_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 30618 | _tmp173_ = TRUE(!(0)); |
| 30619 | } else { |
| 30620 | BalaExpression* _tmp177_; |
| 30621 | _tmp177_ = inner_expr; |
| 30622 | _tmp173_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp177_, BALA_TYPE_ELEMENT_ACCESS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp177_); GType __t = ((bala_element_access_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 30623 | } |
| 30624 | _tmp167_ = !_tmp173_; |
| 30625 | } else { |
| 30626 | _tmp167_ = FALSE(0); |
| 30627 | } |
| 30628 | if (_tmp167_) { |
| 30629 | BalaGLibValue* value = NULL((void*)0); |
| 30630 | BalaVoidType* _tmp178_; |
| 30631 | BalaVoidType* _tmp179_; |
| 30632 | BalaPointerType* _tmp180_; |
| 30633 | BalaPointerType* _tmp181_; |
| 30634 | BalaCCodeExpression* _tmp182_; |
| 30635 | BalaGLibValue* _tmp183_; |
| 30636 | BalaGLibValue* _tmp184_; |
| 30637 | BalaArrayList* _tmp185_; |
| 30638 | BalaArrayList* _tmp186_; |
| 30639 | BalaGLibValue* _tmp187_; |
| 30640 | _tmp178_ = bala_void_type_new (NULL((void*)0)); |
| 30641 | _tmp179_ = _tmp178_; |
| 30642 | _tmp180_ = bala_pointer_type_new ((BalaDataType*) _tmp179_, NULL((void*)0)); |
| 30643 | _tmp181_ = _tmp180_; |
| 30644 | _tmp182_ = innercexpr; |
| 30645 | _tmp183_ = bala_glib_value_new ((BalaDataType*) _tmp181_, _tmp182_, FALSE(0)); |
| 30646 | _tmp184_ = _tmp183_; |
| 30647 | _bala_code_node_unref0 (_tmp181_)((_tmp181_ == ((void*)0)) ? ((void*)0) : (_tmp181_ = (bala_code_node_unref (_tmp181_), ((void*)0)))); |
| 30648 | _bala_code_node_unref0 (_tmp179_)((_tmp179_ == ((void*)0)) ? ((void*)0) : (_tmp179_ = (bala_code_node_unref (_tmp179_), ((void*)0)))); |
| 30649 | value = _tmp184_; |
| 30650 | _tmp185_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 30651 | _tmp186_ = _tmp185_; |
| 30652 | _tmp187_ = value; |
| 30653 | bala_list_insert ((BalaList*) _tmp186_, 0, (BalaTargetValue*) _tmp187_); |
| 30654 | _bala_target_value_unref0 (value)((value == ((void*)0)) ? ((void*)0) : (value = (bala_target_value_unref (value), ((void*)0)))); |
| 30655 | } |
| 30656 | _tmp188_ = innercexpr; |
| 30657 | _tmp189_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp188_); |
| 30658 | _bala_ccode_node_unref0 (innercexpr)((innercexpr == ((void*)0)) ? ((void*)0) : (innercexpr = (bala_ccode_node_unref (innercexpr), ((void*)0)))); |
| 30659 | innercexpr = (BalaCCodeExpression*) _tmp189_; |
| 30660 | } else { |
| 30661 | gboolean _tmp190_ = FALSE(0); |
| 30662 | gboolean _tmp191_ = FALSE(0); |
| 30663 | BalaDataType* _tmp192_; |
| 30664 | BalaDataType* _tmp193_; |
| 30665 | _tmp192_ = bala_cast_expression_get_type_reference (expr); |
| 30666 | _tmp193_ = _tmp192_; |
| 30667 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp193_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp193_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 30668 | BalaDataType* _tmp194_; |
| 30669 | BalaDataType* _tmp195_; |
| 30670 | gboolean _tmp196_; |
| 30671 | gboolean _tmp197_; |
| 30672 | _tmp194_ = bala_cast_expression_get_type_reference (expr); |
| 30673 | _tmp195_ = _tmp194_; |
| 30674 | _tmp196_ = bala_data_type_get_nullable (_tmp195_); |
| 30675 | _tmp197_ = _tmp196_; |
| 30676 | _tmp191_ = _tmp197_; |
| 30677 | } else { |
| 30678 | _tmp191_ = FALSE(0); |
| 30679 | } |
| 30680 | if (_tmp191_) { |
| 30681 | BalaExpression* _tmp198_; |
| 30682 | BalaExpression* _tmp199_; |
| 30683 | BalaDataType* _tmp200_; |
| 30684 | BalaDataType* _tmp201_; |
| 30685 | _tmp198_ = bala_cast_expression_get_inner (expr); |
| 30686 | _tmp199_ = _tmp198_; |
| 30687 | _tmp200_ = bala_expression_get_value_type (_tmp199_); |
| 30688 | _tmp201_ = _tmp200_; |
| 30689 | _tmp190_ = bala_data_type_is_real_non_null_struct_type (_tmp201_); |
| 30690 | } else { |
| 30691 | _tmp190_ = FALSE(0); |
| 30692 | } |
| 30693 | if (_tmp190_) { |
| 30694 | BalaCCodeExpression* _tmp202_; |
| 30695 | BalaCCodeUnaryExpression* _tmp203_; |
| 30696 | _tmp202_ = innercexpr; |
| 30697 | _tmp203_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp202_); |
| 30698 | _bala_ccode_node_unref0 (innercexpr)((innercexpr == ((void*)0)) ? ((void*)0) : (innercexpr = (bala_ccode_node_unref (innercexpr), ((void*)0)))); |
| 30699 | innercexpr = (BalaCCodeExpression*) _tmp203_; |
| 30700 | } else { |
| 30701 | gboolean _tmp204_ = FALSE(0); |
| 30702 | gboolean _tmp205_ = FALSE(0); |
| 30703 | gboolean _tmp206_ = FALSE(0); |
| 30704 | BalaDataType* _tmp207_; |
| 30705 | BalaDataType* _tmp208_; |
| 30706 | _tmp207_ = bala_cast_expression_get_type_reference (expr); |
| 30707 | _tmp208_ = _tmp207_; |
| 30708 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp208_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp208_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 30709 | BalaExpression* _tmp209_; |
| 30710 | BalaExpression* _tmp210_; |
| 30711 | _tmp209_ = bala_cast_expression_get_inner (expr); |
| 30712 | _tmp210_ = _tmp209_; |
| 30713 | _tmp206_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp210_, BALA_TYPE_LITERAL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp210_); GType __t = ((bala_literal_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 30714 | } else { |
| 30715 | _tmp206_ = FALSE(0); |
| 30716 | } |
| 30717 | if (_tmp206_) { |
| 30718 | BalaExpression* _tmp211_; |
| 30719 | BalaExpression* _tmp212_; |
| 30720 | BalaDataType* _tmp213_; |
| 30721 | BalaDataType* _tmp214_; |
| 30722 | _tmp211_ = bala_cast_expression_get_inner (expr); |
| 30723 | _tmp212_ = _tmp211_; |
| 30724 | _tmp213_ = bala_expression_get_value_type (_tmp212_); |
| 30725 | _tmp214_ = _tmp213_; |
| 30726 | _tmp205_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp214_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp214_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 30727 | } else { |
| 30728 | _tmp205_ = FALSE(0); |
| 30729 | } |
| 30730 | if (_tmp205_) { |
| 30731 | BalaExpression* _tmp215_; |
| 30732 | BalaExpression* _tmp216_; |
| 30733 | BalaDataType* _tmp217_; |
| 30734 | BalaDataType* _tmp218_; |
| 30735 | gboolean _tmp219_; |
| 30736 | gboolean _tmp220_; |
| 30737 | _tmp215_ = bala_cast_expression_get_inner (expr); |
| 30738 | _tmp216_ = _tmp215_; |
| 30739 | _tmp217_ = bala_expression_get_value_type (_tmp216_); |
| 30740 | _tmp218_ = _tmp217_; |
| 30741 | _tmp219_ = bala_data_type_get_nullable (_tmp218_); |
| 30742 | _tmp220_ = _tmp219_; |
| 30743 | _tmp204_ = !_tmp220_; |
| 30744 | } else { |
| 30745 | _tmp204_ = FALSE(0); |
| 30746 | } |
| 30747 | if (_tmp204_) { |
| 30748 | BalaCCodeExpression* _tmp221_; |
| 30749 | BalaCCodeUnaryExpression* _tmp222_; |
| 30750 | _tmp221_ = innercexpr; |
| 30751 | _tmp222_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp221_); |
| 30752 | _bala_ccode_node_unref0 (innercexpr)((innercexpr == ((void*)0)) ? ((void*)0) : (innercexpr = (bala_ccode_node_unref (innercexpr), ((void*)0)))); |
| 30753 | innercexpr = (BalaCCodeExpression*) _tmp222_; |
| 30754 | } |
| 30755 | } |
| 30756 | } |
| 30757 | _tmp223_ = innercexpr; |
| 30758 | _tmp224_ = bala_cast_expression_get_type_reference (expr); |
| 30759 | _tmp225_ = _tmp224_; |
| 30760 | _tmp226_ = bala_get_ccode_name ((BalaCodeNode*) _tmp225_); |
| 30761 | _tmp227_ = _tmp226_; |
| 30762 | _tmp228_ = bala_ccode_cast_expression_new (_tmp223_, _tmp227_); |
| 30763 | _tmp229_ = _tmp228_; |
| 30764 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp229_); |
| 30765 | _bala_ccode_node_unref0 (_tmp229_)((_tmp229_ == ((void*)0)) ? ((void*)0) : (_tmp229_ = (bala_ccode_node_unref (_tmp229_), ((void*)0)))); |
| 30766 | _g_free0 (_tmp227_)(_tmp227_ = (g_free (_tmp227_), ((void*)0))); |
| 30767 | _tmp230_ = bala_cast_expression_get_type_reference (expr); |
| 30768 | _tmp231_ = _tmp230_; |
| 30769 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp231_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp231_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 30770 | BalaCCodeExpression* target = NULL((void*)0); |
| 30771 | BalaExpression* _tmp232_; |
| 30772 | BalaExpression* _tmp233_; |
| 30773 | BalaCCodeExpression* _tmp234_; |
| 30774 | BalaCCodeExpression* _tmp235_; |
| 30775 | BalaCCodeExpression* _tmp236_; |
| 30776 | BalaCCodeExpression* target_destroy_notify = NULL((void*)0); |
| 30777 | BalaExpression* _tmp240_; |
| 30778 | BalaExpression* _tmp241_; |
| 30779 | BalaCCodeExpression* _tmp242_; |
| 30780 | BalaCCodeExpression* _tmp243_; |
| 30781 | BalaCCodeExpression* _tmp244_; |
| 30782 | _tmp232_ = bala_cast_expression_get_inner (expr); |
| 30783 | _tmp233_ = _tmp232_; |
| 30784 | _tmp234_ = bala_get_delegate_target (_tmp233_); |
| 30785 | _tmp235_ = _bala_ccode_node_ref0 (_tmp234_); |
| 30786 | target = _tmp235_; |
| 30787 | _tmp236_ = target; |
| 30788 | if (_tmp236_ != NULL((void*)0)) { |
| 30789 | BalaCCodeExpression* _tmp237_; |
| 30790 | _tmp237_ = target; |
| 30791 | bala_set_delegate_target ((BalaExpression*) expr, _tmp237_); |
| 30792 | } else { |
| 30793 | BalaCCodeConstant* _tmp238_; |
| 30794 | BalaCCodeConstant* _tmp239_; |
| 30795 | _tmp238_ = bala_ccode_constant_new ("NULL"); |
| 30796 | _tmp239_ = _tmp238_; |
| 30797 | bala_set_delegate_target ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp239_); |
| 30798 | _bala_ccode_node_unref0 (_tmp239_)((_tmp239_ == ((void*)0)) ? ((void*)0) : (_tmp239_ = (bala_ccode_node_unref (_tmp239_), ((void*)0)))); |
| 30799 | } |
| 30800 | _tmp240_ = bala_cast_expression_get_inner (expr); |
| 30801 | _tmp241_ = _tmp240_; |
| 30802 | _tmp242_ = bala_get_delegate_target_destroy_notify (_tmp241_); |
| 30803 | _tmp243_ = _bala_ccode_node_ref0 (_tmp242_); |
| 30804 | target_destroy_notify = _tmp243_; |
| 30805 | _tmp244_ = target_destroy_notify; |
| 30806 | if (_tmp244_ != NULL((void*)0)) { |
| 30807 | BalaCCodeExpression* _tmp245_; |
| 30808 | _tmp245_ = target_destroy_notify; |
| 30809 | bala_set_delegate_target_destroy_notify ((BalaExpression*) expr, _tmp245_); |
| 30810 | } else { |
| 30811 | BalaCCodeConstant* _tmp246_; |
| 30812 | BalaCCodeConstant* _tmp247_; |
| 30813 | _tmp246_ = bala_ccode_constant_new ("NULL"); |
| 30814 | _tmp247_ = _tmp246_; |
| 30815 | bala_set_delegate_target_destroy_notify ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp247_); |
| 30816 | _bala_ccode_node_unref0 (_tmp247_)((_tmp247_ == ((void*)0)) ? ((void*)0) : (_tmp247_ = (bala_ccode_node_unref (_tmp247_), ((void*)0)))); |
| 30817 | } |
| 30818 | _bala_ccode_node_unref0 (target_destroy_notify)((target_destroy_notify == ((void*)0)) ? ((void*)0) : (target_destroy_notify = (bala_ccode_node_unref (target_destroy_notify), ((void*)0) ))); |
| 30819 | _bala_ccode_node_unref0 (target)((target == ((void*)0)) ? ((void*)0) : (target = (bala_ccode_node_unref (target), ((void*)0)))); |
| 30820 | } |
| 30821 | _bala_ccode_node_unref0 (innercexpr)((innercexpr == ((void*)0)) ? ((void*)0) : (innercexpr = (bala_ccode_node_unref (innercexpr), ((void*)0)))); |
| 30822 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 30823 | } |
| 30824 | |
| 30825 | static void |
| 30826 | bala_ccode_base_module_real_visit_named_argument (BalaCodeVisitor* base, |
| 30827 | BalaNamedArgument* expr) |
| 30828 | { |
| 30829 | BalaCCodeBaseModule * self; |
| 30830 | BalaExpression* _tmp0_; |
| 30831 | BalaExpression* _tmp1_; |
| 30832 | BalaCCodeExpression* _tmp2_; |
| 30833 | self = (BalaCCodeBaseModule*) base; |
| 30834 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 30835 | _tmp0_ = bala_named_argument_get_inner (expr); |
| 30836 | _tmp1_ = _tmp0_; |
| 30837 | _tmp2_ = bala_get_cvalue (_tmp1_); |
| 30838 | bala_set_cvalue ((BalaExpression*) expr, _tmp2_); |
| 30839 | } |
| 30840 | |
| 30841 | static void |
| 30842 | bala_ccode_base_module_real_visit_pointer_indirection (BalaCodeVisitor* base, |
| 30843 | BalaPointerIndirection* expr) |
| 30844 | { |
| 30845 | BalaCCodeBaseModule * self; |
| 30846 | BalaExpression* _tmp0_; |
| 30847 | BalaExpression* _tmp1_; |
| 30848 | BalaCCodeExpression* _tmp2_; |
| 30849 | BalaCCodeUnaryExpression* _tmp3_; |
| 30850 | BalaCCodeUnaryExpression* _tmp4_; |
| 30851 | BalaTargetValue* _tmp5_; |
| 30852 | BalaTargetValue* _tmp6_; |
| 30853 | BalaExpression* _tmp7_; |
| 30854 | BalaExpression* _tmp8_; |
| 30855 | BalaTargetValue* _tmp9_; |
| 30856 | BalaTargetValue* _tmp10_; |
| 30857 | self = (BalaCCodeBaseModule*) base; |
| 30858 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 30859 | _tmp0_ = bala_pointer_indirection_get_inner (expr); |
| 30860 | _tmp1_ = _tmp0_; |
| 30861 | _tmp2_ = bala_get_cvalue (_tmp1_); |
| 30862 | _tmp3_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp2_); |
| 30863 | _tmp4_ = _tmp3_; |
| 30864 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp4_); |
| 30865 | _bala_ccode_node_unref0 (_tmp4_)((_tmp4_ == ((void*)0)) ? ((void*)0) : (_tmp4_ = (bala_ccode_node_unref (_tmp4_), ((void*)0)))); |
| 30866 | _tmp5_ = bala_expression_get_target_value ((BalaExpression*) expr); |
| 30867 | _tmp6_ = _tmp5_; |
| 30868 | _tmp7_ = bala_pointer_indirection_get_inner (expr); |
| 30869 | _tmp8_ = _tmp7_; |
| 30870 | _tmp9_ = bala_expression_get_target_value (_tmp8_); |
| 30871 | _tmp10_ = _tmp9_; |
| 30872 | G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp6_), ((bala_glib_value_get_type ())))))->lvalue = bala_get_lvalue (_tmp10_); |
| 30873 | } |
| 30874 | |
| 30875 | static void |
| 30876 | bala_ccode_base_module_real_visit_addressof_expression (BalaCodeVisitor* base, |
| 30877 | BalaAddressofExpression* expr) |
| 30878 | { |
| 30879 | BalaCCodeBaseModule * self; |
| 30880 | BalaExpression* _tmp0_; |
| 30881 | BalaExpression* _tmp1_; |
| 30882 | BalaCCodeExpression* _tmp2_; |
| 30883 | BalaCCodeUnaryExpression* _tmp3_; |
| 30884 | BalaCCodeUnaryExpression* _tmp4_; |
| 30885 | self = (BalaCCodeBaseModule*) base; |
| 30886 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 30887 | _tmp0_ = bala_addressof_expression_get_inner (expr); |
| 30888 | _tmp1_ = _tmp0_; |
| 30889 | _tmp2_ = bala_get_cvalue (_tmp1_); |
| 30890 | _tmp3_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp2_); |
| 30891 | _tmp4_ = _tmp3_; |
| 30892 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp4_); |
| 30893 | _bala_ccode_node_unref0 (_tmp4_)((_tmp4_ == ((void*)0)) ? ((void*)0) : (_tmp4_ = (bala_ccode_node_unref (_tmp4_), ((void*)0)))); |
| 30894 | } |
| 30895 | |
| 30896 | static void |
| 30897 | bala_ccode_base_module_real_visit_reference_transfer_expression (BalaCodeVisitor* base, |
| 30898 | BalaReferenceTransferExpression* expr) |
| 30899 | { |
| 30900 | BalaCCodeBaseModule * self; |
| 30901 | BalaExpression* _tmp0_; |
| 30902 | BalaExpression* _tmp1_; |
| 30903 | BalaTargetValue* _tmp2_; |
| 30904 | BalaTargetValue* _tmp3_; |
| 30905 | BalaTargetValue* _tmp4_; |
| 30906 | BalaTargetValue* _tmp5_; |
| 30907 | gboolean _tmp6_ = FALSE(0); |
| 30908 | BalaExpression* _tmp7_; |
| 30909 | BalaExpression* _tmp8_; |
| 30910 | BalaDataType* _tmp9_; |
| 30911 | BalaDataType* _tmp10_; |
| 30912 | self = (BalaCCodeBaseModule*) base; |
| 30913 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 30914 | _tmp0_ = bala_reference_transfer_expression_get_inner (expr); |
| 30915 | _tmp1_ = _tmp0_; |
| 30916 | _tmp2_ = bala_expression_get_target_value (_tmp1_); |
| 30917 | _tmp3_ = _tmp2_; |
| 30918 | _tmp4_ = bala_ccode_base_module_store_temp_value (self, _tmp3_, (BalaCodeNode*) expr, NULL((void*)0)); |
| 30919 | _tmp5_ = _tmp4_; |
| 30920 | bala_expression_set_target_value ((BalaExpression*) expr, _tmp5_); |
| 30921 | _bala_target_value_unref0 (_tmp5_)((_tmp5_ == ((void*)0)) ? ((void*)0) : (_tmp5_ = (bala_target_value_unref (_tmp5_), ((void*)0)))); |
| 30922 | _tmp7_ = bala_reference_transfer_expression_get_inner (expr); |
| 30923 | _tmp8_ = _tmp7_; |
| 30924 | _tmp9_ = bala_expression_get_value_type (_tmp8_); |
| 30925 | _tmp10_ = _tmp9_; |
| 30926 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, BALA_TYPE_STRUCT_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp10_); GType __t = ((bala_struct_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 30927 | BalaExpression* _tmp11_; |
| 30928 | BalaExpression* _tmp12_; |
| 30929 | BalaDataType* _tmp13_; |
| 30930 | BalaDataType* _tmp14_; |
| 30931 | gboolean _tmp15_; |
| 30932 | gboolean _tmp16_; |
| 30933 | _tmp11_ = bala_reference_transfer_expression_get_inner (expr); |
| 30934 | _tmp12_ = _tmp11_; |
| 30935 | _tmp13_ = bala_expression_get_value_type (_tmp12_); |
| 30936 | _tmp14_ = _tmp13_; |
| 30937 | _tmp15_ = bala_data_type_get_nullable (_tmp14_); |
| 30938 | _tmp16_ = _tmp15_; |
| 30939 | _tmp6_ = !_tmp16_; |
| 30940 | } else { |
| 30941 | _tmp6_ = FALSE(0); |
| 30942 | } |
| 30943 | if (_tmp6_) { |
| 30944 | BalaCCodeFile* _tmp17_; |
| 30945 | BalaCCodeFunctionCall* creation_call = NULL((void*)0); |
| 30946 | BalaCCodeIdentifier* _tmp18_; |
| 30947 | BalaCCodeIdentifier* _tmp19_; |
| 30948 | BalaCCodeFunctionCall* _tmp20_; |
| 30949 | BalaCCodeFunctionCall* _tmp21_; |
| 30950 | BalaCCodeFunctionCall* _tmp22_; |
| 30951 | BalaExpression* _tmp23_; |
| 30952 | BalaExpression* _tmp24_; |
| 30953 | BalaCCodeExpression* _tmp25_; |
| 30954 | BalaCCodeUnaryExpression* _tmp26_; |
| 30955 | BalaCCodeUnaryExpression* _tmp27_; |
| 30956 | BalaCCodeFunctionCall* _tmp28_; |
| 30957 | BalaCCodeConstant* _tmp29_; |
| 30958 | BalaCCodeConstant* _tmp30_; |
| 30959 | BalaCCodeFunctionCall* _tmp31_; |
| 30960 | BalaExpression* _tmp32_; |
| 30961 | BalaExpression* _tmp33_; |
| 30962 | BalaDataType* _tmp34_; |
| 30963 | BalaDataType* _tmp35_; |
| 30964 | gchar* _tmp36_; |
| 30965 | gchar* _tmp37_; |
| 30966 | gchar* _tmp38_; |
| 30967 | gchar* _tmp39_; |
| 30968 | BalaCCodeIdentifier* _tmp40_; |
| 30969 | BalaCCodeIdentifier* _tmp41_; |
| 30970 | BalaCCodeFunction* _tmp42_; |
| 30971 | BalaCCodeFunction* _tmp43_; |
| 30972 | BalaCCodeFunctionCall* _tmp44_; |
| 30973 | _tmp17_ = self->cfile; |
| 30974 | bala_ccode_file_add_include (_tmp17_, "string.h", FALSE(0)); |
| 30975 | _tmp18_ = bala_ccode_identifier_new ("memset"); |
| 30976 | _tmp19_ = _tmp18_; |
| 30977 | _tmp20_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp19_); |
| 30978 | _tmp21_ = _tmp20_; |
| 30979 | _bala_ccode_node_unref0 (_tmp19_)((_tmp19_ == ((void*)0)) ? ((void*)0) : (_tmp19_ = (bala_ccode_node_unref (_tmp19_), ((void*)0)))); |
| 30980 | creation_call = _tmp21_; |
| 30981 | _tmp22_ = creation_call; |
| 30982 | _tmp23_ = bala_reference_transfer_expression_get_inner (expr); |
| 30983 | _tmp24_ = _tmp23_; |
| 30984 | _tmp25_ = bala_get_cvalue (_tmp24_); |
| 30985 | _tmp26_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp25_); |
| 30986 | _tmp27_ = _tmp26_; |
| 30987 | bala_ccode_function_call_add_argument (_tmp22_, (BalaCCodeExpression*) _tmp27_); |
| 30988 | _bala_ccode_node_unref0 (_tmp27_)((_tmp27_ == ((void*)0)) ? ((void*)0) : (_tmp27_ = (bala_ccode_node_unref (_tmp27_), ((void*)0)))); |
| 30989 | _tmp28_ = creation_call; |
| 30990 | _tmp29_ = bala_ccode_constant_new ("0"); |
| 30991 | _tmp30_ = _tmp29_; |
| 30992 | bala_ccode_function_call_add_argument (_tmp28_, (BalaCCodeExpression*) _tmp30_); |
| 30993 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 30994 | _tmp31_ = creation_call; |
| 30995 | _tmp32_ = bala_reference_transfer_expression_get_inner (expr); |
| 30996 | _tmp33_ = _tmp32_; |
| 30997 | _tmp34_ = bala_expression_get_value_type (_tmp33_); |
| 30998 | _tmp35_ = _tmp34_; |
| 30999 | _tmp36_ = bala_get_ccode_name ((BalaCodeNode*) _tmp35_); |
| 31000 | _tmp37_ = _tmp36_; |
| 31001 | _tmp38_ = g_strdup_printf ("sizeof (%s)", _tmp37_); |
| 31002 | _tmp39_ = _tmp38_; |
| 31003 | _tmp40_ = bala_ccode_identifier_new (_tmp39_); |
| 31004 | _tmp41_ = _tmp40_; |
| 31005 | bala_ccode_function_call_add_argument (_tmp31_, (BalaCCodeExpression*) _tmp41_); |
| 31006 | _bala_ccode_node_unref0 (_tmp41_)((_tmp41_ == ((void*)0)) ? ((void*)0) : (_tmp41_ = (bala_ccode_node_unref (_tmp41_), ((void*)0)))); |
| 31007 | _g_free0 (_tmp39_)(_tmp39_ = (g_free (_tmp39_), ((void*)0))); |
| 31008 | _g_free0 (_tmp37_)(_tmp37_ = (g_free (_tmp37_), ((void*)0))); |
| 31009 | _tmp42_ = bala_ccode_base_module_get_ccode (self); |
| 31010 | _tmp43_ = _tmp42_; |
| 31011 | _tmp44_ = creation_call; |
| 31012 | bala_ccode_function_add_expression (_tmp43_, (BalaCCodeExpression*) _tmp44_); |
| 31013 | _bala_ccode_node_unref0 (creation_call)((creation_call == ((void*)0)) ? ((void*)0) : (creation_call = (bala_ccode_node_unref (creation_call), ((void*)0)))); |
| 31014 | } else { |
| 31015 | BalaDataType* _tmp45_; |
| 31016 | BalaDataType* _tmp46_; |
| 31017 | _tmp45_ = bala_expression_get_value_type ((BalaExpression*) expr); |
| 31018 | _tmp46_ = _tmp45_; |
| 31019 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp46_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp46_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 31020 | BalaCCodeFunction* _tmp47_; |
| 31021 | BalaCCodeFunction* _tmp48_; |
| 31022 | BalaExpression* _tmp49_; |
| 31023 | BalaExpression* _tmp50_; |
| 31024 | BalaCCodeExpression* _tmp51_; |
| 31025 | BalaCCodeConstant* _tmp52_; |
| 31026 | BalaCCodeConstant* _tmp53_; |
| 31027 | BalaCCodeExpression* target = NULL((void*)0); |
| 31028 | BalaExpression* _tmp54_; |
| 31029 | BalaExpression* _tmp55_; |
| 31030 | BalaTargetValue* _tmp56_; |
| 31031 | BalaTargetValue* _tmp57_; |
| 31032 | BalaCCodeExpression* _tmp58_; |
| 31033 | BalaCCodeExpression* _tmp59_; |
| 31034 | BalaCCodeExpression* target_destroy_notify = NULL((void*)0); |
| 31035 | BalaExpression* _tmp65_; |
| 31036 | BalaExpression* _tmp66_; |
| 31037 | BalaTargetValue* _tmp67_; |
| 31038 | BalaTargetValue* _tmp68_; |
| 31039 | BalaCCodeExpression* _tmp69_; |
| 31040 | BalaCCodeExpression* _tmp70_; |
| 31041 | _tmp47_ = bala_ccode_base_module_get_ccode (self); |
| 31042 | _tmp48_ = _tmp47_; |
| 31043 | _tmp49_ = bala_reference_transfer_expression_get_inner (expr); |
| 31044 | _tmp50_ = _tmp49_; |
| 31045 | _tmp51_ = bala_get_cvalue (_tmp50_); |
| 31046 | _tmp52_ = bala_ccode_constant_new ("NULL"); |
| 31047 | _tmp53_ = _tmp52_; |
| 31048 | bala_ccode_function_add_assignment (_tmp48_, _tmp51_, (BalaCCodeExpression*) _tmp53_); |
| 31049 | _bala_ccode_node_unref0 (_tmp53_)((_tmp53_ == ((void*)0)) ? ((void*)0) : (_tmp53_ = (bala_ccode_node_unref (_tmp53_), ((void*)0)))); |
| 31050 | _tmp54_ = bala_reference_transfer_expression_get_inner (expr); |
| 31051 | _tmp55_ = _tmp54_; |
| 31052 | _tmp56_ = bala_expression_get_target_value (_tmp55_); |
| 31053 | _tmp57_ = _tmp56_; |
| 31054 | _tmp58_ = bala_ccode_base_module_get_delegate_target_cvalue (self, _tmp57_); |
| 31055 | target = _tmp58_; |
| 31056 | _tmp59_ = target; |
| 31057 | if (_tmp59_ != NULL((void*)0)) { |
| 31058 | BalaCCodeFunction* _tmp60_; |
| 31059 | BalaCCodeFunction* _tmp61_; |
| 31060 | BalaCCodeExpression* _tmp62_; |
| 31061 | BalaCCodeConstant* _tmp63_; |
| 31062 | BalaCCodeConstant* _tmp64_; |
| 31063 | _tmp60_ = bala_ccode_base_module_get_ccode (self); |
| 31064 | _tmp61_ = _tmp60_; |
| 31065 | _tmp62_ = target; |
| 31066 | _tmp63_ = bala_ccode_constant_new ("NULL"); |
| 31067 | _tmp64_ = _tmp63_; |
| 31068 | bala_ccode_function_add_assignment (_tmp61_, _tmp62_, (BalaCCodeExpression*) _tmp64_); |
| 31069 | _bala_ccode_node_unref0 (_tmp64_)((_tmp64_ == ((void*)0)) ? ((void*)0) : (_tmp64_ = (bala_ccode_node_unref (_tmp64_), ((void*)0)))); |
| 31070 | } |
| 31071 | _tmp65_ = bala_reference_transfer_expression_get_inner (expr); |
| 31072 | _tmp66_ = _tmp65_; |
| 31073 | _tmp67_ = bala_expression_get_target_value (_tmp66_); |
| 31074 | _tmp68_ = _tmp67_; |
| 31075 | _tmp69_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cvalue (self, _tmp68_); |
| 31076 | target_destroy_notify = _tmp69_; |
| 31077 | _tmp70_ = target_destroy_notify; |
| 31078 | if (_tmp70_ != NULL((void*)0)) { |
| 31079 | BalaCCodeFunction* _tmp71_; |
| 31080 | BalaCCodeFunction* _tmp72_; |
| 31081 | BalaCCodeExpression* _tmp73_; |
| 31082 | BalaCCodeConstant* _tmp74_; |
| 31083 | BalaCCodeConstant* _tmp75_; |
| 31084 | _tmp71_ = bala_ccode_base_module_get_ccode (self); |
| 31085 | _tmp72_ = _tmp71_; |
| 31086 | _tmp73_ = target_destroy_notify; |
| 31087 | _tmp74_ = bala_ccode_constant_new ("NULL"); |
| 31088 | _tmp75_ = _tmp74_; |
| 31089 | bala_ccode_function_add_assignment (_tmp72_, _tmp73_, (BalaCCodeExpression*) _tmp75_); |
| 31090 | _bala_ccode_node_unref0 (_tmp75_)((_tmp75_ == ((void*)0)) ? ((void*)0) : (_tmp75_ = (bala_ccode_node_unref (_tmp75_), ((void*)0)))); |
| 31091 | } |
| 31092 | _bala_ccode_node_unref0 (target_destroy_notify)((target_destroy_notify == ((void*)0)) ? ((void*)0) : (target_destroy_notify = (bala_ccode_node_unref (target_destroy_notify), ((void*)0) ))); |
| 31093 | _bala_ccode_node_unref0 (target)((target == ((void*)0)) ? ((void*)0) : (target = (bala_ccode_node_unref (target), ((void*)0)))); |
| 31094 | } else { |
| 31095 | BalaExpression* _tmp76_; |
| 31096 | BalaExpression* _tmp77_; |
| 31097 | BalaDataType* _tmp78_; |
| 31098 | BalaDataType* _tmp79_; |
| 31099 | _tmp76_ = bala_reference_transfer_expression_get_inner (expr); |
| 31100 | _tmp77_ = _tmp76_; |
| 31101 | _tmp78_ = bala_expression_get_value_type (_tmp77_); |
| 31102 | _tmp79_ = _tmp78_; |
| 31103 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp79_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp79_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 31104 | BalaArrayType* array_type = NULL((void*)0); |
| 31105 | BalaExpression* _tmp80_; |
| 31106 | BalaExpression* _tmp81_; |
| 31107 | BalaDataType* _tmp82_; |
| 31108 | BalaDataType* _tmp83_; |
| 31109 | BalaArrayType* _tmp84_; |
| 31110 | BalaGLibValue* glib_value = NULL((void*)0); |
| 31111 | BalaExpression* _tmp85_; |
| 31112 | BalaExpression* _tmp86_; |
| 31113 | BalaTargetValue* _tmp87_; |
| 31114 | BalaTargetValue* _tmp88_; |
| 31115 | BalaGLibValue* _tmp89_; |
| 31116 | BalaCCodeFunction* _tmp90_; |
| 31117 | BalaCCodeFunction* _tmp91_; |
| 31118 | BalaExpression* _tmp92_; |
| 31119 | BalaExpression* _tmp93_; |
| 31120 | BalaCCodeExpression* _tmp94_; |
| 31121 | BalaCCodeConstant* _tmp95_; |
| 31122 | BalaCCodeConstant* _tmp96_; |
| 31123 | BalaGLibValue* _tmp97_; |
| 31124 | BalaList* _tmp98_; |
| 31125 | _tmp80_ = bala_reference_transfer_expression_get_inner (expr); |
| 31126 | _tmp81_ = _tmp80_; |
| 31127 | _tmp82_ = bala_expression_get_value_type (_tmp81_); |
| 31128 | _tmp83_ = _tmp82_; |
| 31129 | _tmp84_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp83_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp83_), ((bala_array_type_get_type ())))))); |
| 31130 | array_type = _tmp84_; |
| 31131 | _tmp85_ = bala_reference_transfer_expression_get_inner (expr); |
| 31132 | _tmp86_ = _tmp85_; |
| 31133 | _tmp87_ = bala_expression_get_target_value (_tmp86_); |
| 31134 | _tmp88_ = _tmp87_; |
| 31135 | _tmp89_ = _bala_target_value_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp88_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp88_), ((bala_glib_value_get_type ())))))); |
| 31136 | glib_value = _tmp89_; |
| 31137 | _tmp90_ = bala_ccode_base_module_get_ccode (self); |
| 31138 | _tmp91_ = _tmp90_; |
| 31139 | _tmp92_ = bala_reference_transfer_expression_get_inner (expr); |
| 31140 | _tmp93_ = _tmp92_; |
| 31141 | _tmp94_ = bala_get_cvalue (_tmp93_); |
| 31142 | _tmp95_ = bala_ccode_constant_new ("NULL"); |
| 31143 | _tmp96_ = _tmp95_; |
| 31144 | bala_ccode_function_add_assignment (_tmp91_, _tmp94_, (BalaCCodeExpression*) _tmp96_); |
| 31145 | _bala_ccode_node_unref0 (_tmp96_)((_tmp96_ == ((void*)0)) ? ((void*)0) : (_tmp96_ = (bala_ccode_node_unref (_tmp96_), ((void*)0)))); |
| 31146 | _tmp97_ = glib_value; |
| 31147 | _tmp98_ = _tmp97_->array_length_cvalues; |
| 31148 | if (_tmp98_ != NULL((void*)0)) { |
| 31149 | { |
| 31150 | gint dim = 0; |
| 31151 | dim = 1; |
| 31152 | { |
| 31153 | gboolean _tmp99_ = FALSE(0); |
| 31154 | _tmp99_ = TRUE(!(0)); |
| 31155 | while (TRUE(!(0))) { |
| 31156 | BalaArrayType* _tmp101_; |
| 31157 | gint _tmp102_; |
| 31158 | gint _tmp103_; |
| 31159 | BalaCCodeFunction* _tmp104_; |
| 31160 | BalaCCodeFunction* _tmp105_; |
| 31161 | BalaGLibValue* _tmp106_; |
| 31162 | BalaCCodeExpression* _tmp107_; |
| 31163 | BalaCCodeExpression* _tmp108_; |
| 31164 | BalaCCodeConstant* _tmp109_; |
| 31165 | BalaCCodeConstant* _tmp110_; |
| 31166 | if (!_tmp99_) { |
| 31167 | gint _tmp100_; |
| 31168 | _tmp100_ = dim; |
| 31169 | dim = _tmp100_ + 1; |
| 31170 | } |
| 31171 | _tmp99_ = FALSE(0); |
| 31172 | _tmp101_ = array_type; |
| 31173 | _tmp102_ = bala_array_type_get_rank (_tmp101_); |
| 31174 | _tmp103_ = _tmp102_; |
| 31175 | if (!(dim <= _tmp103_)) { |
| 31176 | break; |
| 31177 | } |
| 31178 | _tmp104_ = bala_ccode_base_module_get_ccode (self); |
| 31179 | _tmp105_ = _tmp104_; |
| 31180 | _tmp106_ = glib_value; |
| 31181 | _tmp107_ = bala_ccode_base_module_get_array_length_cvalue (self, (BalaTargetValue*) _tmp106_, dim); |
| 31182 | _tmp108_ = _tmp107_; |
| 31183 | _tmp109_ = bala_ccode_constant_new ("0"); |
| 31184 | _tmp110_ = _tmp109_; |
| 31185 | bala_ccode_function_add_assignment (_tmp105_, _tmp108_, (BalaCCodeExpression*) _tmp110_); |
| 31186 | _bala_ccode_node_unref0 (_tmp110_)((_tmp110_ == ((void*)0)) ? ((void*)0) : (_tmp110_ = (bala_ccode_node_unref (_tmp110_), ((void*)0)))); |
| 31187 | _bala_ccode_node_unref0 (_tmp108_)((_tmp108_ == ((void*)0)) ? ((void*)0) : (_tmp108_ = (bala_ccode_node_unref (_tmp108_), ((void*)0)))); |
| 31188 | } |
| 31189 | } |
| 31190 | } |
| 31191 | } |
| 31192 | _bala_target_value_unref0 (glib_value)((glib_value == ((void*)0)) ? ((void*)0) : (glib_value = (bala_target_value_unref (glib_value), ((void*)0)))); |
| 31193 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 31194 | } else { |
| 31195 | BalaCCodeFunction* _tmp111_; |
| 31196 | BalaCCodeFunction* _tmp112_; |
| 31197 | BalaExpression* _tmp113_; |
| 31198 | BalaExpression* _tmp114_; |
| 31199 | BalaCCodeExpression* _tmp115_; |
| 31200 | BalaCCodeConstant* _tmp116_; |
| 31201 | BalaCCodeConstant* _tmp117_; |
| 31202 | _tmp111_ = bala_ccode_base_module_get_ccode (self); |
| 31203 | _tmp112_ = _tmp111_; |
| 31204 | _tmp113_ = bala_reference_transfer_expression_get_inner (expr); |
| 31205 | _tmp114_ = _tmp113_; |
| 31206 | _tmp115_ = bala_get_cvalue (_tmp114_); |
| 31207 | _tmp116_ = bala_ccode_constant_new ("NULL"); |
| 31208 | _tmp117_ = _tmp116_; |
| 31209 | bala_ccode_function_add_assignment (_tmp112_, _tmp115_, (BalaCCodeExpression*) _tmp117_); |
| 31210 | _bala_ccode_node_unref0 (_tmp117_)((_tmp117_ == ((void*)0)) ? ((void*)0) : (_tmp117_ = (bala_ccode_node_unref (_tmp117_), ((void*)0)))); |
| 31211 | } |
| 31212 | } |
| 31213 | } |
| 31214 | } |
| 31215 | |
| 31216 | static void |
| 31217 | bala_ccode_base_module_real_visit_binary_expression (BalaCodeVisitor* base, |
| 31218 | BalaBinaryExpression* expr) |
| 31219 | { |
| 31220 | BalaCCodeBaseModule * self; |
| 31221 | BalaCCodeExpression* cleft = NULL((void*)0); |
| 31222 | BalaExpression* _tmp0_; |
| 31223 | BalaExpression* _tmp1_; |
| 31224 | BalaCCodeExpression* _tmp2_; |
| 31225 | BalaCCodeExpression* _tmp3_; |
| 31226 | BalaCCodeExpression* cright = NULL((void*)0); |
| 31227 | BalaExpression* _tmp4_; |
| 31228 | BalaExpression* _tmp5_; |
| 31229 | BalaCCodeExpression* _tmp6_; |
| 31230 | BalaCCodeExpression* _tmp7_; |
| 31231 | BalaCCodeExpression* left_chain = NULL((void*)0); |
| 31232 | gboolean _tmp8_; |
| 31233 | gboolean _tmp9_; |
| 31234 | BalaCCodeBinaryOperator op = 0; |
| 31235 | BalaBinaryOperator _tmp51_; |
| 31236 | BalaBinaryOperator _tmp52_; |
| 31237 | gboolean _tmp154_ = FALSE(0); |
| 31238 | BalaBinaryOperator _tmp155_; |
| 31239 | BalaBinaryOperator _tmp156_; |
| 31240 | gboolean _tmp227_ = FALSE(0); |
| 31241 | gboolean _tmp228_ = FALSE(0); |
| 31242 | gboolean _tmp229_ = FALSE(0); |
| 31243 | BalaExpression* _tmp230_; |
| 31244 | BalaExpression* _tmp231_; |
| 31245 | BalaDataType* _tmp232_; |
| 31246 | BalaDataType* _tmp233_; |
| 31247 | gboolean is_string_comparison = FALSE(0); |
| 31248 | gboolean _tmp248_ = FALSE(0); |
| 31249 | BalaExpression* _tmp249_; |
| 31250 | BalaExpression* _tmp250_; |
| 31251 | gboolean has_string_literal = FALSE(0); |
| 31252 | gboolean _tmp253_ = FALSE(0); |
| 31253 | BalaCCodeBinaryOperator _tmp380_; |
| 31254 | BalaCCodeExpression* _tmp381_; |
| 31255 | BalaCCodeExpression* _tmp382_; |
| 31256 | BalaCCodeBinaryExpression* _tmp383_; |
| 31257 | BalaCCodeBinaryExpression* _tmp384_; |
| 31258 | BalaCCodeExpression* _tmp385_; |
| 31259 | self = (BalaCCodeBaseModule*) base; |
| 31260 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 31261 | _tmp0_ = bala_binary_expression_get_left (expr); |
| 31262 | _tmp1_ = _tmp0_; |
| 31263 | _tmp2_ = bala_get_cvalue (_tmp1_); |
| 31264 | _tmp3_ = _bala_ccode_node_ref0 (_tmp2_); |
| 31265 | cleft = _tmp3_; |
| 31266 | _tmp4_ = bala_binary_expression_get_right (expr); |
| 31267 | _tmp5_ = _tmp4_; |
| 31268 | _tmp6_ = bala_get_cvalue (_tmp5_); |
| 31269 | _tmp7_ = _bala_ccode_node_ref0 (_tmp6_); |
| 31270 | cright = _tmp7_; |
| 31271 | left_chain = NULL((void*)0); |
| 31272 | _tmp8_ = bala_binary_expression_get_is_chained (expr); |
| 31273 | _tmp9_ = _tmp8_; |
| 31274 | if (_tmp9_) { |
| 31275 | BalaBinaryExpression* lbe = NULL((void*)0); |
| 31276 | BalaExpression* _tmp10_; |
| 31277 | BalaExpression* _tmp11_; |
| 31278 | BalaBinaryExpression* _tmp12_; |
| 31279 | BalaLocalVariable* temp_decl = NULL((void*)0); |
| 31280 | BalaBinaryExpression* _tmp13_; |
| 31281 | BalaExpression* _tmp14_; |
| 31282 | BalaExpression* _tmp15_; |
| 31283 | BalaDataType* _tmp16_; |
| 31284 | BalaDataType* _tmp17_; |
| 31285 | BalaLocalVariable* _tmp18_; |
| 31286 | BalaLocalVariable* _tmp19_; |
| 31287 | BalaCCodeExpression* cvar = NULL((void*)0); |
| 31288 | BalaLocalVariable* _tmp20_; |
| 31289 | const gchar* _tmp21_; |
| 31290 | const gchar* _tmp22_; |
| 31291 | BalaCCodeExpression* _tmp23_; |
| 31292 | BalaCCodeBinaryExpression* clbe = NULL((void*)0); |
| 31293 | BalaBinaryExpression* _tmp24_; |
| 31294 | BalaCCodeExpression* _tmp25_; |
| 31295 | BalaCCodeBinaryExpression* _tmp26_; |
| 31296 | BalaBinaryExpression* _tmp27_; |
| 31297 | gboolean _tmp28_; |
| 31298 | gboolean _tmp29_; |
| 31299 | BalaCCodeFunction* _tmp34_; |
| 31300 | BalaCCodeFunction* _tmp35_; |
| 31301 | BalaCCodeExpression* _tmp36_; |
| 31302 | BalaBinaryExpression* _tmp37_; |
| 31303 | BalaExpression* _tmp38_; |
| 31304 | BalaExpression* _tmp39_; |
| 31305 | BalaCCodeExpression* _tmp40_; |
| 31306 | BalaCCodeBinaryExpression* _tmp41_; |
| 31307 | BalaLocalVariable* _tmp42_; |
| 31308 | const gchar* _tmp43_; |
| 31309 | const gchar* _tmp44_; |
| 31310 | BalaCCodeExpression* _tmp45_; |
| 31311 | BalaCCodeExpression* _tmp46_; |
| 31312 | BalaCCodeExpression* _tmp47_; |
| 31313 | BalaCCodeExpression* _tmp48_; |
| 31314 | BalaCCodeExpression* _tmp49_; |
| 31315 | BalaCCodeExpression* _tmp50_; |
| 31316 | _tmp10_ = bala_binary_expression_get_left (expr); |
| 31317 | _tmp11_ = _tmp10_; |
| 31318 | _tmp12_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, BALA_TYPE_BINARY_EXPRESSION, BalaBinaryExpression)(((BalaBinaryExpression*) g_type_check_instance_cast ((GTypeInstance *) (_tmp11_), ((bala_binary_expression_get_type ())))))); |
| 31319 | lbe = _tmp12_; |
| 31320 | _tmp13_ = lbe; |
| 31321 | _tmp14_ = bala_binary_expression_get_right (_tmp13_); |
| 31322 | _tmp15_ = _tmp14_; |
| 31323 | _tmp16_ = bala_expression_get_target_type (_tmp15_); |
| 31324 | _tmp17_ = _tmp16_; |
| 31325 | _tmp18_ = bala_ccode_base_module_get_temp_variable (self, _tmp17_, TRUE(!(0)), NULL((void*)0), FALSE(0)); |
| 31326 | temp_decl = _tmp18_; |
| 31327 | _tmp19_ = temp_decl; |
| 31328 | bala_ccode_base_module_emit_temp_var (self, _tmp19_, FALSE(0)); |
| 31329 | _tmp20_ = temp_decl; |
| 31330 | _tmp21_ = bala_symbol_get_name ((BalaSymbol*) _tmp20_); |
| 31331 | _tmp22_ = _tmp21_; |
| 31332 | _tmp23_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp22_); |
| 31333 | cvar = _tmp23_; |
| 31334 | _tmp24_ = lbe; |
| 31335 | _tmp25_ = bala_get_cvalue ((BalaExpression*) _tmp24_); |
| 31336 | _tmp26_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, BALA_TYPE_CCODE_BINARY_EXPRESSION, BalaCCodeBinaryExpression)(((BalaCCodeBinaryExpression*) g_type_check_instance_cast ((GTypeInstance *) (_tmp25_), ((bala_ccode_binary_expression_get_type ())))))); |
| 31337 | clbe = _tmp26_; |
| 31338 | _tmp27_ = lbe; |
| 31339 | _tmp28_ = bala_binary_expression_get_is_chained (_tmp27_); |
| 31340 | _tmp29_ = _tmp28_; |
| 31341 | if (_tmp29_) { |
| 31342 | BalaCCodeBinaryExpression* _tmp30_; |
| 31343 | BalaCCodeExpression* _tmp31_; |
| 31344 | BalaCCodeExpression* _tmp32_; |
| 31345 | BalaCCodeBinaryExpression* _tmp33_; |
| 31346 | _tmp30_ = clbe; |
| 31347 | _tmp31_ = bala_ccode_binary_expression_get_right (_tmp30_); |
| 31348 | _tmp32_ = _tmp31_; |
| 31349 | _tmp33_ = _bala_ccode_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, BALA_TYPE_CCODE_BINARY_EXPRESSION, BalaCCodeBinaryExpression)(((BalaCCodeBinaryExpression*) g_type_check_instance_cast ((GTypeInstance *) (_tmp32_), ((bala_ccode_binary_expression_get_type ())))))); |
| 31350 | _bala_ccode_node_unref0 (clbe)((clbe == ((void*)0)) ? ((void*)0) : (clbe = (bala_ccode_node_unref (clbe), ((void*)0)))); |
| 31351 | clbe = _tmp33_; |
| 31352 | } |
| 31353 | _tmp34_ = bala_ccode_base_module_get_ccode (self); |
| 31354 | _tmp35_ = _tmp34_; |
| 31355 | _tmp36_ = cvar; |
| 31356 | _tmp37_ = lbe; |
| 31357 | _tmp38_ = bala_binary_expression_get_right (_tmp37_); |
| 31358 | _tmp39_ = _tmp38_; |
| 31359 | _tmp40_ = bala_get_cvalue (_tmp39_); |
| 31360 | bala_ccode_function_add_assignment (_tmp35_, _tmp36_, _tmp40_); |
| 31361 | _tmp41_ = clbe; |
| 31362 | _tmp42_ = temp_decl; |
| 31363 | _tmp43_ = bala_symbol_get_name ((BalaSymbol*) _tmp42_); |
| 31364 | _tmp44_ = _tmp43_; |
| 31365 | _tmp45_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp44_); |
| 31366 | _tmp46_ = _tmp45_; |
| 31367 | bala_ccode_binary_expression_set_right (_tmp41_, _tmp46_); |
| 31368 | _bala_ccode_node_unref0 (_tmp46_)((_tmp46_ == ((void*)0)) ? ((void*)0) : (_tmp46_ = (bala_ccode_node_unref (_tmp46_), ((void*)0)))); |
| 31369 | _tmp47_ = cleft; |
| 31370 | _tmp48_ = _bala_ccode_node_ref0 (_tmp47_); |
| 31371 | _bala_ccode_node_unref0 (left_chain)((left_chain == ((void*)0)) ? ((void*)0) : (left_chain = (bala_ccode_node_unref (left_chain), ((void*)0)))); |
| 31372 | left_chain = _tmp48_; |
| 31373 | _tmp49_ = cvar; |
| 31374 | _tmp50_ = _bala_ccode_node_ref0 (_tmp49_); |
| 31375 | _bala_ccode_node_unref0 (cleft)((cleft == ((void*)0)) ? ((void*)0) : (cleft = (bala_ccode_node_unref (cleft), ((void*)0)))); |
| 31376 | cleft = _tmp50_; |
| 31377 | _bala_ccode_node_unref0 (clbe)((clbe == ((void*)0)) ? ((void*)0) : (clbe = (bala_ccode_node_unref (clbe), ((void*)0)))); |
| 31378 | _bala_ccode_node_unref0 (cvar)((cvar == ((void*)0)) ? ((void*)0) : (cvar = (bala_ccode_node_unref (cvar), ((void*)0)))); |
| 31379 | _bala_code_node_unref0 (temp_decl)((temp_decl == ((void*)0)) ? ((void*)0) : (temp_decl = (bala_code_node_unref (temp_decl), ((void*)0)))); |
| 31380 | _bala_code_node_unref0 (lbe)((lbe == ((void*)0)) ? ((void*)0) : (lbe = (bala_code_node_unref (lbe), ((void*)0)))); |
| 31381 | } |
| 31382 | _tmp51_ = bala_binary_expression_get_operator (expr); |
| 31383 | _tmp52_ = _tmp51_; |
| 31384 | switch (_tmp52_) { |
| 31385 | case BALA_BINARY_OPERATOR_PLUS: |
| 31386 | { |
| 31387 | op = BALA_CCODE_BINARY_OPERATOR_PLUS; |
| 31388 | break; |
| 31389 | } |
| 31390 | case BALA_BINARY_OPERATOR_MINUS: |
| 31391 | { |
| 31392 | op = BALA_CCODE_BINARY_OPERATOR_MINUS; |
| 31393 | break; |
| 31394 | } |
| 31395 | case BALA_BINARY_OPERATOR_MUL: |
| 31396 | { |
| 31397 | op = BALA_CCODE_BINARY_OPERATOR_MUL; |
| 31398 | break; |
| 31399 | } |
| 31400 | case BALA_BINARY_OPERATOR_DIV: |
| 31401 | { |
| 31402 | op = BALA_CCODE_BINARY_OPERATOR_DIV; |
| 31403 | break; |
| 31404 | } |
| 31405 | case BALA_BINARY_OPERATOR_MOD: |
| 31406 | { |
| 31407 | BalaDataType* _tmp53_; |
| 31408 | BalaDataType* _tmp54_; |
| 31409 | BalaDataType* _tmp55_; |
| 31410 | _tmp53_ = bala_expression_get_value_type ((BalaExpression*) expr); |
| 31411 | _tmp54_ = _tmp53_; |
| 31412 | _tmp55_ = self->double_type; |
| 31413 | if (bala_data_type_equals (_tmp54_, _tmp55_)) { |
| 31414 | BalaCCodeFile* _tmp56_; |
| 31415 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 31416 | BalaCCodeIdentifier* _tmp57_; |
| 31417 | BalaCCodeIdentifier* _tmp58_; |
| 31418 | BalaCCodeFunctionCall* _tmp59_; |
| 31419 | BalaCCodeFunctionCall* _tmp60_; |
| 31420 | BalaCCodeFunctionCall* _tmp61_; |
| 31421 | BalaCCodeExpression* _tmp62_; |
| 31422 | BalaCCodeFunctionCall* _tmp63_; |
| 31423 | BalaCCodeExpression* _tmp64_; |
| 31424 | BalaCCodeFunctionCall* _tmp65_; |
| 31425 | _tmp56_ = self->cfile; |
| 31426 | bala_ccode_file_add_include (_tmp56_, "math.h", FALSE(0)); |
| 31427 | _tmp57_ = bala_ccode_identifier_new ("fmod"); |
| 31428 | _tmp58_ = _tmp57_; |
| 31429 | _tmp59_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp58_); |
| 31430 | _tmp60_ = _tmp59_; |
| 31431 | _bala_ccode_node_unref0 (_tmp58_)((_tmp58_ == ((void*)0)) ? ((void*)0) : (_tmp58_ = (bala_ccode_node_unref (_tmp58_), ((void*)0)))); |
| 31432 | ccall = _tmp60_; |
| 31433 | _tmp61_ = ccall; |
| 31434 | _tmp62_ = cleft; |
| 31435 | bala_ccode_function_call_add_argument (_tmp61_, _tmp62_); |
| 31436 | _tmp63_ = ccall; |
| 31437 | _tmp64_ = cright; |
| 31438 | bala_ccode_function_call_add_argument (_tmp63_, _tmp64_); |
| 31439 | _tmp65_ = ccall; |
| 31440 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp65_); |
| 31441 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 31442 | _bala_ccode_node_unref0 (left_chain)((left_chain == ((void*)0)) ? ((void*)0) : (left_chain = (bala_ccode_node_unref (left_chain), ((void*)0)))); |
| 31443 | _bala_ccode_node_unref0 (cright)((cright == ((void*)0)) ? ((void*)0) : (cright = (bala_ccode_node_unref (cright), ((void*)0)))); |
| 31444 | _bala_ccode_node_unref0 (cleft)((cleft == ((void*)0)) ? ((void*)0) : (cleft = (bala_ccode_node_unref (cleft), ((void*)0)))); |
| 31445 | return; |
| 31446 | } else { |
| 31447 | BalaDataType* _tmp66_; |
| 31448 | BalaDataType* _tmp67_; |
| 31449 | BalaDataType* _tmp68_; |
| 31450 | _tmp66_ = bala_expression_get_value_type ((BalaExpression*) expr); |
| 31451 | _tmp67_ = _tmp66_; |
| 31452 | _tmp68_ = self->float_type; |
| 31453 | if (bala_data_type_equals (_tmp67_, _tmp68_)) { |
| 31454 | BalaCCodeFile* _tmp69_; |
| 31455 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 31456 | BalaCCodeIdentifier* _tmp70_; |
| 31457 | BalaCCodeIdentifier* _tmp71_; |
| 31458 | BalaCCodeFunctionCall* _tmp72_; |
| 31459 | BalaCCodeFunctionCall* _tmp73_; |
| 31460 | BalaCCodeFunctionCall* _tmp74_; |
| 31461 | BalaCCodeExpression* _tmp75_; |
| 31462 | BalaCCodeFunctionCall* _tmp76_; |
| 31463 | BalaCCodeExpression* _tmp77_; |
| 31464 | BalaCCodeFunctionCall* _tmp78_; |
| 31465 | _tmp69_ = self->cfile; |
| 31466 | bala_ccode_file_add_include (_tmp69_, "math.h", FALSE(0)); |
| 31467 | _tmp70_ = bala_ccode_identifier_new ("fmodf"); |
| 31468 | _tmp71_ = _tmp70_; |
| 31469 | _tmp72_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp71_); |
| 31470 | _tmp73_ = _tmp72_; |
| 31471 | _bala_ccode_node_unref0 (_tmp71_)((_tmp71_ == ((void*)0)) ? ((void*)0) : (_tmp71_ = (bala_ccode_node_unref (_tmp71_), ((void*)0)))); |
| 31472 | ccall = _tmp73_; |
| 31473 | _tmp74_ = ccall; |
| 31474 | _tmp75_ = cleft; |
| 31475 | bala_ccode_function_call_add_argument (_tmp74_, _tmp75_); |
| 31476 | _tmp76_ = ccall; |
| 31477 | _tmp77_ = cright; |
| 31478 | bala_ccode_function_call_add_argument (_tmp76_, _tmp77_); |
| 31479 | _tmp78_ = ccall; |
| 31480 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp78_); |
| 31481 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 31482 | _bala_ccode_node_unref0 (left_chain)((left_chain == ((void*)0)) ? ((void*)0) : (left_chain = (bala_ccode_node_unref (left_chain), ((void*)0)))); |
| 31483 | _bala_ccode_node_unref0 (cright)((cright == ((void*)0)) ? ((void*)0) : (cright = (bala_ccode_node_unref (cright), ((void*)0)))); |
| 31484 | _bala_ccode_node_unref0 (cleft)((cleft == ((void*)0)) ? ((void*)0) : (cleft = (bala_ccode_node_unref (cleft), ((void*)0)))); |
| 31485 | return; |
| 31486 | } else { |
| 31487 | op = BALA_CCODE_BINARY_OPERATOR_MOD; |
| 31488 | } |
| 31489 | } |
| 31490 | break; |
| 31491 | } |
| 31492 | case BALA_BINARY_OPERATOR_SHIFT_LEFT: |
| 31493 | { |
| 31494 | op = BALA_CCODE_BINARY_OPERATOR_SHIFT_LEFT; |
| 31495 | break; |
| 31496 | } |
| 31497 | case BALA_BINARY_OPERATOR_SHIFT_RIGHT: |
| 31498 | { |
| 31499 | op = BALA_CCODE_BINARY_OPERATOR_SHIFT_RIGHT; |
| 31500 | break; |
| 31501 | } |
| 31502 | case BALA_BINARY_OPERATOR_LESS_THAN: |
| 31503 | { |
| 31504 | op = BALA_CCODE_BINARY_OPERATOR_LESS_THAN; |
| 31505 | break; |
| 31506 | } |
| 31507 | case BALA_BINARY_OPERATOR_GREATER_THAN: |
| 31508 | { |
| 31509 | op = BALA_CCODE_BINARY_OPERATOR_GREATER_THAN; |
| 31510 | break; |
| 31511 | } |
| 31512 | case BALA_BINARY_OPERATOR_LESS_THAN_OR_EQUAL: |
| 31513 | { |
| 31514 | op = BALA_CCODE_BINARY_OPERATOR_LESS_THAN_OR_EQUAL; |
| 31515 | break; |
| 31516 | } |
| 31517 | case BALA_BINARY_OPERATOR_GREATER_THAN_OR_EQUAL: |
| 31518 | { |
| 31519 | op = BALA_CCODE_BINARY_OPERATOR_GREATER_THAN_OR_EQUAL; |
| 31520 | break; |
| 31521 | } |
| 31522 | case BALA_BINARY_OPERATOR_EQUALITY: |
| 31523 | { |
| 31524 | op = BALA_CCODE_BINARY_OPERATOR_EQUALITY; |
| 31525 | break; |
| 31526 | } |
| 31527 | case BALA_BINARY_OPERATOR_INEQUALITY: |
| 31528 | { |
| 31529 | op = BALA_CCODE_BINARY_OPERATOR_INEQUALITY; |
| 31530 | break; |
| 31531 | } |
| 31532 | case BALA_BINARY_OPERATOR_BITWISE_AND: |
| 31533 | { |
| 31534 | op = BALA_CCODE_BINARY_OPERATOR_BITWISE_AND; |
| 31535 | break; |
| 31536 | } |
| 31537 | case BALA_BINARY_OPERATOR_BITWISE_OR: |
| 31538 | { |
| 31539 | op = BALA_CCODE_BINARY_OPERATOR_BITWISE_OR; |
| 31540 | break; |
| 31541 | } |
| 31542 | case BALA_BINARY_OPERATOR_BITWISE_XOR: |
| 31543 | { |
| 31544 | op = BALA_CCODE_BINARY_OPERATOR_BITWISE_XOR; |
| 31545 | break; |
| 31546 | } |
| 31547 | case BALA_BINARY_OPERATOR_AND: |
| 31548 | { |
| 31549 | op = BALA_CCODE_BINARY_OPERATOR_AND; |
| 31550 | break; |
| 31551 | } |
| 31552 | case BALA_BINARY_OPERATOR_OR: |
| 31553 | { |
| 31554 | op = BALA_CCODE_BINARY_OPERATOR_OR; |
| 31555 | break; |
| 31556 | } |
| 31557 | case BALA_BINARY_OPERATOR_IN: |
| 31558 | { |
| 31559 | BalaExpression* _tmp79_; |
| 31560 | BalaExpression* _tmp80_; |
| 31561 | BalaDataType* _tmp81_; |
| 31562 | BalaDataType* _tmp82_; |
| 31563 | _tmp79_ = bala_binary_expression_get_right (expr); |
| 31564 | _tmp80_ = _tmp79_; |
| 31565 | _tmp81_ = bala_expression_get_value_type (_tmp80_); |
| 31566 | _tmp82_ = _tmp81_; |
| 31567 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp82_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp82_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 31568 | BalaArrayType* array_type = NULL((void*)0); |
| 31569 | BalaExpression* _tmp83_; |
| 31570 | BalaExpression* _tmp84_; |
| 31571 | BalaDataType* _tmp85_; |
| 31572 | BalaDataType* _tmp86_; |
| 31573 | BalaDataType* element_type = NULL((void*)0); |
| 31574 | BalaArrayType* _tmp87_; |
| 31575 | BalaDataType* _tmp88_; |
| 31576 | BalaDataType* _tmp89_; |
| 31577 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 31578 | BalaArrayType* _tmp90_; |
| 31579 | gchar* _tmp91_; |
| 31580 | gchar* _tmp92_; |
| 31581 | BalaCCodeIdentifier* _tmp93_; |
| 31582 | BalaCCodeIdentifier* _tmp94_; |
| 31583 | BalaCCodeFunctionCall* _tmp95_; |
| 31584 | BalaCCodeFunctionCall* _tmp96_; |
| 31585 | BalaCCodeExpression* node = NULL((void*)0); |
| 31586 | BalaCCodeFunctionCall* _tmp97_; |
| 31587 | BalaCCodeExpression* _tmp98_; |
| 31588 | BalaCCodeFunctionCall* _tmp99_; |
| 31589 | BalaCCodeExpression* _tmp100_; |
| 31590 | BalaCCodeFunctionCall* _tmp101_; |
| 31591 | BalaExpression* _tmp102_; |
| 31592 | BalaExpression* _tmp103_; |
| 31593 | BalaCCodeExpression* _tmp104_; |
| 31594 | BalaCCodeExpression* _tmp105_; |
| 31595 | BalaDataType* _tmp106_; |
| 31596 | BalaCCodeExpression* _tmp146_; |
| 31597 | _tmp83_ = bala_binary_expression_get_right (expr); |
| 31598 | _tmp84_ = _tmp83_; |
| 31599 | _tmp85_ = bala_expression_get_value_type (_tmp84_); |
| 31600 | _tmp86_ = _tmp85_; |
| 31601 | array_type = G_TYPE_CHECK_INSTANCE_CAST (_tmp86_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp86_), ((bala_array_type_get_type ()))))); |
| 31602 | _tmp87_ = array_type; |
| 31603 | _tmp88_ = bala_array_type_get_element_type (_tmp87_); |
| 31604 | _tmp89_ = _tmp88_; |
| 31605 | element_type = _tmp89_; |
| 31606 | _tmp90_ = array_type; |
| 31607 | _tmp91_ = bala_ccode_base_module_generate_array_contains_wrapper (self, _tmp90_); |
| 31608 | _tmp92_ = _tmp91_; |
| 31609 | _tmp93_ = bala_ccode_identifier_new (_tmp92_); |
| 31610 | _tmp94_ = _tmp93_; |
| 31611 | _tmp95_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp94_); |
| 31612 | _tmp96_ = _tmp95_; |
| 31613 | _bala_ccode_node_unref0 (_tmp94_)((_tmp94_ == ((void*)0)) ? ((void*)0) : (_tmp94_ = (bala_ccode_node_unref (_tmp94_), ((void*)0)))); |
| 31614 | _g_free0 (_tmp92_)(_tmp92_ = (g_free (_tmp92_), ((void*)0))); |
| 31615 | ccall = _tmp96_; |
| 31616 | _tmp97_ = ccall; |
| 31617 | _tmp98_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp97_); |
| 31618 | node = _tmp98_; |
| 31619 | _tmp99_ = ccall; |
| 31620 | _tmp100_ = cright; |
| 31621 | bala_ccode_function_call_add_argument (_tmp99_, _tmp100_); |
| 31622 | _tmp101_ = ccall; |
| 31623 | _tmp102_ = bala_binary_expression_get_right (expr); |
| 31624 | _tmp103_ = _tmp102_; |
| 31625 | _tmp104_ = bala_ccode_base_module_get_array_length_cexpression (self, _tmp103_, -1); |
| 31626 | _tmp105_ = _tmp104_; |
| 31627 | bala_ccode_function_call_add_argument (_tmp101_, _tmp105_); |
| 31628 | _bala_ccode_node_unref0 (_tmp105_)((_tmp105_ == ((void*)0)) ? ((void*)0) : (_tmp105_ = (bala_ccode_node_unref (_tmp105_), ((void*)0)))); |
| 31629 | _tmp106_ = element_type; |
| 31630 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp106_, BALA_TYPE_STRUCT_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp106_); GType __t = ((bala_struct_value_type_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 31631 | BalaCCodeFunctionCall* _tmp107_; |
| 31632 | BalaCCodeExpression* _tmp108_; |
| 31633 | BalaCCodeUnaryExpression* _tmp109_; |
| 31634 | BalaCCodeUnaryExpression* _tmp110_; |
| 31635 | _tmp107_ = ccall; |
| 31636 | _tmp108_ = cleft; |
| 31637 | _tmp109_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp108_); |
| 31638 | _tmp110_ = _tmp109_; |
| 31639 | bala_ccode_function_call_add_argument (_tmp107_, (BalaCCodeExpression*) _tmp110_); |
| 31640 | _bala_ccode_node_unref0 (_tmp110_)((_tmp110_ == ((void*)0)) ? ((void*)0) : (_tmp110_ = (bala_ccode_node_unref (_tmp110_), ((void*)0)))); |
| 31641 | } else { |
| 31642 | gboolean _tmp111_ = FALSE(0); |
| 31643 | gboolean _tmp112_ = FALSE(0); |
| 31644 | gboolean _tmp113_ = FALSE(0); |
| 31645 | BalaDataType* _tmp114_; |
| 31646 | _tmp114_ = element_type; |
| 31647 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp114_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp114_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 31648 | BalaDataType* _tmp115_; |
| 31649 | gboolean _tmp116_; |
| 31650 | gboolean _tmp117_; |
| 31651 | _tmp115_ = element_type; |
| 31652 | _tmp116_ = bala_data_type_get_nullable (_tmp115_); |
| 31653 | _tmp117_ = _tmp116_; |
| 31654 | _tmp113_ = !_tmp117_; |
| 31655 | } else { |
| 31656 | _tmp113_ = FALSE(0); |
| 31657 | } |
| 31658 | if (_tmp113_) { |
| 31659 | BalaExpression* _tmp118_; |
| 31660 | BalaExpression* _tmp119_; |
| 31661 | BalaDataType* _tmp120_; |
| 31662 | BalaDataType* _tmp121_; |
| 31663 | _tmp118_ = bala_binary_expression_get_left (expr); |
| 31664 | _tmp119_ = _tmp118_; |
| 31665 | _tmp120_ = bala_expression_get_value_type (_tmp119_); |
| 31666 | _tmp121_ = _tmp120_; |
| 31667 | _tmp112_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp121_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp121_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 31668 | } else { |
| 31669 | _tmp112_ = FALSE(0); |
| 31670 | } |
| 31671 | if (_tmp112_) { |
| 31672 | BalaExpression* _tmp122_; |
| 31673 | BalaExpression* _tmp123_; |
| 31674 | BalaDataType* _tmp124_; |
| 31675 | BalaDataType* _tmp125_; |
| 31676 | gboolean _tmp126_; |
| 31677 | gboolean _tmp127_; |
| 31678 | _tmp122_ = bala_binary_expression_get_left (expr); |
| 31679 | _tmp123_ = _tmp122_; |
| 31680 | _tmp124_ = bala_expression_get_value_type (_tmp123_); |
| 31681 | _tmp125_ = _tmp124_; |
| 31682 | _tmp126_ = bala_data_type_get_nullable (_tmp125_); |
| 31683 | _tmp127_ = _tmp126_; |
| 31684 | _tmp111_ = _tmp127_; |
| 31685 | } else { |
| 31686 | _tmp111_ = FALSE(0); |
| 31687 | } |
| 31688 | if (_tmp111_) { |
| 31689 | BalaCCodeBinaryExpression* cnull = NULL((void*)0); |
| 31690 | BalaCCodeExpression* _tmp128_; |
| 31691 | BalaCCodeConstant* _tmp129_; |
| 31692 | BalaCCodeConstant* _tmp130_; |
| 31693 | BalaCCodeBinaryExpression* _tmp131_; |
| 31694 | BalaCCodeBinaryExpression* _tmp132_; |
| 31695 | BalaCCodeFunctionCall* _tmp133_; |
| 31696 | BalaCCodeExpression* _tmp134_; |
| 31697 | BalaCCodeUnaryExpression* _tmp135_; |
| 31698 | BalaCCodeUnaryExpression* _tmp136_; |
| 31699 | BalaCCodeBinaryExpression* _tmp137_; |
| 31700 | BalaCCodeConstant* _tmp138_; |
| 31701 | BalaCCodeConstant* _tmp139_; |
| 31702 | BalaCCodeFunctionCall* _tmp140_; |
| 31703 | BalaCCodeConditionalExpression* _tmp141_; |
| 31704 | BalaCCodeConditionalExpression* _tmp142_; |
| 31705 | BalaCCodeParenthesizedExpression* _tmp143_; |
| 31706 | _tmp128_ = cleft; |
| 31707 | _tmp129_ = bala_ccode_constant_new ("NULL"); |
| 31708 | _tmp130_ = _tmp129_; |
| 31709 | _tmp131_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, _tmp128_, (BalaCCodeExpression*) _tmp130_); |
| 31710 | _tmp132_ = _tmp131_; |
| 31711 | _bala_ccode_node_unref0 (_tmp130_)((_tmp130_ == ((void*)0)) ? ((void*)0) : (_tmp130_ = (bala_ccode_node_unref (_tmp130_), ((void*)0)))); |
| 31712 | cnull = _tmp132_; |
| 31713 | _tmp133_ = ccall; |
| 31714 | _tmp134_ = cleft; |
| 31715 | _tmp135_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp134_); |
| 31716 | _tmp136_ = _tmp135_; |
| 31717 | bala_ccode_function_call_add_argument (_tmp133_, (BalaCCodeExpression*) _tmp136_); |
| 31718 | _bala_ccode_node_unref0 (_tmp136_)((_tmp136_ == ((void*)0)) ? ((void*)0) : (_tmp136_ = (bala_ccode_node_unref (_tmp136_), ((void*)0)))); |
| 31719 | _tmp137_ = cnull; |
| 31720 | _tmp138_ = bala_ccode_constant_new ("FALSE"); |
| 31721 | _tmp139_ = _tmp138_; |
| 31722 | _tmp140_ = ccall; |
| 31723 | _tmp141_ = bala_ccode_conditional_expression_new ((BalaCCodeExpression*) _tmp137_, (BalaCCodeExpression*) _tmp139_, (BalaCCodeExpression*) _tmp140_); |
| 31724 | _tmp142_ = _tmp141_; |
| 31725 | _tmp143_ = bala_ccode_parenthesized_expression_new ((BalaCCodeExpression*) _tmp142_); |
| 31726 | _bala_ccode_node_unref0 (node)((node == ((void*)0)) ? ((void*)0) : (node = (bala_ccode_node_unref (node), ((void*)0)))); |
| 31727 | node = (BalaCCodeExpression*) _tmp143_; |
| 31728 | _bala_ccode_node_unref0 (_tmp142_)((_tmp142_ == ((void*)0)) ? ((void*)0) : (_tmp142_ = (bala_ccode_node_unref (_tmp142_), ((void*)0)))); |
| 31729 | _bala_ccode_node_unref0 (_tmp139_)((_tmp139_ == ((void*)0)) ? ((void*)0) : (_tmp139_ = (bala_ccode_node_unref (_tmp139_), ((void*)0)))); |
| 31730 | _bala_ccode_node_unref0 (cnull)((cnull == ((void*)0)) ? ((void*)0) : (cnull = (bala_ccode_node_unref (cnull), ((void*)0)))); |
| 31731 | } else { |
| 31732 | BalaCCodeFunctionCall* _tmp144_; |
| 31733 | BalaCCodeExpression* _tmp145_; |
| 31734 | _tmp144_ = ccall; |
| 31735 | _tmp145_ = cleft; |
| 31736 | bala_ccode_function_call_add_argument (_tmp144_, _tmp145_); |
| 31737 | } |
| 31738 | } |
| 31739 | _tmp146_ = node; |
| 31740 | bala_set_cvalue ((BalaExpression*) expr, _tmp146_); |
| 31741 | _bala_ccode_node_unref0 (node)((node == ((void*)0)) ? ((void*)0) : (node = (bala_ccode_node_unref (node), ((void*)0)))); |
| 31742 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 31743 | } else { |
| 31744 | BalaCCodeExpression* _tmp147_; |
| 31745 | BalaCCodeExpression* _tmp148_; |
| 31746 | BalaCCodeBinaryExpression* _tmp149_; |
| 31747 | BalaCCodeBinaryExpression* _tmp150_; |
| 31748 | BalaCCodeExpression* _tmp151_; |
| 31749 | BalaCCodeBinaryExpression* _tmp152_; |
| 31750 | BalaCCodeBinaryExpression* _tmp153_; |
| 31751 | _tmp147_ = cright; |
| 31752 | _tmp148_ = cleft; |
| 31753 | _tmp149_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_BITWISE_AND, _tmp147_, _tmp148_); |
| 31754 | _tmp150_ = _tmp149_; |
| 31755 | _tmp151_ = cleft; |
| 31756 | _tmp152_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp150_, _tmp151_); |
| 31757 | _tmp153_ = _tmp152_; |
| 31758 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp153_); |
| 31759 | _bala_ccode_node_unref0 (_tmp153_)((_tmp153_ == ((void*)0)) ? ((void*)0) : (_tmp153_ = (bala_ccode_node_unref (_tmp153_), ((void*)0)))); |
| 31760 | _bala_ccode_node_unref0 (_tmp150_)((_tmp150_ == ((void*)0)) ? ((void*)0) : (_tmp150_ = (bala_ccode_node_unref (_tmp150_), ((void*)0)))); |
| 31761 | } |
| 31762 | _bala_ccode_node_unref0 (left_chain)((left_chain == ((void*)0)) ? ((void*)0) : (left_chain = (bala_ccode_node_unref (left_chain), ((void*)0)))); |
| 31763 | _bala_ccode_node_unref0 (cright)((cright == ((void*)0)) ? ((void*)0) : (cright = (bala_ccode_node_unref (cright), ((void*)0)))); |
| 31764 | _bala_ccode_node_unref0 (cleft)((cleft == ((void*)0)) ? ((void*)0) : (cleft = (bala_ccode_node_unref (cleft), ((void*)0)))); |
| 31765 | return; |
| 31766 | } |
| 31767 | default: |
| 31768 | { |
| 31769 | g_assert_not_reached ()do { g_assertion_message_expr ("bala-ccodegen", "balaccodebasemodule.c" , 31769, ((const char*) (__func__)), ((void*)0)); } while (0); |
| 31770 | } |
| 31771 | } |
| 31772 | _tmp155_ = bala_binary_expression_get_operator (expr); |
| 31773 | _tmp156_ = _tmp155_; |
| 31774 | if (_tmp156_ == BALA_BINARY_OPERATOR_EQUALITY) { |
| 31775 | _tmp154_ = TRUE(!(0)); |
| 31776 | } else { |
| 31777 | BalaBinaryOperator _tmp157_; |
| 31778 | BalaBinaryOperator _tmp158_; |
| 31779 | _tmp157_ = bala_binary_expression_get_operator (expr); |
| 31780 | _tmp158_ = _tmp157_; |
| 31781 | _tmp154_ = _tmp158_ == BALA_BINARY_OPERATOR_INEQUALITY; |
| 31782 | } |
| 31783 | if (_tmp154_) { |
| 31784 | BalaDataType* left_type = NULL((void*)0); |
| 31785 | BalaExpression* _tmp159_; |
| 31786 | BalaExpression* _tmp160_; |
| 31787 | BalaDataType* _tmp161_; |
| 31788 | BalaDataType* _tmp162_; |
| 31789 | BalaDataType* _tmp163_; |
| 31790 | BalaDataType* right_type = NULL((void*)0); |
| 31791 | BalaExpression* _tmp164_; |
| 31792 | BalaExpression* _tmp165_; |
| 31793 | BalaDataType* _tmp166_; |
| 31794 | BalaDataType* _tmp167_; |
| 31795 | BalaDataType* _tmp168_; |
| 31796 | gboolean _tmp169_ = FALSE(0); |
| 31797 | BalaDataType* _tmp170_; |
| 31798 | _tmp159_ = bala_binary_expression_get_left (expr); |
| 31799 | _tmp160_ = _tmp159_; |
| 31800 | _tmp161_ = bala_expression_get_target_type (_tmp160_); |
| 31801 | _tmp162_ = _tmp161_; |
| 31802 | _tmp163_ = _bala_code_node_ref0 (_tmp162_); |
| 31803 | left_type = _tmp163_; |
| 31804 | _tmp164_ = bala_binary_expression_get_right (expr); |
| 31805 | _tmp165_ = _tmp164_; |
| 31806 | _tmp166_ = bala_expression_get_target_type (_tmp165_); |
| 31807 | _tmp167_ = _tmp166_; |
| 31808 | _tmp168_ = _bala_code_node_ref0 (_tmp167_); |
| 31809 | right_type = _tmp168_; |
| 31810 | bala_ccode_base_module_make_comparable_cexpression (self, &left_type, &cleft, &right_type, &cright); |
| 31811 | _tmp170_ = left_type; |
| 31812 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp170_, BALA_TYPE_STRUCT_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp170_); GType __t = ((bala_struct_value_type_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 31813 | BalaDataType* _tmp171_; |
| 31814 | _tmp171_ = right_type; |
| 31815 | _tmp169_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp171_, BALA_TYPE_STRUCT_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp171_); GType __t = ((bala_struct_value_type_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } ))); |
| 31816 | } else { |
| 31817 | _tmp169_ = FALSE(0); |
| 31818 | } |
| 31819 | if (_tmp169_) { |
| 31820 | gchar* equalfunc = NULL((void*)0); |
| 31821 | BalaDataType* _tmp172_; |
| 31822 | BalaTypeSymbol* _tmp173_; |
| 31823 | BalaTypeSymbol* _tmp174_; |
| 31824 | gchar* _tmp175_; |
| 31825 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 31826 | const gchar* _tmp176_; |
| 31827 | BalaCCodeIdentifier* _tmp177_; |
| 31828 | BalaCCodeIdentifier* _tmp178_; |
| 31829 | BalaCCodeFunctionCall* _tmp179_; |
| 31830 | BalaCCodeFunctionCall* _tmp180_; |
| 31831 | BalaCCodeFunctionCall* _tmp181_; |
| 31832 | BalaCCodeExpression* _tmp182_; |
| 31833 | BalaCCodeFunctionCall* _tmp183_; |
| 31834 | BalaCCodeExpression* _tmp184_; |
| 31835 | BalaCCodeFunctionCall* _tmp185_; |
| 31836 | BalaCCodeExpression* _tmp186_; |
| 31837 | BalaCCodeExpression* _tmp187_; |
| 31838 | _tmp172_ = left_type; |
| 31839 | _tmp173_ = bala_data_type_get_type_symbol (_tmp172_); |
| 31840 | _tmp174_ = _tmp173_; |
| 31841 | _tmp175_ = bala_ccode_base_module_generate_struct_equal_function (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp174_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp174_), ((bala_struct_get_type ())))))); |
| 31842 | equalfunc = _tmp175_; |
| 31843 | _tmp176_ = equalfunc; |
| 31844 | _tmp177_ = bala_ccode_identifier_new (_tmp176_); |
| 31845 | _tmp178_ = _tmp177_; |
| 31846 | _tmp179_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp178_); |
| 31847 | _tmp180_ = _tmp179_; |
| 31848 | _bala_ccode_node_unref0 (_tmp178_)((_tmp178_ == ((void*)0)) ? ((void*)0) : (_tmp178_ = (bala_ccode_node_unref (_tmp178_), ((void*)0)))); |
| 31849 | ccall = _tmp180_; |
| 31850 | _tmp181_ = ccall; |
| 31851 | _tmp182_ = cleft; |
| 31852 | bala_ccode_function_call_add_argument (_tmp181_, _tmp182_); |
| 31853 | _tmp183_ = ccall; |
| 31854 | _tmp184_ = cright; |
| 31855 | bala_ccode_function_call_add_argument (_tmp183_, _tmp184_); |
| 31856 | _tmp185_ = ccall; |
| 31857 | _tmp186_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp185_); |
| 31858 | _bala_ccode_node_unref0 (cleft)((cleft == ((void*)0)) ? ((void*)0) : (cleft = (bala_ccode_node_unref (cleft), ((void*)0)))); |
| 31859 | cleft = _tmp186_; |
| 31860 | _tmp187_ = bala_ccode_base_module_get_boolean_cconstant (self, TRUE(!(0))); |
| 31861 | _bala_ccode_node_unref0 (cright)((cright == ((void*)0)) ? ((void*)0) : (cright = (bala_ccode_node_unref (cright), ((void*)0)))); |
| 31862 | cright = _tmp187_; |
| 31863 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 31864 | _g_free0 (equalfunc)(equalfunc = (g_free (equalfunc), ((void*)0))); |
| 31865 | } else { |
| 31866 | gboolean _tmp188_ = FALSE(0); |
| 31867 | gboolean _tmp189_ = FALSE(0); |
| 31868 | gboolean _tmp190_ = FALSE(0); |
| 31869 | gboolean _tmp191_ = FALSE(0); |
| 31870 | gboolean _tmp192_ = FALSE(0); |
| 31871 | gboolean _tmp193_ = FALSE(0); |
| 31872 | BalaDataType* _tmp194_; |
| 31873 | _tmp194_ = left_type; |
| 31874 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp194_, BALA_TYPE_INTEGER_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp194_); GType __t = ((bala_integer_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 31875 | _tmp193_ = TRUE(!(0)); |
| 31876 | } else { |
| 31877 | BalaDataType* _tmp195_; |
| 31878 | _tmp195_ = left_type; |
| 31879 | _tmp193_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp195_, BALA_TYPE_FLOATING_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp195_); GType __t = ((bala_floating_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 31880 | } |
| 31881 | if (_tmp193_) { |
| 31882 | _tmp192_ = TRUE(!(0)); |
| 31883 | } else { |
| 31884 | BalaDataType* _tmp196_; |
| 31885 | _tmp196_ = left_type; |
| 31886 | _tmp192_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp196_, BALA_TYPE_BOOLEAN_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp196_); GType __t = ((bala_boolean_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 31887 | } |
| 31888 | if (_tmp192_) { |
| 31889 | _tmp191_ = TRUE(!(0)); |
| 31890 | } else { |
| 31891 | BalaDataType* _tmp197_; |
| 31892 | _tmp197_ = left_type; |
| 31893 | _tmp191_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp197_, BALA_TYPE_ENUM_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp197_); GType __t = ((bala_enum_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 31894 | } |
| 31895 | if (_tmp191_) { |
| 31896 | BalaDataType* _tmp198_; |
| 31897 | gboolean _tmp199_; |
| 31898 | gboolean _tmp200_; |
| 31899 | _tmp198_ = left_type; |
| 31900 | _tmp199_ = bala_data_type_get_nullable (_tmp198_); |
| 31901 | _tmp200_ = _tmp199_; |
| 31902 | _tmp190_ = _tmp200_; |
| 31903 | } else { |
| 31904 | _tmp190_ = FALSE(0); |
| 31905 | } |
| 31906 | if (_tmp190_) { |
| 31907 | gboolean _tmp201_ = FALSE(0); |
| 31908 | gboolean _tmp202_ = FALSE(0); |
| 31909 | gboolean _tmp203_ = FALSE(0); |
| 31910 | BalaDataType* _tmp204_; |
| 31911 | _tmp204_ = right_type; |
| 31912 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp204_, BALA_TYPE_INTEGER_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp204_); GType __t = ((bala_integer_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 31913 | _tmp203_ = TRUE(!(0)); |
| 31914 | } else { |
| 31915 | BalaDataType* _tmp205_; |
| 31916 | _tmp205_ = right_type; |
| 31917 | _tmp203_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp205_, BALA_TYPE_FLOATING_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp205_); GType __t = ((bala_floating_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 31918 | } |
| 31919 | if (_tmp203_) { |
| 31920 | _tmp202_ = TRUE(!(0)); |
| 31921 | } else { |
| 31922 | BalaDataType* _tmp206_; |
| 31923 | _tmp206_ = right_type; |
| 31924 | _tmp202_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp206_, BALA_TYPE_BOOLEAN_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp206_); GType __t = ((bala_boolean_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 31925 | } |
| 31926 | if (_tmp202_) { |
| 31927 | _tmp201_ = TRUE(!(0)); |
| 31928 | } else { |
| 31929 | BalaDataType* _tmp207_; |
| 31930 | _tmp207_ = right_type; |
| 31931 | _tmp201_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp207_, BALA_TYPE_ENUM_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp207_); GType __t = ((bala_enum_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 31932 | } |
| 31933 | _tmp189_ = _tmp201_; |
| 31934 | } else { |
| 31935 | _tmp189_ = FALSE(0); |
| 31936 | } |
| 31937 | if (_tmp189_) { |
| 31938 | BalaDataType* _tmp208_; |
| 31939 | gboolean _tmp209_; |
| 31940 | gboolean _tmp210_; |
| 31941 | _tmp208_ = right_type; |
| 31942 | _tmp209_ = bala_data_type_get_nullable (_tmp208_); |
| 31943 | _tmp210_ = _tmp209_; |
| 31944 | _tmp188_ = _tmp210_; |
| 31945 | } else { |
| 31946 | _tmp188_ = FALSE(0); |
| 31947 | } |
| 31948 | if (_tmp188_) { |
| 31949 | gchar* equalfunc = NULL((void*)0); |
| 31950 | BalaDataType* _tmp211_; |
| 31951 | BalaTypeSymbol* _tmp212_; |
| 31952 | BalaTypeSymbol* _tmp213_; |
| 31953 | gchar* _tmp214_; |
| 31954 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 31955 | const gchar* _tmp215_; |
| 31956 | BalaCCodeIdentifier* _tmp216_; |
| 31957 | BalaCCodeIdentifier* _tmp217_; |
| 31958 | BalaCCodeFunctionCall* _tmp218_; |
| 31959 | BalaCCodeFunctionCall* _tmp219_; |
| 31960 | BalaCCodeFunctionCall* _tmp220_; |
| 31961 | BalaCCodeExpression* _tmp221_; |
| 31962 | BalaCCodeFunctionCall* _tmp222_; |
| 31963 | BalaCCodeExpression* _tmp223_; |
| 31964 | BalaCCodeFunctionCall* _tmp224_; |
| 31965 | BalaCCodeExpression* _tmp225_; |
| 31966 | BalaCCodeExpression* _tmp226_; |
| 31967 | _tmp211_ = left_type; |
| 31968 | _tmp212_ = bala_data_type_get_type_symbol (_tmp211_); |
| 31969 | _tmp213_ = _tmp212_; |
| 31970 | _tmp214_ = bala_ccode_base_module_generate_numeric_equal_function (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp213_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp213_), ((bala_typesymbol_get_type ())))))); |
| 31971 | equalfunc = _tmp214_; |
| 31972 | _tmp215_ = equalfunc; |
| 31973 | _tmp216_ = bala_ccode_identifier_new (_tmp215_); |
| 31974 | _tmp217_ = _tmp216_; |
| 31975 | _tmp218_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp217_); |
| 31976 | _tmp219_ = _tmp218_; |
| 31977 | _bala_ccode_node_unref0 (_tmp217_)((_tmp217_ == ((void*)0)) ? ((void*)0) : (_tmp217_ = (bala_ccode_node_unref (_tmp217_), ((void*)0)))); |
| 31978 | ccall = _tmp219_; |
| 31979 | _tmp220_ = ccall; |
| 31980 | _tmp221_ = cleft; |
| 31981 | bala_ccode_function_call_add_argument (_tmp220_, _tmp221_); |
| 31982 | _tmp222_ = ccall; |
| 31983 | _tmp223_ = cright; |
| 31984 | bala_ccode_function_call_add_argument (_tmp222_, _tmp223_); |
| 31985 | _tmp224_ = ccall; |
| 31986 | _tmp225_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp224_); |
| 31987 | _bala_ccode_node_unref0 (cleft)((cleft == ((void*)0)) ? ((void*)0) : (cleft = (bala_ccode_node_unref (cleft), ((void*)0)))); |
| 31988 | cleft = _tmp225_; |
| 31989 | _tmp226_ = bala_ccode_base_module_get_boolean_cconstant (self, TRUE(!(0))); |
| 31990 | _bala_ccode_node_unref0 (cright)((cright == ((void*)0)) ? ((void*)0) : (cright = (bala_ccode_node_unref (cright), ((void*)0)))); |
| 31991 | cright = _tmp226_; |
| 31992 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 31993 | _g_free0 (equalfunc)(equalfunc = (g_free (equalfunc), ((void*)0))); |
| 31994 | } |
| 31995 | } |
| 31996 | _bala_code_node_unref0 (right_type)((right_type == ((void*)0)) ? ((void*)0) : (right_type = (bala_code_node_unref (right_type), ((void*)0)))); |
| 31997 | _bala_code_node_unref0 (left_type)((left_type == ((void*)0)) ? ((void*)0) : (left_type = (bala_code_node_unref (left_type), ((void*)0)))); |
| 31998 | } |
| 31999 | _tmp230_ = bala_binary_expression_get_left (expr); |
| 32000 | _tmp231_ = _tmp230_; |
| 32001 | _tmp232_ = bala_expression_get_value_type (_tmp231_); |
| 32002 | _tmp233_ = _tmp232_; |
| 32003 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp233_, BALA_TYPE_NULL_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp233_); GType __t = ((bala_null_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 32004 | BalaExpression* _tmp234_; |
| 32005 | BalaExpression* _tmp235_; |
| 32006 | BalaDataType* _tmp236_; |
| 32007 | BalaDataType* _tmp237_; |
| 32008 | BalaDataType* _tmp238_; |
| 32009 | _tmp234_ = bala_binary_expression_get_left (expr); |
| 32010 | _tmp235_ = _tmp234_; |
| 32011 | _tmp236_ = bala_expression_get_value_type (_tmp235_); |
| 32012 | _tmp237_ = _tmp236_; |
| 32013 | _tmp238_ = self->string_type; |
| 32014 | _tmp229_ = bala_data_type_compatible (_tmp237_, _tmp238_); |
| 32015 | } else { |
| 32016 | _tmp229_ = FALSE(0); |
| 32017 | } |
| 32018 | if (_tmp229_) { |
| 32019 | BalaExpression* _tmp239_; |
| 32020 | BalaExpression* _tmp240_; |
| 32021 | BalaDataType* _tmp241_; |
| 32022 | BalaDataType* _tmp242_; |
| 32023 | _tmp239_ = bala_binary_expression_get_right (expr); |
| 32024 | _tmp240_ = _tmp239_; |
| 32025 | _tmp241_ = bala_expression_get_value_type (_tmp240_); |
| 32026 | _tmp242_ = _tmp241_; |
| 32027 | _tmp228_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp242_, BALA_TYPE_NULL_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp242_); GType __t = ((bala_null_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 32028 | } else { |
| 32029 | _tmp228_ = FALSE(0); |
| 32030 | } |
| 32031 | if (_tmp228_) { |
| 32032 | BalaExpression* _tmp243_; |
| 32033 | BalaExpression* _tmp244_; |
| 32034 | BalaDataType* _tmp245_; |
| 32035 | BalaDataType* _tmp246_; |
| 32036 | BalaDataType* _tmp247_; |
| 32037 | _tmp243_ = bala_binary_expression_get_right (expr); |
| 32038 | _tmp244_ = _tmp243_; |
| 32039 | _tmp245_ = bala_expression_get_value_type (_tmp244_); |
| 32040 | _tmp246_ = _tmp245_; |
| 32041 | _tmp247_ = self->string_type; |
| 32042 | _tmp227_ = bala_data_type_compatible (_tmp246_, _tmp247_); |
| 32043 | } else { |
| 32044 | _tmp227_ = FALSE(0); |
| 32045 | } |
| 32046 | is_string_comparison = _tmp227_; |
| 32047 | _tmp249_ = bala_binary_expression_get_left (expr); |
| 32048 | _tmp250_ = _tmp249_; |
| 32049 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp250_, BALA_TYPE_STRING_LITERAL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp250_); GType __t = ((bala_string_literal_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 32050 | _tmp248_ = TRUE(!(0)); |
| 32051 | } else { |
| 32052 | BalaExpression* _tmp251_; |
| 32053 | BalaExpression* _tmp252_; |
| 32054 | _tmp251_ = bala_binary_expression_get_right (expr); |
| 32055 | _tmp252_ = _tmp251_; |
| 32056 | _tmp248_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp252_, BALA_TYPE_STRING_LITERAL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp252_); GType __t = ((bala_string_literal_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 32057 | } |
| 32058 | has_string_literal = _tmp248_; |
| 32059 | if (is_string_comparison) { |
| 32060 | _tmp253_ = TRUE(!(0)); |
| 32061 | } else { |
| 32062 | gboolean _tmp254_ = FALSE(0); |
| 32063 | if (has_string_literal) { |
| 32064 | BalaBinaryOperator _tmp255_; |
| 32065 | BalaBinaryOperator _tmp256_; |
| 32066 | _tmp255_ = bala_binary_expression_get_operator (expr); |
| 32067 | _tmp256_ = _tmp255_; |
| 32068 | _tmp254_ = _tmp256_ != BALA_BINARY_OPERATOR_PLUS; |
| 32069 | } else { |
| 32070 | _tmp254_ = FALSE(0); |
| 32071 | } |
| 32072 | _tmp253_ = _tmp254_; |
| 32073 | } |
| 32074 | if (_tmp253_) { |
| 32075 | BalaBinaryOperator _tmp257_; |
| 32076 | BalaBinaryOperator _tmp258_; |
| 32077 | _tmp257_ = bala_binary_expression_get_operator (expr); |
| 32078 | _tmp258_ = _tmp257_; |
| 32079 | switch (_tmp258_) { |
| 32080 | case BALA_BINARY_OPERATOR_PLUS: |
| 32081 | { |
| 32082 | gboolean _tmp259_ = FALSE(0); |
| 32083 | BalaExpression* _tmp260_; |
| 32084 | BalaExpression* _tmp261_; |
| 32085 | _tmp260_ = bala_binary_expression_get_left (expr); |
| 32086 | _tmp261_ = _tmp260_; |
| 32087 | if (bala_expression_is_constant (_tmp261_)) { |
| 32088 | BalaExpression* _tmp262_; |
| 32089 | BalaExpression* _tmp263_; |
| 32090 | _tmp262_ = bala_binary_expression_get_right (expr); |
| 32091 | _tmp263_ = _tmp262_; |
| 32092 | _tmp259_ = bala_expression_is_constant (_tmp263_); |
| 32093 | } else { |
| 32094 | _tmp259_ = FALSE(0); |
| 32095 | } |
| 32096 | if (_tmp259_) { |
| 32097 | gchar* left = NULL((void*)0); |
| 32098 | gchar* right = NULL((void*)0); |
| 32099 | BalaCCodeExpression* _tmp264_; |
| 32100 | BalaCCodeExpression* _tmp277_; |
| 32101 | const gchar* _tmp290_; |
| 32102 | const gchar* _tmp291_; |
| 32103 | gchar* _tmp292_; |
| 32104 | gchar* _tmp293_; |
| 32105 | BalaCCodeConstant* _tmp294_; |
| 32106 | BalaCCodeConstant* _tmp295_; |
| 32107 | _tmp264_ = cleft; |
| 32108 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp264_, BALA_TYPE_CCODE_IDENTIFIER)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp264_); GType __t = ((bala_ccode_identifier_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 32109 | BalaCCodeExpression* _tmp265_; |
| 32110 | const gchar* _tmp266_; |
| 32111 | const gchar* _tmp267_; |
| 32112 | gchar* _tmp268_; |
| 32113 | _tmp265_ = cleft; |
| 32114 | _tmp266_ = bala_ccode_identifier_get_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp265_, BALA_TYPE_CCODE_IDENTIFIER, BalaCCodeIdentifier)(((BalaCCodeIdentifier*) g_type_check_instance_cast ((GTypeInstance *) (_tmp265_), ((bala_ccode_identifier_get_type ())))))); |
| 32115 | _tmp267_ = _tmp266_; |
| 32116 | _tmp268_ = g_strdup (_tmp267_); |
| 32117 | _g_free0 (left)(left = (g_free (left), ((void*)0))); |
| 32118 | left = _tmp268_; |
| 32119 | } else { |
| 32120 | BalaCCodeExpression* _tmp269_; |
| 32121 | _tmp269_ = cleft; |
| 32122 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp269_, BALA_TYPE_CCODE_CONSTANT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp269_); GType __t = ((bala_ccode_constant_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 32123 | BalaCCodeExpression* _tmp270_; |
| 32124 | const gchar* _tmp271_; |
| 32125 | const gchar* _tmp272_; |
| 32126 | gchar* _tmp273_; |
| 32127 | _tmp270_ = cleft; |
| 32128 | _tmp271_ = bala_ccode_constant_get_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp270_, BALA_TYPE_CCODE_CONSTANT, BalaCCodeConstant)(((BalaCCodeConstant*) g_type_check_instance_cast ((GTypeInstance *) (_tmp270_), ((bala_ccode_constant_get_type ())))))); |
| 32129 | _tmp272_ = _tmp271_; |
| 32130 | _tmp273_ = g_strdup (_tmp272_); |
| 32131 | _g_free0 (left)(left = (g_free (left), ((void*)0))); |
| 32132 | left = _tmp273_; |
| 32133 | } else { |
| 32134 | BalaSourceReference* _tmp274_; |
| 32135 | BalaSourceReference* _tmp275_; |
| 32136 | gchar* _tmp276_; |
| 32137 | _tmp274_ = bala_code_node_get_source_reference ((BalaCodeNode*) expr); |
| 32138 | _tmp275_ = _tmp274_; |
| 32139 | bala_report_error (_tmp275_, "internal: Unsupported expression"); |
| 32140 | _tmp276_ = g_strdup ("NULL"); |
| 32141 | _g_free0 (left)(left = (g_free (left), ((void*)0))); |
| 32142 | left = _tmp276_; |
| 32143 | } |
| 32144 | } |
| 32145 | _tmp277_ = cright; |
| 32146 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp277_, BALA_TYPE_CCODE_IDENTIFIER)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp277_); GType __t = ((bala_ccode_identifier_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 32147 | BalaCCodeExpression* _tmp278_; |
| 32148 | const gchar* _tmp279_; |
| 32149 | const gchar* _tmp280_; |
| 32150 | gchar* _tmp281_; |
| 32151 | _tmp278_ = cright; |
| 32152 | _tmp279_ = bala_ccode_identifier_get_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp278_, BALA_TYPE_CCODE_IDENTIFIER, BalaCCodeIdentifier)(((BalaCCodeIdentifier*) g_type_check_instance_cast ((GTypeInstance *) (_tmp278_), ((bala_ccode_identifier_get_type ())))))); |
| 32153 | _tmp280_ = _tmp279_; |
| 32154 | _tmp281_ = g_strdup (_tmp280_); |
| 32155 | _g_free0 (right)(right = (g_free (right), ((void*)0))); |
| 32156 | right = _tmp281_; |
| 32157 | } else { |
| 32158 | BalaCCodeExpression* _tmp282_; |
| 32159 | _tmp282_ = cright; |
| 32160 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp282_, BALA_TYPE_CCODE_CONSTANT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp282_); GType __t = ((bala_ccode_constant_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 32161 | BalaCCodeExpression* _tmp283_; |
| 32162 | const gchar* _tmp284_; |
| 32163 | const gchar* _tmp285_; |
| 32164 | gchar* _tmp286_; |
| 32165 | _tmp283_ = cright; |
| 32166 | _tmp284_ = bala_ccode_constant_get_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp283_, BALA_TYPE_CCODE_CONSTANT, BalaCCodeConstant)(((BalaCCodeConstant*) g_type_check_instance_cast ((GTypeInstance *) (_tmp283_), ((bala_ccode_constant_get_type ())))))); |
| 32167 | _tmp285_ = _tmp284_; |
| 32168 | _tmp286_ = g_strdup (_tmp285_); |
| 32169 | _g_free0 (right)(right = (g_free (right), ((void*)0))); |
| 32170 | right = _tmp286_; |
| 32171 | } else { |
| 32172 | BalaSourceReference* _tmp287_; |
| 32173 | BalaSourceReference* _tmp288_; |
| 32174 | gchar* _tmp289_; |
| 32175 | _tmp287_ = bala_code_node_get_source_reference ((BalaCodeNode*) expr); |
| 32176 | _tmp288_ = _tmp287_; |
| 32177 | bala_report_error (_tmp288_, "internal: Unsupported expression"); |
| 32178 | _tmp289_ = g_strdup ("NULL"); |
| 32179 | _g_free0 (right)(right = (g_free (right), ((void*)0))); |
| 32180 | right = _tmp289_; |
| 32181 | } |
| 32182 | } |
| 32183 | _tmp290_ = left; |
| 32184 | _tmp291_ = right; |
| 32185 | _tmp292_ = g_strdup_printf ("%s %s", _tmp290_, _tmp291_); |
| 32186 | _tmp293_ = _tmp292_; |
| 32187 | _tmp294_ = bala_ccode_constant_new (_tmp293_); |
| 32188 | _tmp295_ = _tmp294_; |
| 32189 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp295_); |
| 32190 | _bala_ccode_node_unref0 (_tmp295_)((_tmp295_ == ((void*)0)) ? ((void*)0) : (_tmp295_ = (bala_ccode_node_unref (_tmp295_), ((void*)0)))); |
| 32191 | _g_free0 (_tmp293_)(_tmp293_ = (g_free (_tmp293_), ((void*)0))); |
| 32192 | _g_free0 (right)(right = (g_free (right), ((void*)0))); |
| 32193 | _g_free0 (left)(left = (g_free (left), ((void*)0))); |
| 32194 | } else { |
| 32195 | BalaTargetValue* temp_value = NULL((void*)0); |
| 32196 | BalaDataType* _tmp296_; |
| 32197 | BalaDataType* _tmp297_; |
| 32198 | BalaTargetValue* _tmp298_; |
| 32199 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 32200 | BalaCodeContext* _tmp299_; |
| 32201 | BalaProfile _tmp300_; |
| 32202 | BalaProfile _tmp301_; |
| 32203 | BalaCCodeFunction* _tmp353_; |
| 32204 | BalaCCodeFunction* _tmp354_; |
| 32205 | BalaTargetValue* _tmp355_; |
| 32206 | BalaCCodeExpression* _tmp356_; |
| 32207 | BalaCCodeFunctionCall* _tmp357_; |
| 32208 | BalaTargetValue* _tmp358_; |
| 32209 | _tmp296_ = bala_expression_get_value_type ((BalaExpression*) expr); |
| 32210 | _tmp297_ = _tmp296_; |
| 32211 | _tmp298_ = bala_ccode_base_module_create_temp_value (self, _tmp297_, FALSE(0), (BalaCodeNode*) expr, NULL((void*)0)); |
| 32212 | temp_value = _tmp298_; |
| 32213 | _tmp299_ = self->priv->_context; |
| 32214 | _tmp300_ = bala_code_context_get_profile (_tmp299_); |
| 32215 | _tmp301_ = _tmp300_; |
| 32216 | if (_tmp301_ == BALA_PROFILE_POSIX) { |
| 32217 | BalaCCodeIdentifier* _tmp302_; |
| 32218 | BalaCCodeIdentifier* _tmp303_; |
| 32219 | BalaCCodeFunctionCall* _tmp304_; |
| 32220 | BalaCCodeFunctionCall* strcpy = NULL((void*)0); |
| 32221 | BalaCCodeIdentifier* _tmp305_; |
| 32222 | BalaCCodeIdentifier* _tmp306_; |
| 32223 | BalaCCodeFunctionCall* _tmp307_; |
| 32224 | BalaCCodeFunctionCall* _tmp308_; |
| 32225 | BalaCCodeFunctionCall* malloc = NULL((void*)0); |
| 32226 | BalaCCodeIdentifier* _tmp309_; |
| 32227 | BalaCCodeIdentifier* _tmp310_; |
| 32228 | BalaCCodeFunctionCall* _tmp311_; |
| 32229 | BalaCCodeFunctionCall* _tmp312_; |
| 32230 | BalaCCodeFunctionCall* strlen_a = NULL((void*)0); |
| 32231 | BalaCCodeIdentifier* _tmp313_; |
| 32232 | BalaCCodeIdentifier* _tmp314_; |
| 32233 | BalaCCodeFunctionCall* _tmp315_; |
| 32234 | BalaCCodeFunctionCall* _tmp316_; |
| 32235 | BalaCCodeFunctionCall* _tmp317_; |
| 32236 | BalaCCodeExpression* _tmp318_; |
| 32237 | BalaCCodeFunctionCall* strlen_b = NULL((void*)0); |
| 32238 | BalaCCodeIdentifier* _tmp319_; |
| 32239 | BalaCCodeIdentifier* _tmp320_; |
| 32240 | BalaCCodeFunctionCall* _tmp321_; |
| 32241 | BalaCCodeFunctionCall* _tmp322_; |
| 32242 | BalaCCodeFunctionCall* _tmp323_; |
| 32243 | BalaCCodeExpression* _tmp324_; |
| 32244 | BalaCCodeBinaryExpression* newlength = NULL((void*)0); |
| 32245 | BalaCCodeIdentifier* _tmp325_; |
| 32246 | BalaCCodeIdentifier* _tmp326_; |
| 32247 | BalaCCodeFunctionCall* _tmp327_; |
| 32248 | BalaCCodeFunctionCall* _tmp328_; |
| 32249 | BalaCCodeBinaryExpression* _tmp329_; |
| 32250 | BalaCCodeBinaryExpression* _tmp330_; |
| 32251 | BalaCCodeBinaryExpression* _tmp331_; |
| 32252 | BalaCCodeBinaryExpression* _tmp332_; |
| 32253 | BalaCCodeFunctionCall* _tmp333_; |
| 32254 | BalaCCodeBinaryExpression* _tmp334_; |
| 32255 | BalaCCodeFunctionCall* _tmp335_; |
| 32256 | BalaCCodeFunctionCall* _tmp336_; |
| 32257 | BalaCCodeFunctionCall* _tmp337_; |
| 32258 | BalaCCodeExpression* _tmp338_; |
| 32259 | BalaCCodeFunctionCall* _tmp339_; |
| 32260 | BalaCCodeFunctionCall* _tmp340_; |
| 32261 | BalaCCodeFunctionCall* _tmp341_; |
| 32262 | BalaCCodeExpression* _tmp342_; |
| 32263 | _tmp302_ = bala_ccode_identifier_new ("strcat"); |
| 32264 | _tmp303_ = _tmp302_; |
| 32265 | _tmp304_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp303_); |
| 32266 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 32267 | ccall = _tmp304_; |
| 32268 | _bala_ccode_node_unref0 (_tmp303_)((_tmp303_ == ((void*)0)) ? ((void*)0) : (_tmp303_ = (bala_ccode_node_unref (_tmp303_), ((void*)0)))); |
| 32269 | _tmp305_ = bala_ccode_identifier_new ("strcpy"); |
| 32270 | _tmp306_ = _tmp305_; |
| 32271 | _tmp307_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp306_); |
| 32272 | _tmp308_ = _tmp307_; |
| 32273 | _bala_ccode_node_unref0 (_tmp306_)((_tmp306_ == ((void*)0)) ? ((void*)0) : (_tmp306_ = (bala_ccode_node_unref (_tmp306_), ((void*)0)))); |
| 32274 | strcpy = _tmp308_; |
| 32275 | _tmp309_ = bala_ccode_identifier_new ("malloc"); |
| 32276 | _tmp310_ = _tmp309_; |
| 32277 | _tmp311_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp310_); |
| 32278 | _tmp312_ = _tmp311_; |
| 32279 | _bala_ccode_node_unref0 (_tmp310_)((_tmp310_ == ((void*)0)) ? ((void*)0) : (_tmp310_ = (bala_ccode_node_unref (_tmp310_), ((void*)0)))); |
| 32280 | malloc = _tmp312_; |
| 32281 | _tmp313_ = bala_ccode_identifier_new ("strlen"); |
| 32282 | _tmp314_ = _tmp313_; |
| 32283 | _tmp315_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp314_); |
| 32284 | _tmp316_ = _tmp315_; |
| 32285 | _bala_ccode_node_unref0 (_tmp314_)((_tmp314_ == ((void*)0)) ? ((void*)0) : (_tmp314_ = (bala_ccode_node_unref (_tmp314_), ((void*)0)))); |
| 32286 | strlen_a = _tmp316_; |
| 32287 | _tmp317_ = strlen_a; |
| 32288 | _tmp318_ = cleft; |
| 32289 | bala_ccode_function_call_add_argument (_tmp317_, _tmp318_); |
| 32290 | _tmp319_ = bala_ccode_identifier_new ("strlen"); |
| 32291 | _tmp320_ = _tmp319_; |
| 32292 | _tmp321_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp320_); |
| 32293 | _tmp322_ = _tmp321_; |
| 32294 | _bala_ccode_node_unref0 (_tmp320_)((_tmp320_ == ((void*)0)) ? ((void*)0) : (_tmp320_ = (bala_ccode_node_unref (_tmp320_), ((void*)0)))); |
| 32295 | strlen_b = _tmp322_; |
| 32296 | _tmp323_ = strlen_b; |
| 32297 | _tmp324_ = cright; |
| 32298 | bala_ccode_function_call_add_argument (_tmp323_, _tmp324_); |
| 32299 | _tmp325_ = bala_ccode_identifier_new ("1"); |
| 32300 | _tmp326_ = _tmp325_; |
| 32301 | _tmp327_ = strlen_a; |
| 32302 | _tmp328_ = strlen_b; |
| 32303 | _tmp329_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_PLUS, (BalaCCodeExpression*) _tmp327_, (BalaCCodeExpression*) _tmp328_); |
| 32304 | _tmp330_ = _tmp329_; |
| 32305 | _tmp331_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_PLUS, (BalaCCodeExpression*) _tmp326_, (BalaCCodeExpression*) _tmp330_); |
| 32306 | _tmp332_ = _tmp331_; |
| 32307 | _bala_ccode_node_unref0 (_tmp330_)((_tmp330_ == ((void*)0)) ? ((void*)0) : (_tmp330_ = (bala_ccode_node_unref (_tmp330_), ((void*)0)))); |
| 32308 | _bala_ccode_node_unref0 (_tmp326_)((_tmp326_ == ((void*)0)) ? ((void*)0) : (_tmp326_ = (bala_ccode_node_unref (_tmp326_), ((void*)0)))); |
| 32309 | newlength = _tmp332_; |
| 32310 | _tmp333_ = malloc; |
| 32311 | _tmp334_ = newlength; |
| 32312 | bala_ccode_function_call_add_argument (_tmp333_, (BalaCCodeExpression*) _tmp334_); |
| 32313 | _tmp335_ = strcpy; |
| 32314 | _tmp336_ = malloc; |
| 32315 | bala_ccode_function_call_add_argument (_tmp335_, (BalaCCodeExpression*) _tmp336_); |
| 32316 | _tmp337_ = strcpy; |
| 32317 | _tmp338_ = cleft; |
| 32318 | bala_ccode_function_call_add_argument (_tmp337_, _tmp338_); |
| 32319 | _tmp339_ = ccall; |
| 32320 | _tmp340_ = strcpy; |
| 32321 | bala_ccode_function_call_add_argument (_tmp339_, (BalaCCodeExpression*) _tmp340_); |
| 32322 | _tmp341_ = ccall; |
| 32323 | _tmp342_ = cright; |
| 32324 | bala_ccode_function_call_add_argument (_tmp341_, _tmp342_); |
| 32325 | _bala_ccode_node_unref0 (newlength)((newlength == ((void*)0)) ? ((void*)0) : (newlength = (bala_ccode_node_unref (newlength), ((void*)0)))); |
| 32326 | _bala_ccode_node_unref0 (strlen_b)((strlen_b == ((void*)0)) ? ((void*)0) : (strlen_b = (bala_ccode_node_unref (strlen_b), ((void*)0)))); |
| 32327 | _bala_ccode_node_unref0 (strlen_a)((strlen_a == ((void*)0)) ? ((void*)0) : (strlen_a = (bala_ccode_node_unref (strlen_a), ((void*)0)))); |
| 32328 | _bala_ccode_node_unref0 (malloc)((malloc == ((void*)0)) ? ((void*)0) : (malloc = (bala_ccode_node_unref (malloc), ((void*)0)))); |
| 32329 | _bala_ccode_node_unref0 (strcpy)((strcpy == ((void*)0)) ? ((void*)0) : (strcpy = (bala_ccode_node_unref (strcpy), ((void*)0)))); |
| 32330 | } else { |
| 32331 | BalaCCodeIdentifier* _tmp343_; |
| 32332 | BalaCCodeIdentifier* _tmp344_; |
| 32333 | BalaCCodeFunctionCall* _tmp345_; |
| 32334 | BalaCCodeFunctionCall* _tmp346_; |
| 32335 | BalaCCodeExpression* _tmp347_; |
| 32336 | BalaCCodeFunctionCall* _tmp348_; |
| 32337 | BalaCCodeExpression* _tmp349_; |
| 32338 | BalaCCodeFunctionCall* _tmp350_; |
| 32339 | BalaCCodeConstant* _tmp351_; |
| 32340 | BalaCCodeConstant* _tmp352_; |
| 32341 | _tmp343_ = bala_ccode_identifier_new ("g_strconcat"); |
| 32342 | _tmp344_ = _tmp343_; |
| 32343 | _tmp345_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp344_); |
| 32344 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 32345 | ccall = _tmp345_; |
| 32346 | _bala_ccode_node_unref0 (_tmp344_)((_tmp344_ == ((void*)0)) ? ((void*)0) : (_tmp344_ = (bala_ccode_node_unref (_tmp344_), ((void*)0)))); |
| 32347 | _tmp346_ = ccall; |
| 32348 | _tmp347_ = cleft; |
| 32349 | bala_ccode_function_call_add_argument (_tmp346_, _tmp347_); |
| 32350 | _tmp348_ = ccall; |
| 32351 | _tmp349_ = cright; |
| 32352 | bala_ccode_function_call_add_argument (_tmp348_, _tmp349_); |
| 32353 | _tmp350_ = ccall; |
| 32354 | _tmp351_ = bala_ccode_constant_new ("NULL"); |
| 32355 | _tmp352_ = _tmp351_; |
| 32356 | bala_ccode_function_call_add_argument (_tmp350_, (BalaCCodeExpression*) _tmp352_); |
| 32357 | _bala_ccode_node_unref0 (_tmp352_)((_tmp352_ == ((void*)0)) ? ((void*)0) : (_tmp352_ = (bala_ccode_node_unref (_tmp352_), ((void*)0)))); |
| 32358 | } |
| 32359 | _tmp353_ = bala_ccode_base_module_get_ccode (self); |
| 32360 | _tmp354_ = _tmp353_; |
| 32361 | _tmp355_ = temp_value; |
| 32362 | _tmp356_ = bala_get_cvalue_ (_tmp355_); |
| 32363 | _tmp357_ = ccall; |
| 32364 | bala_ccode_function_add_assignment (_tmp354_, _tmp356_, (BalaCCodeExpression*) _tmp357_); |
| 32365 | _tmp358_ = temp_value; |
| 32366 | bala_expression_set_target_value ((BalaExpression*) expr, _tmp358_); |
| 32367 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 32368 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 32369 | } |
| 32370 | _bala_ccode_node_unref0 (left_chain)((left_chain == ((void*)0)) ? ((void*)0) : (left_chain = (bala_ccode_node_unref (left_chain), ((void*)0)))); |
| 32371 | _bala_ccode_node_unref0 (cright)((cright == ((void*)0)) ? ((void*)0) : (cright = (bala_ccode_node_unref (cright), ((void*)0)))); |
| 32372 | _bala_ccode_node_unref0 (cleft)((cleft == ((void*)0)) ? ((void*)0) : (cleft = (bala_ccode_node_unref (cleft), ((void*)0)))); |
| 32373 | return; |
| 32374 | } |
| 32375 | case BALA_BINARY_OPERATOR_EQUALITY: |
| 32376 | case BALA_BINARY_OPERATOR_INEQUALITY: |
| 32377 | case BALA_BINARY_OPERATOR_LESS_THAN: |
| 32378 | case BALA_BINARY_OPERATOR_GREATER_THAN: |
| 32379 | case BALA_BINARY_OPERATOR_LESS_THAN_OR_EQUAL: |
| 32380 | case BALA_BINARY_OPERATOR_GREATER_THAN_OR_EQUAL: |
| 32381 | { |
| 32382 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 32383 | BalaCodeContext* _tmp359_; |
| 32384 | BalaProfile _tmp360_; |
| 32385 | BalaProfile _tmp361_; |
| 32386 | BalaCCodeFunctionCall* _tmp373_; |
| 32387 | BalaCCodeExpression* _tmp374_; |
| 32388 | BalaCCodeFunctionCall* _tmp375_; |
| 32389 | BalaCCodeExpression* _tmp376_; |
| 32390 | BalaCCodeFunctionCall* _tmp377_; |
| 32391 | BalaCCodeExpression* _tmp378_; |
| 32392 | BalaCCodeConstant* _tmp379_; |
| 32393 | _tmp359_ = self->priv->_context; |
| 32394 | _tmp360_ = bala_code_context_get_profile (_tmp359_); |
| 32395 | _tmp361_ = _tmp360_; |
| 32396 | if (_tmp361_ == BALA_PROFILE_POSIX) { |
| 32397 | BalaCCodeFile* _tmp362_; |
| 32398 | BalaCCodeIdentifier* _tmp363_; |
| 32399 | BalaCCodeIdentifier* _tmp364_; |
| 32400 | gchar* _tmp365_; |
| 32401 | gchar* _tmp366_; |
| 32402 | BalaCCodeIdentifier* _tmp367_; |
| 32403 | BalaCCodeIdentifier* _tmp368_; |
| 32404 | BalaCCodeFunctionCall* _tmp369_; |
| 32405 | _tmp362_ = self->cfile; |
| 32406 | bala_ccode_file_add_include (_tmp362_, "string.h", FALSE(0)); |
| 32407 | _tmp363_ = bala_ccode_identifier_new ("strcmp"); |
| 32408 | _tmp364_ = _tmp363_; |
| 32409 | _tmp365_ = bala_ccode_base_module_generate_cmp_wrapper (self, _tmp364_); |
| 32410 | _tmp366_ = _tmp365_; |
| 32411 | _tmp367_ = bala_ccode_identifier_new (_tmp366_); |
| 32412 | _tmp368_ = _tmp367_; |
| 32413 | _tmp369_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp368_); |
| 32414 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 32415 | ccall = _tmp369_; |
| 32416 | _bala_ccode_node_unref0 (_tmp368_)((_tmp368_ == ((void*)0)) ? ((void*)0) : (_tmp368_ = (bala_ccode_node_unref (_tmp368_), ((void*)0)))); |
| 32417 | _g_free0 (_tmp366_)(_tmp366_ = (g_free (_tmp366_), ((void*)0))); |
| 32418 | _bala_ccode_node_unref0 (_tmp364_)((_tmp364_ == ((void*)0)) ? ((void*)0) : (_tmp364_ = (bala_ccode_node_unref (_tmp364_), ((void*)0)))); |
| 32419 | } else { |
| 32420 | BalaCCodeIdentifier* _tmp370_; |
| 32421 | BalaCCodeIdentifier* _tmp371_; |
| 32422 | BalaCCodeFunctionCall* _tmp372_; |
| 32423 | _tmp370_ = bala_ccode_identifier_new ("g_strcmp0"); |
| 32424 | _tmp371_ = _tmp370_; |
| 32425 | _tmp372_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp371_); |
| 32426 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 32427 | ccall = _tmp372_; |
| 32428 | _bala_ccode_node_unref0 (_tmp371_)((_tmp371_ == ((void*)0)) ? ((void*)0) : (_tmp371_ = (bala_ccode_node_unref (_tmp371_), ((void*)0)))); |
| 32429 | } |
| 32430 | _tmp373_ = ccall; |
| 32431 | _tmp374_ = cleft; |
| 32432 | bala_ccode_function_call_add_argument (_tmp373_, _tmp374_); |
| 32433 | _tmp375_ = ccall; |
| 32434 | _tmp376_ = cright; |
| 32435 | bala_ccode_function_call_add_argument (_tmp375_, _tmp376_); |
| 32436 | _tmp377_ = ccall; |
| 32437 | _tmp378_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp377_); |
| 32438 | _bala_ccode_node_unref0 (cleft)((cleft == ((void*)0)) ? ((void*)0) : (cleft = (bala_ccode_node_unref (cleft), ((void*)0)))); |
| 32439 | cleft = _tmp378_; |
| 32440 | _tmp379_ = bala_ccode_constant_new ("0"); |
| 32441 | _bala_ccode_node_unref0 (cright)((cright == ((void*)0)) ? ((void*)0) : (cright = (bala_ccode_node_unref (cright), ((void*)0)))); |
| 32442 | cright = (BalaCCodeExpression*) _tmp379_; |
| 32443 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 32444 | break; |
| 32445 | } |
| 32446 | default: |
| 32447 | { |
| 32448 | break; |
| 32449 | } |
| 32450 | } |
| 32451 | } |
| 32452 | _tmp380_ = op; |
| 32453 | _tmp381_ = cleft; |
| 32454 | _tmp382_ = cright; |
| 32455 | _tmp383_ = bala_ccode_binary_expression_new (_tmp380_, _tmp381_, _tmp382_); |
| 32456 | _tmp384_ = _tmp383_; |
| 32457 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp384_); |
| 32458 | _bala_ccode_node_unref0 (_tmp384_)((_tmp384_ == ((void*)0)) ? ((void*)0) : (_tmp384_ = (bala_ccode_node_unref (_tmp384_), ((void*)0)))); |
| 32459 | _tmp385_ = left_chain; |
| 32460 | if (_tmp385_ != NULL((void*)0)) { |
| 32461 | BalaCCodeExpression* _tmp386_; |
| 32462 | BalaCCodeExpression* _tmp387_; |
| 32463 | BalaCCodeBinaryExpression* _tmp388_; |
| 32464 | BalaCCodeBinaryExpression* _tmp389_; |
| 32465 | _tmp386_ = left_chain; |
| 32466 | _tmp387_ = bala_get_cvalue ((BalaExpression*) expr); |
| 32467 | _tmp388_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_AND, _tmp386_, _tmp387_); |
| 32468 | _tmp389_ = _tmp388_; |
| 32469 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp389_); |
| 32470 | _bala_ccode_node_unref0 (_tmp389_)((_tmp389_ == ((void*)0)) ? ((void*)0) : (_tmp389_ = (bala_ccode_node_unref (_tmp389_), ((void*)0)))); |
| 32471 | } |
| 32472 | _bala_ccode_node_unref0 (left_chain)((left_chain == ((void*)0)) ? ((void*)0) : (left_chain = (bala_ccode_node_unref (left_chain), ((void*)0)))); |
| 32473 | _bala_ccode_node_unref0 (cright)((cright == ((void*)0)) ? ((void*)0) : (cright = (bala_ccode_node_unref (cright), ((void*)0)))); |
| 32474 | _bala_ccode_node_unref0 (cleft)((cleft == ((void*)0)) ? ((void*)0) : (cleft = (bala_ccode_node_unref (cleft), ((void*)0)))); |
| 32475 | } |
| 32476 | |
| 32477 | BalaCCodeExpression* |
| 32478 | bala_ccode_base_module_create_type_check (BalaCCodeBaseModule* self, |
| 32479 | BalaCCodeNode* ccodenode, |
| 32480 | BalaDataType* type) |
| 32481 | { |
| 32482 | BalaErrorType* et = NULL((void*)0); |
| 32483 | BalaErrorType* _tmp0_; |
| 32484 | gboolean _tmp1_ = FALSE(0); |
| 32485 | BalaErrorType* _tmp2_; |
| 32486 | BalaCCodeExpression* result = NULL((void*)0); |
| 32487 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 32488 | g_return_val_if_fail (ccodenode != NULL, NULL)do { if ((ccodenode != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "ccodenode != NULL" ); return (((void*)0)); } } while (0); |
| 32489 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 32490 | _tmp0_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ERROR_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_error_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaErrorType*) type) : NULL((void*)0)); |
| 32491 | et = _tmp0_; |
| 32492 | _tmp2_ = et; |
| 32493 | if (_tmp2_ != NULL((void*)0)) { |
| 32494 | BalaErrorType* _tmp3_; |
| 32495 | BalaErrorCode* _tmp4_; |
| 32496 | BalaErrorCode* _tmp5_; |
| 32497 | _tmp3_ = et; |
| 32498 | _tmp4_ = bala_error_type_get_error_code (_tmp3_); |
| 32499 | _tmp5_ = _tmp4_; |
| 32500 | _tmp1_ = _tmp5_ != NULL((void*)0); |
| 32501 | } else { |
| 32502 | _tmp1_ = FALSE(0); |
| 32503 | } |
| 32504 | if (_tmp1_) { |
| 32505 | BalaCCodeFunctionCall* matches_call = NULL((void*)0); |
| 32506 | BalaCCodeIdentifier* _tmp6_; |
| 32507 | BalaCCodeIdentifier* _tmp7_; |
| 32508 | BalaCCodeFunctionCall* _tmp8_; |
| 32509 | BalaCCodeFunctionCall* _tmp9_; |
| 32510 | BalaCCodeFunctionCall* _tmp10_; |
| 32511 | BalaCCodeFunctionCall* _tmp11_; |
| 32512 | BalaErrorType* _tmp12_; |
| 32513 | BalaErrorDomain* _tmp13_; |
| 32514 | BalaErrorDomain* _tmp14_; |
| 32515 | gchar* _tmp15_; |
| 32516 | gchar* _tmp16_; |
| 32517 | BalaCCodeIdentifier* _tmp17_; |
| 32518 | BalaCCodeIdentifier* _tmp18_; |
| 32519 | BalaCCodeFunctionCall* _tmp19_; |
| 32520 | BalaErrorType* _tmp20_; |
| 32521 | BalaErrorCode* _tmp21_; |
| 32522 | BalaErrorCode* _tmp22_; |
| 32523 | gchar* _tmp23_; |
| 32524 | gchar* _tmp24_; |
| 32525 | BalaCCodeIdentifier* _tmp25_; |
| 32526 | BalaCCodeIdentifier* _tmp26_; |
| 32527 | _tmp6_ = bala_ccode_identifier_new ("g_error_matches"); |
| 32528 | _tmp7_ = _tmp6_; |
| 32529 | _tmp8_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp7_); |
| 32530 | _tmp9_ = _tmp8_; |
| 32531 | _bala_ccode_node_unref0 (_tmp7_)((_tmp7_ == ((void*)0)) ? ((void*)0) : (_tmp7_ = (bala_ccode_node_unref (_tmp7_), ((void*)0)))); |
| 32532 | matches_call = _tmp9_; |
| 32533 | _tmp10_ = matches_call; |
| 32534 | bala_ccode_function_call_add_argument (_tmp10_, G_TYPE_CHECK_INSTANCE_CAST (ccodenode, BALA_TYPE_CCODE_EXPRESSION, BalaCCodeExpression)(((BalaCCodeExpression*) g_type_check_instance_cast ((GTypeInstance *) (ccodenode), ((bala_ccode_expression_get_type ())))))); |
| 32535 | _tmp11_ = matches_call; |
| 32536 | _tmp12_ = et; |
| 32537 | _tmp13_ = bala_error_type_get_error_domain (_tmp12_); |
| 32538 | _tmp14_ = _tmp13_; |
| 32539 | _tmp15_ = bala_get_ccode_upper_case_name ((BalaSymbol*) _tmp14_, NULL((void*)0)); |
| 32540 | _tmp16_ = _tmp15_; |
| 32541 | _tmp17_ = bala_ccode_identifier_new (_tmp16_); |
| 32542 | _tmp18_ = _tmp17_; |
| 32543 | bala_ccode_function_call_add_argument (_tmp11_, (BalaCCodeExpression*) _tmp18_); |
| 32544 | _bala_ccode_node_unref0 (_tmp18_)((_tmp18_ == ((void*)0)) ? ((void*)0) : (_tmp18_ = (bala_ccode_node_unref (_tmp18_), ((void*)0)))); |
| 32545 | _g_free0 (_tmp16_)(_tmp16_ = (g_free (_tmp16_), ((void*)0))); |
| 32546 | _tmp19_ = matches_call; |
| 32547 | _tmp20_ = et; |
| 32548 | _tmp21_ = bala_error_type_get_error_code (_tmp20_); |
| 32549 | _tmp22_ = _tmp21_; |
| 32550 | _tmp23_ = bala_get_ccode_name ((BalaCodeNode*) _tmp22_); |
| 32551 | _tmp24_ = _tmp23_; |
| 32552 | _tmp25_ = bala_ccode_identifier_new (_tmp24_); |
| 32553 | _tmp26_ = _tmp25_; |
| 32554 | bala_ccode_function_call_add_argument (_tmp19_, (BalaCCodeExpression*) _tmp26_); |
| 32555 | _bala_ccode_node_unref0 (_tmp26_)((_tmp26_ == ((void*)0)) ? ((void*)0) : (_tmp26_ = (bala_ccode_node_unref (_tmp26_), ((void*)0)))); |
| 32556 | _g_free0 (_tmp24_)(_tmp24_ = (g_free (_tmp24_), ((void*)0))); |
| 32557 | result = (BalaCCodeExpression*) matches_call; |
| 32558 | _bala_code_node_unref0 (et)((et == ((void*)0)) ? ((void*)0) : (et = (bala_code_node_unref (et), ((void*)0)))); |
| 32559 | return result; |
| 32560 | } else { |
| 32561 | gboolean _tmp27_ = FALSE(0); |
| 32562 | BalaErrorType* _tmp28_; |
| 32563 | _tmp28_ = et; |
| 32564 | if (_tmp28_ != NULL((void*)0)) { |
| 32565 | BalaErrorType* _tmp29_; |
| 32566 | BalaErrorDomain* _tmp30_; |
| 32567 | BalaErrorDomain* _tmp31_; |
| 32568 | _tmp29_ = et; |
| 32569 | _tmp30_ = bala_error_type_get_error_domain (_tmp29_); |
| 32570 | _tmp31_ = _tmp30_; |
| 32571 | _tmp27_ = _tmp31_ != NULL((void*)0); |
| 32572 | } else { |
| 32573 | _tmp27_ = FALSE(0); |
| 32574 | } |
| 32575 | if (_tmp27_) { |
| 32576 | BalaCCodeMemberAccess* instance_domain = NULL((void*)0); |
| 32577 | BalaCCodeMemberAccess* _tmp32_; |
| 32578 | BalaCCodeIdentifier* type_domain = NULL((void*)0); |
| 32579 | BalaErrorType* _tmp33_; |
| 32580 | BalaErrorDomain* _tmp34_; |
| 32581 | BalaErrorDomain* _tmp35_; |
| 32582 | gchar* _tmp36_; |
| 32583 | gchar* _tmp37_; |
| 32584 | BalaCCodeIdentifier* _tmp38_; |
| 32585 | BalaCCodeIdentifier* _tmp39_; |
| 32586 | BalaCCodeMemberAccess* _tmp40_; |
| 32587 | BalaCCodeIdentifier* _tmp41_; |
| 32588 | BalaCCodeBinaryExpression* _tmp42_; |
| 32589 | _tmp32_ = bala_ccode_member_access_new_pointer (G_TYPE_CHECK_INSTANCE_CAST (ccodenode, BALA_TYPE_CCODE_EXPRESSION, BalaCCodeExpression)(((BalaCCodeExpression*) g_type_check_instance_cast ((GTypeInstance *) (ccodenode), ((bala_ccode_expression_get_type ()))))), "domain"); |
| 32590 | instance_domain = _tmp32_; |
| 32591 | _tmp33_ = et; |
| 32592 | _tmp34_ = bala_error_type_get_error_domain (_tmp33_); |
| 32593 | _tmp35_ = _tmp34_; |
| 32594 | _tmp36_ = bala_get_ccode_upper_case_name ((BalaSymbol*) _tmp35_, NULL((void*)0)); |
| 32595 | _tmp37_ = _tmp36_; |
| 32596 | _tmp38_ = bala_ccode_identifier_new (_tmp37_); |
| 32597 | _tmp39_ = _tmp38_; |
| 32598 | _g_free0 (_tmp37_)(_tmp37_ = (g_free (_tmp37_), ((void*)0))); |
| 32599 | type_domain = _tmp39_; |
| 32600 | _tmp40_ = instance_domain; |
| 32601 | _tmp41_ = type_domain; |
| 32602 | _tmp42_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp40_, (BalaCCodeExpression*) _tmp41_); |
| 32603 | result = (BalaCCodeExpression*) _tmp42_; |
| 32604 | _bala_ccode_node_unref0 (type_domain)((type_domain == ((void*)0)) ? ((void*)0) : (type_domain = (bala_ccode_node_unref (type_domain), ((void*)0)))); |
| 32605 | _bala_ccode_node_unref0 (instance_domain)((instance_domain == ((void*)0)) ? ((void*)0) : (instance_domain = (bala_ccode_node_unref (instance_domain), ((void*)0)))); |
| 32606 | _bala_code_node_unref0 (et)((et == ((void*)0)) ? ((void*)0) : (et = (bala_code_node_unref (et), ((void*)0)))); |
| 32607 | return result; |
| 32608 | } else { |
| 32609 | BalaCCodeFunctionCall* ccheck = NULL((void*)0); |
| 32610 | gboolean _tmp43_ = FALSE(0); |
| 32611 | BalaTypeSymbol* _tmp44_; |
| 32612 | BalaTypeSymbol* _tmp45_; |
| 32613 | _tmp44_ = bala_data_type_get_type_symbol (type); |
| 32614 | _tmp45_ = _tmp44_; |
| 32615 | if (_tmp45_ == NULL((void*)0)) { |
| 32616 | _tmp43_ = TRUE(!(0)); |
| 32617 | } else { |
| 32618 | BalaTypeSymbol* _tmp46_; |
| 32619 | BalaTypeSymbol* _tmp47_; |
| 32620 | gboolean _tmp48_; |
| 32621 | gboolean _tmp49_; |
| 32622 | _tmp46_ = bala_data_type_get_type_symbol (type); |
| 32623 | _tmp47_ = _tmp46_; |
| 32624 | _tmp48_ = bala_symbol_get_external_package ((BalaSymbol*) _tmp47_); |
| 32625 | _tmp49_ = _tmp48_; |
| 32626 | _tmp43_ = _tmp49_; |
| 32627 | } |
| 32628 | if (_tmp43_) { |
| 32629 | BalaCCodeExpression* type_id = NULL((void*)0); |
| 32630 | BalaCCodeExpression* _tmp50_; |
| 32631 | BalaCCodeExpression* _tmp51_; |
| 32632 | BalaCCodeIdentifier* _tmp53_; |
| 32633 | BalaCCodeIdentifier* _tmp54_; |
| 32634 | BalaCCodeFunctionCall* _tmp55_; |
| 32635 | BalaCCodeFunctionCall* _tmp56_; |
| 32636 | BalaCCodeFunctionCall* _tmp57_; |
| 32637 | BalaCCodeExpression* _tmp58_; |
| 32638 | _tmp50_ = bala_ccode_base_module_get_type_id_expression (self, type, FALSE(0)); |
| 32639 | type_id = _tmp50_; |
| 32640 | _tmp51_ = type_id; |
| 32641 | if (_tmp51_ == NULL((void*)0)) { |
| 32642 | BalaCCodeInvalidExpression* _tmp52_; |
| 32643 | _tmp52_ = bala_ccode_invalid_expression_new (); |
| 32644 | result = (BalaCCodeExpression*) _tmp52_; |
| 32645 | _bala_ccode_node_unref0 (type_id)((type_id == ((void*)0)) ? ((void*)0) : (type_id = (bala_ccode_node_unref (type_id), ((void*)0)))); |
| 32646 | _bala_ccode_node_unref0 (ccheck)((ccheck == ((void*)0)) ? ((void*)0) : (ccheck = (bala_ccode_node_unref (ccheck), ((void*)0)))); |
| 32647 | _bala_code_node_unref0 (et)((et == ((void*)0)) ? ((void*)0) : (et = (bala_code_node_unref (et), ((void*)0)))); |
| 32648 | return result; |
| 32649 | } |
| 32650 | _tmp53_ = bala_ccode_identifier_new ("G_TYPE_CHECK_INSTANCE_TYPE"); |
| 32651 | _tmp54_ = _tmp53_; |
| 32652 | _tmp55_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp54_); |
| 32653 | _bala_ccode_node_unref0 (ccheck)((ccheck == ((void*)0)) ? ((void*)0) : (ccheck = (bala_ccode_node_unref (ccheck), ((void*)0)))); |
| 32654 | ccheck = _tmp55_; |
| 32655 | _bala_ccode_node_unref0 (_tmp54_)((_tmp54_ == ((void*)0)) ? ((void*)0) : (_tmp54_ = (bala_ccode_node_unref (_tmp54_), ((void*)0)))); |
| 32656 | _tmp56_ = ccheck; |
| 32657 | bala_ccode_function_call_add_argument (_tmp56_, G_TYPE_CHECK_INSTANCE_CAST (ccodenode, BALA_TYPE_CCODE_EXPRESSION, BalaCCodeExpression)(((BalaCCodeExpression*) g_type_check_instance_cast ((GTypeInstance *) (ccodenode), ((bala_ccode_expression_get_type ())))))); |
| 32658 | _tmp57_ = ccheck; |
| 32659 | _tmp58_ = type_id; |
| 32660 | bala_ccode_function_call_add_argument (_tmp57_, _tmp58_); |
| 32661 | _bala_ccode_node_unref0 (type_id)((type_id == ((void*)0)) ? ((void*)0) : (type_id = (bala_ccode_node_unref (type_id), ((void*)0)))); |
| 32662 | } else { |
| 32663 | BalaTypeSymbol* _tmp59_; |
| 32664 | BalaTypeSymbol* _tmp60_; |
| 32665 | gchar* _tmp61_; |
| 32666 | gchar* _tmp62_; |
| 32667 | BalaCCodeIdentifier* _tmp63_; |
| 32668 | BalaCCodeIdentifier* _tmp64_; |
| 32669 | BalaCCodeFunctionCall* _tmp65_; |
| 32670 | BalaCCodeFunctionCall* _tmp66_; |
| 32671 | _tmp59_ = bala_data_type_get_type_symbol (type); |
| 32672 | _tmp60_ = _tmp59_; |
| 32673 | _tmp61_ = bala_get_ccode_type_check_function (_tmp60_); |
| 32674 | _tmp62_ = _tmp61_; |
| 32675 | _tmp63_ = bala_ccode_identifier_new (_tmp62_); |
| 32676 | _tmp64_ = _tmp63_; |
| 32677 | _tmp65_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp64_); |
| 32678 | _bala_ccode_node_unref0 (ccheck)((ccheck == ((void*)0)) ? ((void*)0) : (ccheck = (bala_ccode_node_unref (ccheck), ((void*)0)))); |
| 32679 | ccheck = _tmp65_; |
| 32680 | _bala_ccode_node_unref0 (_tmp64_)((_tmp64_ == ((void*)0)) ? ((void*)0) : (_tmp64_ = (bala_ccode_node_unref (_tmp64_), ((void*)0)))); |
| 32681 | _g_free0 (_tmp62_)(_tmp62_ = (g_free (_tmp62_), ((void*)0))); |
| 32682 | _tmp66_ = ccheck; |
| 32683 | bala_ccode_function_call_add_argument (_tmp66_, G_TYPE_CHECK_INSTANCE_CAST (ccodenode, BALA_TYPE_CCODE_EXPRESSION, BalaCCodeExpression)(((BalaCCodeExpression*) g_type_check_instance_cast ((GTypeInstance *) (ccodenode), ((bala_ccode_expression_get_type ())))))); |
| 32684 | } |
| 32685 | result = (BalaCCodeExpression*) ccheck; |
| 32686 | _bala_code_node_unref0 (et)((et == ((void*)0)) ? ((void*)0) : (et = (bala_code_node_unref (et), ((void*)0)))); |
| 32687 | return result; |
| 32688 | } |
| 32689 | } |
| 32690 | _bala_code_node_unref0 (et)((et == ((void*)0)) ? ((void*)0) : (et = (bala_code_node_unref (et), ((void*)0)))); |
| 32691 | } |
| 32692 | |
| 32693 | static gchar* |
| 32694 | bala_ccode_base_module_generate_array_contains_wrapper (BalaCCodeBaseModule* self, |
| 32695 | BalaArrayType* array_type) |
| 32696 | { |
| 32697 | gchar* array_contains_func = NULL((void*)0); |
| 32698 | BalaDataType* _tmp0_; |
| 32699 | BalaDataType* _tmp1_; |
| 32700 | gchar* _tmp2_; |
| 32701 | gchar* _tmp3_; |
| 32702 | gchar* _tmp4_; |
| 32703 | gchar* _tmp5_; |
| 32704 | const gchar* _tmp6_; |
| 32705 | BalaCCodeFunction* function = NULL((void*)0); |
| 32706 | const gchar* _tmp7_; |
| 32707 | BalaDataType* _tmp8_; |
| 32708 | gchar* _tmp9_; |
| 32709 | gchar* _tmp10_; |
| 32710 | BalaCCodeFunction* _tmp11_; |
| 32711 | BalaCCodeFunction* _tmp12_; |
| 32712 | BalaCCodeFunction* _tmp13_; |
| 32713 | BalaCCodeFunction* _tmp14_; |
| 32714 | BalaDataType* _tmp15_; |
| 32715 | BalaDataType* _tmp16_; |
| 32716 | gchar* _tmp17_; |
| 32717 | gchar* _tmp18_; |
| 32718 | gchar* _tmp19_; |
| 32719 | gchar* _tmp20_; |
| 32720 | BalaCCodeParameter* _tmp21_; |
| 32721 | BalaCCodeParameter* _tmp22_; |
| 32722 | BalaCCodeFunction* _tmp23_; |
| 32723 | BalaDataType* _tmp24_; |
| 32724 | gchar* _tmp25_; |
| 32725 | gchar* _tmp26_; |
| 32726 | BalaCCodeParameter* _tmp27_; |
| 32727 | BalaCCodeParameter* _tmp28_; |
| 32728 | BalaDataType* _tmp29_; |
| 32729 | BalaDataType* _tmp30_; |
| 32730 | BalaCCodeFunction* _tmp49_; |
| 32731 | BalaCCodeFunction* _tmp50_; |
| 32732 | BalaCCodeFunction* _tmp51_; |
| 32733 | BalaDataType* _tmp52_; |
| 32734 | gchar* _tmp53_; |
| 32735 | gchar* _tmp54_; |
| 32736 | BalaCCodeVariableDeclarator* _tmp55_; |
| 32737 | BalaCCodeVariableDeclarator* _tmp56_; |
| 32738 | BalaCCodeAssignment* cloop_initializer = NULL((void*)0); |
| 32739 | BalaCCodeIdentifier* _tmp57_; |
| 32740 | BalaCCodeIdentifier* _tmp58_; |
| 32741 | BalaCCodeConstant* _tmp59_; |
| 32742 | BalaCCodeConstant* _tmp60_; |
| 32743 | BalaCCodeAssignment* _tmp61_; |
| 32744 | BalaCCodeAssignment* _tmp62_; |
| 32745 | BalaCCodeBinaryExpression* cloop_condition = NULL((void*)0); |
| 32746 | BalaCCodeIdentifier* _tmp63_; |
| 32747 | BalaCCodeIdentifier* _tmp64_; |
| 32748 | BalaCCodeIdentifier* _tmp65_; |
| 32749 | BalaCCodeIdentifier* _tmp66_; |
| 32750 | BalaCCodeBinaryExpression* _tmp67_; |
| 32751 | BalaCCodeBinaryExpression* _tmp68_; |
| 32752 | BalaCCodeUnaryExpression* cloop_iterator = NULL((void*)0); |
| 32753 | BalaCCodeIdentifier* _tmp69_; |
| 32754 | BalaCCodeIdentifier* _tmp70_; |
| 32755 | BalaCCodeUnaryExpression* _tmp71_; |
| 32756 | BalaCCodeUnaryExpression* _tmp72_; |
| 32757 | BalaCCodeFunction* _tmp73_; |
| 32758 | BalaCCodeFunction* _tmp74_; |
| 32759 | BalaCCodeAssignment* _tmp75_; |
| 32760 | BalaCCodeBinaryExpression* _tmp76_; |
| 32761 | BalaCCodeUnaryExpression* _tmp77_; |
| 32762 | BalaCCodeElementAccess* celement = NULL((void*)0); |
| 32763 | BalaCCodeIdentifier* _tmp78_; |
| 32764 | BalaCCodeIdentifier* _tmp79_; |
| 32765 | BalaCCodeIdentifier* _tmp80_; |
| 32766 | BalaCCodeIdentifier* _tmp81_; |
| 32767 | BalaCCodeElementAccess* _tmp82_; |
| 32768 | BalaCCodeElementAccess* _tmp83_; |
| 32769 | BalaCCodeIdentifier* cneedle = NULL((void*)0); |
| 32770 | BalaCCodeIdentifier* _tmp84_; |
| 32771 | BalaCCodeBinaryExpression* cif_condition = NULL((void*)0); |
| 32772 | BalaDataType* _tmp85_; |
| 32773 | BalaDataType* _tmp86_; |
| 32774 | BalaDataType* _tmp87_; |
| 32775 | BalaCCodeFunction* _tmp135_; |
| 32776 | BalaCCodeFunction* _tmp136_; |
| 32777 | BalaCCodeBinaryExpression* _tmp137_; |
| 32778 | BalaCCodeFunction* _tmp138_; |
| 32779 | BalaCCodeFunction* _tmp139_; |
| 32780 | BalaCCodeExpression* _tmp140_; |
| 32781 | BalaCCodeExpression* _tmp141_; |
| 32782 | BalaCCodeFunction* _tmp142_; |
| 32783 | BalaCCodeFunction* _tmp143_; |
| 32784 | BalaCCodeFunction* _tmp144_; |
| 32785 | BalaCCodeFunction* _tmp145_; |
| 32786 | BalaCCodeFunction* _tmp146_; |
| 32787 | BalaCCodeFunction* _tmp147_; |
| 32788 | BalaCCodeExpression* _tmp148_; |
| 32789 | BalaCCodeExpression* _tmp149_; |
| 32790 | BalaCCodeFile* _tmp150_; |
| 32791 | BalaCCodeFunction* _tmp151_; |
| 32792 | BalaCCodeFile* _tmp152_; |
| 32793 | BalaCCodeFunction* _tmp153_; |
| 32794 | gchar* result = NULL((void*)0); |
| 32795 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 32796 | g_return_val_if_fail (array_type != NULL, NULL)do { if ((array_type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "array_type != NULL" ); return (((void*)0)); } } while (0); |
| 32797 | _tmp0_ = bala_array_type_get_element_type (array_type); |
| 32798 | _tmp1_ = _tmp0_; |
| 32799 | _tmp2_ = bala_get_ccode_lower_case_name ((BalaCodeNode*) _tmp1_, NULL((void*)0)); |
| 32800 | _tmp3_ = _tmp2_; |
| 32801 | _tmp4_ = g_strdup_printf ("_bala_%s_array_contains", _tmp3_); |
| 32802 | _tmp5_ = _tmp4_; |
| 32803 | _g_free0 (_tmp3_)(_tmp3_ = (g_free (_tmp3_), ((void*)0))); |
| 32804 | array_contains_func = _tmp5_; |
| 32805 | _tmp6_ = array_contains_func; |
| 32806 | if (!bala_ccode_base_module_add_wrapper (self, _tmp6_)) { |
| 32807 | result = array_contains_func; |
| 32808 | return result; |
| 32809 | } |
| 32810 | _tmp7_ = array_contains_func; |
| 32811 | _tmp8_ = self->bool_type; |
| 32812 | _tmp9_ = bala_get_ccode_name ((BalaCodeNode*) _tmp8_); |
| 32813 | _tmp10_ = _tmp9_; |
| 32814 | _tmp11_ = bala_ccode_function_new (_tmp7_, _tmp10_); |
| 32815 | _tmp12_ = _tmp11_; |
| 32816 | _g_free0 (_tmp10_)(_tmp10_ = (g_free (_tmp10_), ((void*)0))); |
| 32817 | function = _tmp12_; |
| 32818 | _tmp13_ = function; |
| 32819 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp13_, BALA_CCODE_MODIFIERS_STATIC); |
| 32820 | _tmp14_ = function; |
| 32821 | _tmp15_ = bala_array_type_get_element_type (array_type); |
| 32822 | _tmp16_ = _tmp15_; |
| 32823 | _tmp17_ = bala_get_ccode_name ((BalaCodeNode*) _tmp16_); |
| 32824 | _tmp18_ = _tmp17_; |
| 32825 | _tmp19_ = g_strdup_printf ("%s *", _tmp18_); |
| 32826 | _tmp20_ = _tmp19_; |
| 32827 | _tmp21_ = bala_ccode_parameter_new ("stack", _tmp20_); |
| 32828 | _tmp22_ = _tmp21_; |
| 32829 | bala_ccode_function_add_parameter (_tmp14_, _tmp22_); |
| 32830 | _bala_ccode_node_unref0 (_tmp22_)((_tmp22_ == ((void*)0)) ? ((void*)0) : (_tmp22_ = (bala_ccode_node_unref (_tmp22_), ((void*)0)))); |
| 32831 | _g_free0 (_tmp20_)(_tmp20_ = (g_free (_tmp20_), ((void*)0))); |
| 32832 | _g_free0 (_tmp18_)(_tmp18_ = (g_free (_tmp18_), ((void*)0))); |
| 32833 | _tmp23_ = function; |
| 32834 | _tmp24_ = self->int_type; |
| 32835 | _tmp25_ = bala_get_ccode_name ((BalaCodeNode*) _tmp24_); |
| 32836 | _tmp26_ = _tmp25_; |
| 32837 | _tmp27_ = bala_ccode_parameter_new ("stack_length", _tmp26_); |
| 32838 | _tmp28_ = _tmp27_; |
| 32839 | bala_ccode_function_add_parameter (_tmp23_, _tmp28_); |
| 32840 | _bala_ccode_node_unref0 (_tmp28_)((_tmp28_ == ((void*)0)) ? ((void*)0) : (_tmp28_ = (bala_ccode_node_unref (_tmp28_), ((void*)0)))); |
| 32841 | _g_free0 (_tmp26_)(_tmp26_ = (g_free (_tmp26_), ((void*)0))); |
| 32842 | _tmp29_ = bala_array_type_get_element_type (array_type); |
| 32843 | _tmp30_ = _tmp29_; |
| 32844 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp30_, BALA_TYPE_STRUCT_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp30_); GType __t = ((bala_struct_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 32845 | BalaCCodeFunction* _tmp31_; |
| 32846 | BalaDataType* _tmp32_; |
| 32847 | BalaDataType* _tmp33_; |
| 32848 | gchar* _tmp34_; |
| 32849 | gchar* _tmp35_; |
| 32850 | gchar* _tmp36_; |
| 32851 | gchar* _tmp37_; |
| 32852 | BalaCCodeParameter* _tmp38_; |
| 32853 | BalaCCodeParameter* _tmp39_; |
| 32854 | _tmp31_ = function; |
| 32855 | _tmp32_ = bala_array_type_get_element_type (array_type); |
| 32856 | _tmp33_ = _tmp32_; |
| 32857 | _tmp34_ = bala_get_ccode_name ((BalaCodeNode*) _tmp33_); |
| 32858 | _tmp35_ = _tmp34_; |
| 32859 | _tmp36_ = g_strdup_printf ("const %s *", _tmp35_); |
| 32860 | _tmp37_ = _tmp36_; |
| 32861 | _tmp38_ = bala_ccode_parameter_new ("needle", _tmp37_); |
| 32862 | _tmp39_ = _tmp38_; |
| 32863 | bala_ccode_function_add_parameter (_tmp31_, _tmp39_); |
| 32864 | _bala_ccode_node_unref0 (_tmp39_)((_tmp39_ == ((void*)0)) ? ((void*)0) : (_tmp39_ = (bala_ccode_node_unref (_tmp39_), ((void*)0)))); |
| 32865 | _g_free0 (_tmp37_)(_tmp37_ = (g_free (_tmp37_), ((void*)0))); |
| 32866 | _g_free0 (_tmp35_)(_tmp35_ = (g_free (_tmp35_), ((void*)0))); |
| 32867 | } else { |
| 32868 | BalaCCodeFunction* _tmp40_; |
| 32869 | BalaDataType* _tmp41_; |
| 32870 | BalaDataType* _tmp42_; |
| 32871 | gchar* _tmp43_; |
| 32872 | gchar* _tmp44_; |
| 32873 | gchar* _tmp45_; |
| 32874 | gchar* _tmp46_; |
| 32875 | BalaCCodeParameter* _tmp47_; |
| 32876 | BalaCCodeParameter* _tmp48_; |
| 32877 | _tmp40_ = function; |
| 32878 | _tmp41_ = bala_array_type_get_element_type (array_type); |
| 32879 | _tmp42_ = _tmp41_; |
| 32880 | _tmp43_ = bala_get_ccode_name ((BalaCodeNode*) _tmp42_); |
| 32881 | _tmp44_ = _tmp43_; |
| 32882 | _tmp45_ = g_strdup_printf ("const %s", _tmp44_); |
| 32883 | _tmp46_ = _tmp45_; |
| 32884 | _tmp47_ = bala_ccode_parameter_new ("needle", _tmp46_); |
| 32885 | _tmp48_ = _tmp47_; |
| 32886 | bala_ccode_function_add_parameter (_tmp40_, _tmp48_); |
| 32887 | _bala_ccode_node_unref0 (_tmp48_)((_tmp48_ == ((void*)0)) ? ((void*)0) : (_tmp48_ = (bala_ccode_node_unref (_tmp48_), ((void*)0)))); |
| 32888 | _g_free0 (_tmp46_)(_tmp46_ = (g_free (_tmp46_), ((void*)0))); |
| 32889 | _g_free0 (_tmp44_)(_tmp44_ = (g_free (_tmp44_), ((void*)0))); |
| 32890 | } |
| 32891 | _tmp49_ = function; |
| 32892 | bala_ccode_base_module_push_function (self, _tmp49_); |
| 32893 | _tmp50_ = bala_ccode_base_module_get_ccode (self); |
| 32894 | _tmp51_ = _tmp50_; |
| 32895 | _tmp52_ = self->int_type; |
| 32896 | _tmp53_ = bala_get_ccode_name ((BalaCodeNode*) _tmp52_); |
| 32897 | _tmp54_ = _tmp53_; |
| 32898 | _tmp55_ = bala_ccode_variable_declarator_new ("i", NULL((void*)0), NULL((void*)0)); |
| 32899 | _tmp56_ = _tmp55_; |
| 32900 | bala_ccode_function_add_declaration (_tmp51_, _tmp54_, (BalaCCodeDeclarator*) _tmp56_, 0); |
| 32901 | _bala_ccode_node_unref0 (_tmp56_)((_tmp56_ == ((void*)0)) ? ((void*)0) : (_tmp56_ = (bala_ccode_node_unref (_tmp56_), ((void*)0)))); |
| 32902 | _g_free0 (_tmp54_)(_tmp54_ = (g_free (_tmp54_), ((void*)0))); |
| 32903 | _tmp57_ = bala_ccode_identifier_new ("i"); |
| 32904 | _tmp58_ = _tmp57_; |
| 32905 | _tmp59_ = bala_ccode_constant_new ("0"); |
| 32906 | _tmp60_ = _tmp59_; |
| 32907 | _tmp61_ = bala_ccode_assignment_new ((BalaCCodeExpression*) _tmp58_, (BalaCCodeExpression*) _tmp60_, BALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE); |
| 32908 | _tmp62_ = _tmp61_; |
| 32909 | _bala_ccode_node_unref0 (_tmp60_)((_tmp60_ == ((void*)0)) ? ((void*)0) : (_tmp60_ = (bala_ccode_node_unref (_tmp60_), ((void*)0)))); |
| 32910 | _bala_ccode_node_unref0 (_tmp58_)((_tmp58_ == ((void*)0)) ? ((void*)0) : (_tmp58_ = (bala_ccode_node_unref (_tmp58_), ((void*)0)))); |
| 32911 | cloop_initializer = _tmp62_; |
| 32912 | _tmp63_ = bala_ccode_identifier_new ("i"); |
| 32913 | _tmp64_ = _tmp63_; |
| 32914 | _tmp65_ = bala_ccode_identifier_new ("stack_length"); |
| 32915 | _tmp66_ = _tmp65_; |
| 32916 | _tmp67_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_LESS_THAN, (BalaCCodeExpression*) _tmp64_, (BalaCCodeExpression*) _tmp66_); |
| 32917 | _tmp68_ = _tmp67_; |
| 32918 | _bala_ccode_node_unref0 (_tmp66_)((_tmp66_ == ((void*)0)) ? ((void*)0) : (_tmp66_ = (bala_ccode_node_unref (_tmp66_), ((void*)0)))); |
| 32919 | _bala_ccode_node_unref0 (_tmp64_)((_tmp64_ == ((void*)0)) ? ((void*)0) : (_tmp64_ = (bala_ccode_node_unref (_tmp64_), ((void*)0)))); |
| 32920 | cloop_condition = _tmp68_; |
| 32921 | _tmp69_ = bala_ccode_identifier_new ("i"); |
| 32922 | _tmp70_ = _tmp69_; |
| 32923 | _tmp71_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POSTFIX_INCREMENT, (BalaCCodeExpression*) _tmp70_); |
| 32924 | _tmp72_ = _tmp71_; |
| 32925 | _bala_ccode_node_unref0 (_tmp70_)((_tmp70_ == ((void*)0)) ? ((void*)0) : (_tmp70_ = (bala_ccode_node_unref (_tmp70_), ((void*)0)))); |
| 32926 | cloop_iterator = _tmp72_; |
| 32927 | _tmp73_ = bala_ccode_base_module_get_ccode (self); |
| 32928 | _tmp74_ = _tmp73_; |
| 32929 | _tmp75_ = cloop_initializer; |
| 32930 | _tmp76_ = cloop_condition; |
| 32931 | _tmp77_ = cloop_iterator; |
| 32932 | bala_ccode_function_open_for (_tmp74_, (BalaCCodeExpression*) _tmp75_, (BalaCCodeExpression*) _tmp76_, (BalaCCodeExpression*) _tmp77_); |
| 32933 | _tmp78_ = bala_ccode_identifier_new ("stack"); |
| 32934 | _tmp79_ = _tmp78_; |
| 32935 | _tmp80_ = bala_ccode_identifier_new ("i"); |
| 32936 | _tmp81_ = _tmp80_; |
| 32937 | _tmp82_ = bala_ccode_element_access_new ((BalaCCodeExpression*) _tmp79_, (BalaCCodeExpression*) _tmp81_); |
| 32938 | _tmp83_ = _tmp82_; |
| 32939 | _bala_ccode_node_unref0 (_tmp81_)((_tmp81_ == ((void*)0)) ? ((void*)0) : (_tmp81_ = (bala_ccode_node_unref (_tmp81_), ((void*)0)))); |
| 32940 | _bala_ccode_node_unref0 (_tmp79_)((_tmp79_ == ((void*)0)) ? ((void*)0) : (_tmp79_ = (bala_ccode_node_unref (_tmp79_), ((void*)0)))); |
| 32941 | celement = _tmp83_; |
| 32942 | _tmp84_ = bala_ccode_identifier_new ("needle"); |
| 32943 | cneedle = _tmp84_; |
| 32944 | _tmp85_ = bala_array_type_get_element_type (array_type); |
| 32945 | _tmp86_ = _tmp85_; |
| 32946 | _tmp87_ = self->string_type; |
| 32947 | if (bala_data_type_compatible (_tmp86_, _tmp87_)) { |
| 32948 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 32949 | BalaCodeContext* _tmp88_; |
| 32950 | BalaProfile _tmp89_; |
| 32951 | BalaProfile _tmp90_; |
| 32952 | BalaCCodeFunctionCall* _tmp102_; |
| 32953 | BalaCCodeElementAccess* _tmp103_; |
| 32954 | BalaCCodeFunctionCall* _tmp104_; |
| 32955 | BalaCCodeIdentifier* _tmp105_; |
| 32956 | BalaCCodeFunctionCall* _tmp106_; |
| 32957 | BalaCCodeConstant* _tmp107_; |
| 32958 | BalaCCodeConstant* _tmp108_; |
| 32959 | BalaCCodeBinaryExpression* _tmp109_; |
| 32960 | _tmp88_ = self->priv->_context; |
| 32961 | _tmp89_ = bala_code_context_get_profile (_tmp88_); |
| 32962 | _tmp90_ = _tmp89_; |
| 32963 | if (_tmp90_ == BALA_PROFILE_POSIX) { |
| 32964 | BalaCCodeFile* _tmp91_; |
| 32965 | BalaCCodeIdentifier* _tmp92_; |
| 32966 | BalaCCodeIdentifier* _tmp93_; |
| 32967 | gchar* _tmp94_; |
| 32968 | gchar* _tmp95_; |
| 32969 | BalaCCodeIdentifier* _tmp96_; |
| 32970 | BalaCCodeIdentifier* _tmp97_; |
| 32971 | BalaCCodeFunctionCall* _tmp98_; |
| 32972 | _tmp91_ = self->cfile; |
| 32973 | bala_ccode_file_add_include (_tmp91_, "string.h", FALSE(0)); |
| 32974 | _tmp92_ = bala_ccode_identifier_new ("strcmp"); |
| 32975 | _tmp93_ = _tmp92_; |
| 32976 | _tmp94_ = bala_ccode_base_module_generate_cmp_wrapper (self, _tmp93_); |
| 32977 | _tmp95_ = _tmp94_; |
| 32978 | _tmp96_ = bala_ccode_identifier_new (_tmp95_); |
| 32979 | _tmp97_ = _tmp96_; |
| 32980 | _tmp98_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp97_); |
| 32981 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 32982 | ccall = _tmp98_; |
| 32983 | _bala_ccode_node_unref0 (_tmp97_)((_tmp97_ == ((void*)0)) ? ((void*)0) : (_tmp97_ = (bala_ccode_node_unref (_tmp97_), ((void*)0)))); |
| 32984 | _g_free0 (_tmp95_)(_tmp95_ = (g_free (_tmp95_), ((void*)0))); |
| 32985 | _bala_ccode_node_unref0 (_tmp93_)((_tmp93_ == ((void*)0)) ? ((void*)0) : (_tmp93_ = (bala_ccode_node_unref (_tmp93_), ((void*)0)))); |
| 32986 | } else { |
| 32987 | BalaCCodeIdentifier* _tmp99_; |
| 32988 | BalaCCodeIdentifier* _tmp100_; |
| 32989 | BalaCCodeFunctionCall* _tmp101_; |
| 32990 | _tmp99_ = bala_ccode_identifier_new ("g_strcmp0"); |
| 32991 | _tmp100_ = _tmp99_; |
| 32992 | _tmp101_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp100_); |
| 32993 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 32994 | ccall = _tmp101_; |
| 32995 | _bala_ccode_node_unref0 (_tmp100_)((_tmp100_ == ((void*)0)) ? ((void*)0) : (_tmp100_ = (bala_ccode_node_unref (_tmp100_), ((void*)0)))); |
| 32996 | } |
| 32997 | _tmp102_ = ccall; |
| 32998 | _tmp103_ = celement; |
| 32999 | bala_ccode_function_call_add_argument (_tmp102_, (BalaCCodeExpression*) _tmp103_); |
| 33000 | _tmp104_ = ccall; |
| 33001 | _tmp105_ = cneedle; |
| 33002 | bala_ccode_function_call_add_argument (_tmp104_, (BalaCCodeExpression*) _tmp105_); |
| 33003 | _tmp106_ = ccall; |
| 33004 | _tmp107_ = bala_ccode_constant_new ("0"); |
| 33005 | _tmp108_ = _tmp107_; |
| 33006 | _tmp109_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp106_, (BalaCCodeExpression*) _tmp108_); |
| 33007 | _bala_ccode_node_unref0 (cif_condition)((cif_condition == ((void*)0)) ? ((void*)0) : (cif_condition = (bala_ccode_node_unref (cif_condition), ((void*)0)))); |
| 33008 | cif_condition = _tmp109_; |
| 33009 | _bala_ccode_node_unref0 (_tmp108_)((_tmp108_ == ((void*)0)) ? ((void*)0) : (_tmp108_ = (bala_ccode_node_unref (_tmp108_), ((void*)0)))); |
| 33010 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 33011 | } else { |
| 33012 | BalaDataType* _tmp110_; |
| 33013 | BalaDataType* _tmp111_; |
| 33014 | _tmp110_ = bala_array_type_get_element_type (array_type); |
| 33015 | _tmp111_ = _tmp110_; |
| 33016 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp111_, BALA_TYPE_STRUCT_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp111_); GType __t = ((bala_struct_value_type_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 33017 | gchar* equalfunc = NULL((void*)0); |
| 33018 | BalaDataType* _tmp112_; |
| 33019 | BalaDataType* _tmp113_; |
| 33020 | BalaTypeSymbol* _tmp114_; |
| 33021 | BalaTypeSymbol* _tmp115_; |
| 33022 | gchar* _tmp116_; |
| 33023 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 33024 | const gchar* _tmp117_; |
| 33025 | BalaCCodeIdentifier* _tmp118_; |
| 33026 | BalaCCodeIdentifier* _tmp119_; |
| 33027 | BalaCCodeFunctionCall* _tmp120_; |
| 33028 | BalaCCodeFunctionCall* _tmp121_; |
| 33029 | BalaCCodeFunctionCall* _tmp122_; |
| 33030 | BalaCCodeElementAccess* _tmp123_; |
| 33031 | BalaCCodeUnaryExpression* _tmp124_; |
| 33032 | BalaCCodeUnaryExpression* _tmp125_; |
| 33033 | BalaCCodeFunctionCall* _tmp126_; |
| 33034 | BalaCCodeIdentifier* _tmp127_; |
| 33035 | BalaCCodeFunctionCall* _tmp128_; |
| 33036 | BalaCCodeExpression* _tmp129_; |
| 33037 | BalaCCodeExpression* _tmp130_; |
| 33038 | BalaCCodeBinaryExpression* _tmp131_; |
| 33039 | _tmp112_ = bala_array_type_get_element_type (array_type); |
| 33040 | _tmp113_ = _tmp112_; |
| 33041 | _tmp114_ = bala_data_type_get_type_symbol (_tmp113_); |
| 33042 | _tmp115_ = _tmp114_; |
| 33043 | _tmp116_ = bala_ccode_base_module_generate_struct_equal_function (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp115_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp115_), ((bala_struct_get_type ())))))); |
| 33044 | equalfunc = _tmp116_; |
| 33045 | _tmp117_ = equalfunc; |
| 33046 | _tmp118_ = bala_ccode_identifier_new (_tmp117_); |
| 33047 | _tmp119_ = _tmp118_; |
| 33048 | _tmp120_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp119_); |
| 33049 | _tmp121_ = _tmp120_; |
| 33050 | _bala_ccode_node_unref0 (_tmp119_)((_tmp119_ == ((void*)0)) ? ((void*)0) : (_tmp119_ = (bala_ccode_node_unref (_tmp119_), ((void*)0)))); |
| 33051 | ccall = _tmp121_; |
| 33052 | _tmp122_ = ccall; |
| 33053 | _tmp123_ = celement; |
| 33054 | _tmp124_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, (BalaCCodeExpression*) _tmp123_); |
| 33055 | _tmp125_ = _tmp124_; |
| 33056 | bala_ccode_function_call_add_argument (_tmp122_, (BalaCCodeExpression*) _tmp125_); |
| 33057 | _bala_ccode_node_unref0 (_tmp125_)((_tmp125_ == ((void*)0)) ? ((void*)0) : (_tmp125_ = (bala_ccode_node_unref (_tmp125_), ((void*)0)))); |
| 33058 | _tmp126_ = ccall; |
| 33059 | _tmp127_ = cneedle; |
| 33060 | bala_ccode_function_call_add_argument (_tmp126_, (BalaCCodeExpression*) _tmp127_); |
| 33061 | _tmp128_ = ccall; |
| 33062 | _tmp129_ = bala_ccode_base_module_get_boolean_cconstant (self, TRUE(!(0))); |
| 33063 | _tmp130_ = _tmp129_; |
| 33064 | _tmp131_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp128_, _tmp130_); |
| 33065 | _bala_ccode_node_unref0 (cif_condition)((cif_condition == ((void*)0)) ? ((void*)0) : (cif_condition = (bala_ccode_node_unref (cif_condition), ((void*)0)))); |
| 33066 | cif_condition = _tmp131_; |
| 33067 | _bala_ccode_node_unref0 (_tmp130_)((_tmp130_ == ((void*)0)) ? ((void*)0) : (_tmp130_ = (bala_ccode_node_unref (_tmp130_), ((void*)0)))); |
| 33068 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 33069 | _g_free0 (equalfunc)(equalfunc = (g_free (equalfunc), ((void*)0))); |
| 33070 | } else { |
| 33071 | BalaCCodeIdentifier* _tmp132_; |
| 33072 | BalaCCodeElementAccess* _tmp133_; |
| 33073 | BalaCCodeBinaryExpression* _tmp134_; |
| 33074 | _tmp132_ = cneedle; |
| 33075 | _tmp133_ = celement; |
| 33076 | _tmp134_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_EQUALITY, (BalaCCodeExpression*) _tmp132_, (BalaCCodeExpression*) _tmp133_); |
| 33077 | _bala_ccode_node_unref0 (cif_condition)((cif_condition == ((void*)0)) ? ((void*)0) : (cif_condition = (bala_ccode_node_unref (cif_condition), ((void*)0)))); |
| 33078 | cif_condition = _tmp134_; |
| 33079 | } |
| 33080 | } |
| 33081 | _tmp135_ = bala_ccode_base_module_get_ccode (self); |
| 33082 | _tmp136_ = _tmp135_; |
| 33083 | _tmp137_ = cif_condition; |
| 33084 | bala_ccode_function_open_if (_tmp136_, (BalaCCodeExpression*) _tmp137_); |
| 33085 | _tmp138_ = bala_ccode_base_module_get_ccode (self); |
| 33086 | _tmp139_ = _tmp138_; |
| 33087 | _tmp140_ = bala_ccode_base_module_get_boolean_cconstant (self, TRUE(!(0))); |
| 33088 | _tmp141_ = _tmp140_; |
| 33089 | bala_ccode_function_add_return (_tmp139_, _tmp141_); |
| 33090 | _bala_ccode_node_unref0 (_tmp141_)((_tmp141_ == ((void*)0)) ? ((void*)0) : (_tmp141_ = (bala_ccode_node_unref (_tmp141_), ((void*)0)))); |
| 33091 | _tmp142_ = bala_ccode_base_module_get_ccode (self); |
| 33092 | _tmp143_ = _tmp142_; |
| 33093 | bala_ccode_function_close (_tmp143_); |
| 33094 | _tmp144_ = bala_ccode_base_module_get_ccode (self); |
| 33095 | _tmp145_ = _tmp144_; |
| 33096 | bala_ccode_function_close (_tmp145_); |
| 33097 | _tmp146_ = bala_ccode_base_module_get_ccode (self); |
| 33098 | _tmp147_ = _tmp146_; |
| 33099 | _tmp148_ = bala_ccode_base_module_get_boolean_cconstant (self, FALSE(0)); |
| 33100 | _tmp149_ = _tmp148_; |
| 33101 | bala_ccode_function_add_return (_tmp147_, _tmp149_); |
| 33102 | _bala_ccode_node_unref0 (_tmp149_)((_tmp149_ == ((void*)0)) ? ((void*)0) : (_tmp149_ = (bala_ccode_node_unref (_tmp149_), ((void*)0)))); |
| 33103 | bala_ccode_base_module_pop_function (self); |
| 33104 | _tmp150_ = self->cfile; |
| 33105 | _tmp151_ = function; |
| 33106 | bala_ccode_file_add_function_declaration (_tmp150_, _tmp151_); |
| 33107 | _tmp152_ = self->cfile; |
| 33108 | _tmp153_ = function; |
| 33109 | bala_ccode_file_add_function (_tmp152_, _tmp153_); |
| 33110 | result = array_contains_func; |
| 33111 | _bala_ccode_node_unref0 (cif_condition)((cif_condition == ((void*)0)) ? ((void*)0) : (cif_condition = (bala_ccode_node_unref (cif_condition), ((void*)0)))); |
| 33112 | _bala_ccode_node_unref0 (cneedle)((cneedle == ((void*)0)) ? ((void*)0) : (cneedle = (bala_ccode_node_unref (cneedle), ((void*)0)))); |
| 33113 | _bala_ccode_node_unref0 (celement)((celement == ((void*)0)) ? ((void*)0) : (celement = (bala_ccode_node_unref (celement), ((void*)0)))); |
| 33114 | _bala_ccode_node_unref0 (cloop_iterator)((cloop_iterator == ((void*)0)) ? ((void*)0) : (cloop_iterator = (bala_ccode_node_unref (cloop_iterator), ((void*)0)))); |
| 33115 | _bala_ccode_node_unref0 (cloop_condition)((cloop_condition == ((void*)0)) ? ((void*)0) : (cloop_condition = (bala_ccode_node_unref (cloop_condition), ((void*)0)))); |
| 33116 | _bala_ccode_node_unref0 (cloop_initializer)((cloop_initializer == ((void*)0)) ? ((void*)0) : (cloop_initializer = (bala_ccode_node_unref (cloop_initializer), ((void*)0)))); |
| 33117 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 33118 | return result; |
| 33119 | } |
| 33120 | |
| 33121 | static gchar* |
| 33122 | bala_ccode_base_module_generate_cmp_wrapper (BalaCCodeBaseModule* self, |
| 33123 | BalaCCodeIdentifier* cmpid) |
| 33124 | { |
| 33125 | gchar* cmp0_func = NULL((void*)0); |
| 33126 | const gchar* _tmp0_; |
| 33127 | const gchar* _tmp1_; |
| 33128 | gchar* _tmp2_; |
| 33129 | const gchar* _tmp3_; |
| 33130 | const gchar* _tmp4_; |
| 33131 | gchar* result = NULL((void*)0); |
| 33132 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 33133 | g_return_val_if_fail (cmpid != NULL, NULL)do { if ((cmpid != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "cmpid != NULL" ); return (((void*)0)); } } while (0); |
| 33134 | _tmp0_ = bala_ccode_identifier_get_name (cmpid); |
| 33135 | _tmp1_ = _tmp0_; |
| 33136 | _tmp2_ = g_strdup_printf ("_%s0", _tmp1_); |
| 33137 | cmp0_func = _tmp2_; |
| 33138 | _tmp3_ = bala_ccode_identifier_get_name (cmpid); |
| 33139 | _tmp4_ = _tmp3_; |
| 33140 | if (g_strcmp0 (_tmp4_, "g_strcmp0") == 0) { |
| 33141 | const gchar* _tmp5_; |
| 33142 | const gchar* _tmp6_; |
| 33143 | gchar* _tmp7_; |
| 33144 | _tmp5_ = bala_ccode_identifier_get_name (cmpid); |
| 33145 | _tmp6_ = _tmp5_; |
| 33146 | _tmp7_ = g_strdup (_tmp6_); |
| 33147 | _g_free0 (cmp0_func)(cmp0_func = (g_free (cmp0_func), ((void*)0))); |
| 33148 | cmp0_func = _tmp7_; |
| 33149 | } else { |
| 33150 | const gchar* _tmp8_; |
| 33151 | _tmp8_ = cmp0_func; |
| 33152 | if (bala_ccode_base_module_add_wrapper (self, _tmp8_)) { |
| 33153 | BalaCCodeFunction* cmp0_fun = NULL((void*)0); |
| 33154 | const gchar* _tmp9_; |
| 33155 | BalaDataType* _tmp10_; |
| 33156 | gchar* _tmp11_; |
| 33157 | gchar* _tmp12_; |
| 33158 | BalaCCodeFunction* _tmp13_; |
| 33159 | BalaCCodeFunction* _tmp14_; |
| 33160 | BalaCCodeFunction* _tmp15_; |
| 33161 | BalaCCodeParameter* _tmp16_; |
| 33162 | BalaCCodeParameter* _tmp17_; |
| 33163 | BalaCCodeFunction* _tmp18_; |
| 33164 | BalaCCodeParameter* _tmp19_; |
| 33165 | BalaCCodeParameter* _tmp20_; |
| 33166 | BalaCCodeFunction* _tmp21_; |
| 33167 | BalaCCodeFunction* _tmp22_; |
| 33168 | BalaCCodeBinaryExpression* noteq = NULL((void*)0); |
| 33169 | BalaCCodeIdentifier* _tmp23_; |
| 33170 | BalaCCodeIdentifier* _tmp24_; |
| 33171 | BalaCCodeIdentifier* _tmp25_; |
| 33172 | BalaCCodeIdentifier* _tmp26_; |
| 33173 | BalaCCodeBinaryExpression* _tmp27_; |
| 33174 | BalaCCodeBinaryExpression* _tmp28_; |
| 33175 | BalaCCodeFunctionCall* cmp_call = NULL((void*)0); |
| 33176 | BalaCCodeFunctionCall* _tmp55_; |
| 33177 | BalaCCodeFunctionCall* _tmp56_; |
| 33178 | BalaCCodeIdentifier* _tmp57_; |
| 33179 | BalaCCodeIdentifier* _tmp58_; |
| 33180 | BalaCCodeFunctionCall* _tmp59_; |
| 33181 | BalaCCodeIdentifier* _tmp60_; |
| 33182 | BalaCCodeIdentifier* _tmp61_; |
| 33183 | BalaCCodeFunction* _tmp62_; |
| 33184 | BalaCCodeFunction* _tmp63_; |
| 33185 | BalaCCodeFunctionCall* _tmp64_; |
| 33186 | BalaCCodeFile* _tmp65_; |
| 33187 | BalaCCodeFunction* _tmp66_; |
| 33188 | _tmp9_ = cmp0_func; |
| 33189 | _tmp10_ = self->int_type; |
| 33190 | _tmp11_ = bala_get_ccode_name ((BalaCodeNode*) _tmp10_); |
| 33191 | _tmp12_ = _tmp11_; |
| 33192 | _tmp13_ = bala_ccode_function_new (_tmp9_, _tmp12_); |
| 33193 | _tmp14_ = _tmp13_; |
| 33194 | _g_free0 (_tmp12_)(_tmp12_ = (g_free (_tmp12_), ((void*)0))); |
| 33195 | cmp0_fun = _tmp14_; |
| 33196 | _tmp15_ = cmp0_fun; |
| 33197 | _tmp16_ = bala_ccode_parameter_new ("s1", "const void *"); |
| 33198 | _tmp17_ = _tmp16_; |
| 33199 | bala_ccode_function_add_parameter (_tmp15_, _tmp17_); |
| 33200 | _bala_ccode_node_unref0 (_tmp17_)((_tmp17_ == ((void*)0)) ? ((void*)0) : (_tmp17_ = (bala_ccode_node_unref (_tmp17_), ((void*)0)))); |
| 33201 | _tmp18_ = cmp0_fun; |
| 33202 | _tmp19_ = bala_ccode_parameter_new ("s2", "const void *"); |
| 33203 | _tmp20_ = _tmp19_; |
| 33204 | bala_ccode_function_add_parameter (_tmp18_, _tmp20_); |
| 33205 | _bala_ccode_node_unref0 (_tmp20_)((_tmp20_ == ((void*)0)) ? ((void*)0) : (_tmp20_ = (bala_ccode_node_unref (_tmp20_), ((void*)0)))); |
| 33206 | _tmp21_ = cmp0_fun; |
| 33207 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp21_, BALA_CCODE_MODIFIERS_STATIC); |
| 33208 | _tmp22_ = cmp0_fun; |
| 33209 | bala_ccode_base_module_push_function (self, _tmp22_); |
| 33210 | _tmp23_ = bala_ccode_identifier_new ("s1"); |
| 33211 | _tmp24_ = _tmp23_; |
| 33212 | _tmp25_ = bala_ccode_identifier_new ("s2"); |
| 33213 | _tmp26_ = _tmp25_; |
| 33214 | _tmp27_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_INEQUALITY, (BalaCCodeExpression*) _tmp24_, (BalaCCodeExpression*) _tmp26_); |
| 33215 | _tmp28_ = _tmp27_; |
| 33216 | _bala_ccode_node_unref0 (_tmp26_)((_tmp26_ == ((void*)0)) ? ((void*)0) : (_tmp26_ = (bala_ccode_node_unref (_tmp26_), ((void*)0)))); |
| 33217 | _bala_ccode_node_unref0 (_tmp24_)((_tmp24_ == ((void*)0)) ? ((void*)0) : (_tmp24_ = (bala_ccode_node_unref (_tmp24_), ((void*)0)))); |
| 33218 | noteq = _tmp28_; |
| 33219 | { |
| 33220 | BalaCCodeUnaryExpression* cexp = NULL((void*)0); |
| 33221 | BalaCCodeIdentifier* _tmp29_; |
| 33222 | BalaCCodeIdentifier* _tmp30_; |
| 33223 | BalaCCodeUnaryExpression* _tmp31_; |
| 33224 | BalaCCodeUnaryExpression* _tmp32_; |
| 33225 | BalaCCodeFunction* _tmp33_; |
| 33226 | BalaCCodeFunction* _tmp34_; |
| 33227 | BalaCCodeUnaryExpression* _tmp35_; |
| 33228 | BalaCCodeFunction* _tmp36_; |
| 33229 | BalaCCodeFunction* _tmp37_; |
| 33230 | BalaCCodeBinaryExpression* _tmp38_; |
| 33231 | BalaCCodeUnaryExpression* _tmp39_; |
| 33232 | BalaCCodeUnaryExpression* _tmp40_; |
| 33233 | BalaCCodeFunction* _tmp41_; |
| 33234 | BalaCCodeFunction* _tmp42_; |
| 33235 | _tmp29_ = bala_ccode_identifier_new ("s1"); |
| 33236 | _tmp30_ = _tmp29_; |
| 33237 | _tmp31_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_LOGICAL_NEGATION, (BalaCCodeExpression*) _tmp30_); |
| 33238 | _tmp32_ = _tmp31_; |
| 33239 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 33240 | cexp = _tmp32_; |
| 33241 | _tmp33_ = bala_ccode_base_module_get_ccode (self); |
| 33242 | _tmp34_ = _tmp33_; |
| 33243 | _tmp35_ = cexp; |
| 33244 | bala_ccode_function_open_if (_tmp34_, (BalaCCodeExpression*) _tmp35_); |
| 33245 | _tmp36_ = bala_ccode_base_module_get_ccode (self); |
| 33246 | _tmp37_ = _tmp36_; |
| 33247 | _tmp38_ = noteq; |
| 33248 | _tmp39_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_MINUS, (BalaCCodeExpression*) _tmp38_); |
| 33249 | _tmp40_ = _tmp39_; |
| 33250 | bala_ccode_function_add_return (_tmp37_, (BalaCCodeExpression*) _tmp40_); |
| 33251 | _bala_ccode_node_unref0 (_tmp40_)((_tmp40_ == ((void*)0)) ? ((void*)0) : (_tmp40_ = (bala_ccode_node_unref (_tmp40_), ((void*)0)))); |
| 33252 | _tmp41_ = bala_ccode_base_module_get_ccode (self); |
| 33253 | _tmp42_ = _tmp41_; |
| 33254 | bala_ccode_function_close (_tmp42_); |
| 33255 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 33256 | } |
| 33257 | { |
| 33258 | BalaCCodeUnaryExpression* cexp = NULL((void*)0); |
| 33259 | BalaCCodeIdentifier* _tmp43_; |
| 33260 | BalaCCodeIdentifier* _tmp44_; |
| 33261 | BalaCCodeUnaryExpression* _tmp45_; |
| 33262 | BalaCCodeUnaryExpression* _tmp46_; |
| 33263 | BalaCCodeFunction* _tmp47_; |
| 33264 | BalaCCodeFunction* _tmp48_; |
| 33265 | BalaCCodeUnaryExpression* _tmp49_; |
| 33266 | BalaCCodeFunction* _tmp50_; |
| 33267 | BalaCCodeFunction* _tmp51_; |
| 33268 | BalaCCodeBinaryExpression* _tmp52_; |
| 33269 | BalaCCodeFunction* _tmp53_; |
| 33270 | BalaCCodeFunction* _tmp54_; |
| 33271 | _tmp43_ = bala_ccode_identifier_new ("s2"); |
| 33272 | _tmp44_ = _tmp43_; |
| 33273 | _tmp45_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_LOGICAL_NEGATION, (BalaCCodeExpression*) _tmp44_); |
| 33274 | _tmp46_ = _tmp45_; |
| 33275 | _bala_ccode_node_unref0 (_tmp44_)((_tmp44_ == ((void*)0)) ? ((void*)0) : (_tmp44_ = (bala_ccode_node_unref (_tmp44_), ((void*)0)))); |
| 33276 | cexp = _tmp46_; |
| 33277 | _tmp47_ = bala_ccode_base_module_get_ccode (self); |
| 33278 | _tmp48_ = _tmp47_; |
| 33279 | _tmp49_ = cexp; |
| 33280 | bala_ccode_function_open_if (_tmp48_, (BalaCCodeExpression*) _tmp49_); |
| 33281 | _tmp50_ = bala_ccode_base_module_get_ccode (self); |
| 33282 | _tmp51_ = _tmp50_; |
| 33283 | _tmp52_ = noteq; |
| 33284 | bala_ccode_function_add_return (_tmp51_, (BalaCCodeExpression*) _tmp52_); |
| 33285 | _tmp53_ = bala_ccode_base_module_get_ccode (self); |
| 33286 | _tmp54_ = _tmp53_; |
| 33287 | bala_ccode_function_close (_tmp54_); |
| 33288 | _bala_ccode_node_unref0 (cexp)((cexp == ((void*)0)) ? ((void*)0) : (cexp = (bala_ccode_node_unref (cexp), ((void*)0)))); |
| 33289 | } |
| 33290 | _tmp55_ = bala_ccode_function_call_new ((BalaCCodeExpression*) cmpid); |
| 33291 | cmp_call = _tmp55_; |
| 33292 | _tmp56_ = cmp_call; |
| 33293 | _tmp57_ = bala_ccode_identifier_new ("s1"); |
| 33294 | _tmp58_ = _tmp57_; |
| 33295 | bala_ccode_function_call_add_argument (_tmp56_, (BalaCCodeExpression*) _tmp58_); |
| 33296 | _bala_ccode_node_unref0 (_tmp58_)((_tmp58_ == ((void*)0)) ? ((void*)0) : (_tmp58_ = (bala_ccode_node_unref (_tmp58_), ((void*)0)))); |
| 33297 | _tmp59_ = cmp_call; |
| 33298 | _tmp60_ = bala_ccode_identifier_new ("s2"); |
| 33299 | _tmp61_ = _tmp60_; |
| 33300 | bala_ccode_function_call_add_argument (_tmp59_, (BalaCCodeExpression*) _tmp61_); |
| 33301 | _bala_ccode_node_unref0 (_tmp61_)((_tmp61_ == ((void*)0)) ? ((void*)0) : (_tmp61_ = (bala_ccode_node_unref (_tmp61_), ((void*)0)))); |
| 33302 | _tmp62_ = bala_ccode_base_module_get_ccode (self); |
| 33303 | _tmp63_ = _tmp62_; |
| 33304 | _tmp64_ = cmp_call; |
| 33305 | bala_ccode_function_add_return (_tmp63_, (BalaCCodeExpression*) _tmp64_); |
| 33306 | bala_ccode_base_module_pop_function (self); |
| 33307 | _tmp65_ = self->cfile; |
| 33308 | _tmp66_ = cmp0_fun; |
| 33309 | bala_ccode_file_add_function (_tmp65_, _tmp66_); |
| 33310 | _bala_ccode_node_unref0 (cmp_call)((cmp_call == ((void*)0)) ? ((void*)0) : (cmp_call = (bala_ccode_node_unref (cmp_call), ((void*)0)))); |
| 33311 | _bala_ccode_node_unref0 (noteq)((noteq == ((void*)0)) ? ((void*)0) : (noteq = (bala_ccode_node_unref (noteq), ((void*)0)))); |
| 33312 | _bala_ccode_node_unref0 (cmp0_fun)((cmp0_fun == ((void*)0)) ? ((void*)0) : (cmp0_fun = (bala_ccode_node_unref (cmp0_fun), ((void*)0)))); |
| 33313 | } |
| 33314 | } |
| 33315 | result = cmp0_func; |
| 33316 | return result; |
| 33317 | } |
| 33318 | |
| 33319 | static void |
| 33320 | bala_ccode_base_module_real_visit_type_check (BalaCodeVisitor* base, |
| 33321 | BalaTypeCheck* expr) |
| 33322 | { |
| 33323 | BalaCCodeBaseModule * self; |
| 33324 | BalaDataType* _tmp0_; |
| 33325 | BalaDataType* _tmp1_; |
| 33326 | BalaCCodeFile* _tmp2_; |
| 33327 | BalaDataType* type = NULL((void*)0); |
| 33328 | BalaExpression* _tmp3_; |
| 33329 | BalaExpression* _tmp4_; |
| 33330 | BalaDataType* _tmp5_; |
| 33331 | BalaDataType* _tmp6_; |
| 33332 | BalaDataType* _tmp7_; |
| 33333 | BalaPointerType* pointer_type = NULL((void*)0); |
| 33334 | BalaDataType* _tmp8_; |
| 33335 | BalaPointerType* _tmp9_; |
| 33336 | BalaPointerType* _tmp10_; |
| 33337 | BalaClass* cl = NULL((void*)0); |
| 33338 | BalaDataType* _tmp15_; |
| 33339 | BalaTypeSymbol* _tmp16_; |
| 33340 | BalaTypeSymbol* _tmp17_; |
| 33341 | BalaInterface* iface = NULL((void*)0); |
| 33342 | BalaDataType* _tmp18_; |
| 33343 | BalaTypeSymbol* _tmp19_; |
| 33344 | BalaTypeSymbol* _tmp20_; |
| 33345 | gboolean _tmp21_ = FALSE(0); |
| 33346 | gboolean _tmp22_ = FALSE(0); |
| 33347 | gboolean _tmp23_ = FALSE(0); |
| 33348 | gboolean _tmp24_ = FALSE(0); |
| 33349 | BalaClass* _tmp25_; |
| 33350 | BalaCCodeExpression* _tmp41_; |
| 33351 | self = (BalaCCodeBaseModule*) base; |
| 33352 | g_return_if_fail (expr != NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return; } } while (0); |
| 33353 | _tmp0_ = bala_typecheck_get_type_reference (expr); |
| 33354 | _tmp1_ = _tmp0_; |
| 33355 | _tmp2_ = self->cfile; |
| 33356 | bala_ccode_base_module_generate_type_declaration (self, _tmp1_, _tmp2_); |
| 33357 | _tmp3_ = bala_typecheck_get_expression (expr); |
| 33358 | _tmp4_ = _tmp3_; |
| 33359 | _tmp5_ = bala_expression_get_value_type (_tmp4_); |
| 33360 | _tmp6_ = _tmp5_; |
| 33361 | _tmp7_ = _bala_code_node_ref0 (_tmp6_); |
| 33362 | type = _tmp7_; |
| 33363 | _tmp8_ = type; |
| 33364 | _tmp9_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, BALA_TYPE_POINTER_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp8_); GType __t = ((bala_pointer_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaPointerType*) _tmp8_) : NULL((void*)0)); |
| 33365 | pointer_type = _tmp9_; |
| 33366 | _tmp10_ = pointer_type; |
| 33367 | if (_tmp10_ != NULL((void*)0)) { |
| 33368 | BalaPointerType* _tmp11_; |
| 33369 | BalaDataType* _tmp12_; |
| 33370 | BalaDataType* _tmp13_; |
| 33371 | BalaDataType* _tmp14_; |
| 33372 | _tmp11_ = pointer_type; |
| 33373 | _tmp12_ = bala_pointer_type_get_base_type (_tmp11_); |
| 33374 | _tmp13_ = _tmp12_; |
| 33375 | _tmp14_ = _bala_code_node_ref0 (_tmp13_); |
| 33376 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 33377 | type = _tmp14_; |
| 33378 | } |
| 33379 | _tmp15_ = type; |
| 33380 | _tmp16_ = bala_data_type_get_type_symbol (_tmp15_); |
| 33381 | _tmp17_ = _tmp16_; |
| 33382 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp17_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp17_) : NULL((void*)0); |
| 33383 | _tmp18_ = type; |
| 33384 | _tmp19_ = bala_data_type_get_type_symbol (_tmp18_); |
| 33385 | _tmp20_ = _tmp19_; |
| 33386 | iface = G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, BALA_TYPE_INTERFACE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp20_); GType __t = ((bala_interface_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaInterface*) _tmp20_) : NULL((void*)0); |
| 33387 | _tmp25_ = cl; |
| 33388 | if (_tmp25_ != NULL((void*)0)) { |
| 33389 | BalaClass* _tmp26_; |
| 33390 | gboolean _tmp27_; |
| 33391 | gboolean _tmp28_; |
| 33392 | _tmp26_ = cl; |
| 33393 | _tmp27_ = bala_class_get_is_compact (_tmp26_); |
| 33394 | _tmp28_ = _tmp27_; |
| 33395 | _tmp24_ = !_tmp28_; |
| 33396 | } else { |
| 33397 | _tmp24_ = FALSE(0); |
| 33398 | } |
| 33399 | if (_tmp24_) { |
| 33400 | _tmp23_ = TRUE(!(0)); |
| 33401 | } else { |
| 33402 | BalaInterface* _tmp29_; |
| 33403 | _tmp29_ = iface; |
| 33404 | _tmp23_ = _tmp29_ != NULL((void*)0); |
| 33405 | } |
| 33406 | if (_tmp23_) { |
| 33407 | _tmp22_ = TRUE(!(0)); |
| 33408 | } else { |
| 33409 | BalaDataType* _tmp30_; |
| 33410 | _tmp30_ = type; |
| 33411 | _tmp22_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp30_, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp30_); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 33412 | } |
| 33413 | if (_tmp22_) { |
| 33414 | _tmp21_ = TRUE(!(0)); |
| 33415 | } else { |
| 33416 | BalaDataType* _tmp31_; |
| 33417 | _tmp31_ = type; |
| 33418 | _tmp21_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp31_, BALA_TYPE_ERROR_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp31_); GType __t = ((bala_error_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 33419 | } |
| 33420 | if (_tmp21_) { |
| 33421 | BalaExpression* _tmp32_; |
| 33422 | BalaExpression* _tmp33_; |
| 33423 | BalaCCodeExpression* _tmp34_; |
| 33424 | BalaDataType* _tmp35_; |
| 33425 | BalaDataType* _tmp36_; |
| 33426 | BalaCCodeExpression* _tmp37_; |
| 33427 | BalaCCodeExpression* _tmp38_; |
| 33428 | _tmp32_ = bala_typecheck_get_expression (expr); |
| 33429 | _tmp33_ = _tmp32_; |
| 33430 | _tmp34_ = bala_get_cvalue (_tmp33_); |
| 33431 | _tmp35_ = bala_typecheck_get_type_reference (expr); |
| 33432 | _tmp36_ = _tmp35_; |
| 33433 | _tmp37_ = bala_ccode_base_module_create_type_check (self, (BalaCCodeNode*) _tmp34_, _tmp36_); |
| 33434 | _tmp38_ = _tmp37_; |
| 33435 | bala_set_cvalue ((BalaExpression*) expr, _tmp38_); |
| 33436 | _bala_ccode_node_unref0 (_tmp38_)((_tmp38_ == ((void*)0)) ? ((void*)0) : (_tmp38_ = (bala_ccode_node_unref (_tmp38_), ((void*)0)))); |
| 33437 | } else { |
| 33438 | BalaCCodeInvalidExpression* _tmp39_; |
| 33439 | BalaCCodeInvalidExpression* _tmp40_; |
| 33440 | _tmp39_ = bala_ccode_invalid_expression_new (); |
| 33441 | _tmp40_ = _tmp39_; |
| 33442 | bala_set_cvalue ((BalaExpression*) expr, (BalaCCodeExpression*) _tmp40_); |
| 33443 | _bala_ccode_node_unref0 (_tmp40_)((_tmp40_ == ((void*)0)) ? ((void*)0) : (_tmp40_ = (bala_ccode_node_unref (_tmp40_), ((void*)0)))); |
| 33444 | } |
| 33445 | _tmp41_ = bala_get_cvalue ((BalaExpression*) expr); |
| 33446 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp41_, BALA_TYPE_CCODE_INVALID_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp41_); GType __t = ((bala_ccode_invalid_expression_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 33447 | BalaSourceReference* _tmp42_; |
| 33448 | BalaSourceReference* _tmp43_; |
| 33449 | _tmp42_ = bala_code_node_get_source_reference ((BalaCodeNode*) expr); |
| 33450 | _tmp43_ = _tmp42_; |
| 33451 | bala_report_error (_tmp43_, "type check expressions not supported for compact classes, structs, and" \ |
| 33452 | " enums"); |
| 33453 | } |
| 33454 | _bala_code_node_unref0 (pointer_type)((pointer_type == ((void*)0)) ? ((void*)0) : (pointer_type = ( bala_code_node_unref (pointer_type), ((void*)0)))); |
| 33455 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 33456 | } |
| 33457 | |
| 33458 | static void |
| 33459 | bala_ccode_base_module_real_visit_lambda_expression (BalaCodeVisitor* base, |
| 33460 | BalaLambdaExpression* lambda) |
| 33461 | { |
| 33462 | BalaCCodeBaseModule * self; |
| 33463 | BalaDelegateType* delegate_type = NULL((void*)0); |
| 33464 | BalaDataType* _tmp0_; |
| 33465 | BalaDataType* _tmp1_; |
| 33466 | BalaDelegateType* _tmp2_; |
| 33467 | gboolean expr_owned = FALSE(0); |
| 33468 | BalaDataType* _tmp3_; |
| 33469 | BalaDataType* _tmp4_; |
| 33470 | gboolean _tmp5_; |
| 33471 | gboolean _tmp6_; |
| 33472 | BalaMethod* _tmp7_; |
| 33473 | BalaMethod* _tmp8_; |
| 33474 | gchar* _tmp9_; |
| 33475 | gchar* _tmp10_; |
| 33476 | BalaCCodeIdentifier* _tmp11_; |
| 33477 | BalaCCodeIdentifier* _tmp12_; |
| 33478 | BalaDataType* this_type = NULL((void*)0); |
| 33479 | BalaMethod* _tmp13_; |
| 33480 | BalaMethod* _tmp14_; |
| 33481 | gboolean _tmp15_; |
| 33482 | gboolean _tmp16_; |
| 33483 | self = (BalaCCodeBaseModule*) base; |
| 33484 | g_return_if_fail (lambda != NULL)do { if ((lambda != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "lambda != NULL" ); return; } } while (0); |
| 33485 | _tmp0_ = bala_expression_get_target_type ((BalaExpression*) lambda); |
| 33486 | _tmp1_ = _tmp0_; |
| 33487 | _tmp2_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp1_), ((bala_delegate_type_get_type ())))))); |
| 33488 | delegate_type = _tmp2_; |
| 33489 | bala_code_node_accept_children ((BalaCodeNode*) lambda, (BalaCodeVisitor*) self); |
| 33490 | _tmp3_ = bala_expression_get_value_type ((BalaExpression*) lambda); |
| 33491 | _tmp4_ = _tmp3_; |
| 33492 | _tmp5_ = bala_data_type_get_value_owned (_tmp4_); |
| 33493 | _tmp6_ = _tmp5_; |
| 33494 | expr_owned = _tmp6_; |
| 33495 | _tmp7_ = bala_lambda_expression_get_method (lambda); |
| 33496 | _tmp8_ = _tmp7_; |
| 33497 | _tmp9_ = bala_get_ccode_name ((BalaCodeNode*) _tmp8_); |
| 33498 | _tmp10_ = _tmp9_; |
| 33499 | _tmp11_ = bala_ccode_identifier_new (_tmp10_); |
| 33500 | _tmp12_ = _tmp11_; |
| 33501 | bala_set_cvalue ((BalaExpression*) lambda, (BalaCCodeExpression*) _tmp12_); |
| 33502 | _bala_ccode_node_unref0 (_tmp12_)((_tmp12_ == ((void*)0)) ? ((void*)0) : (_tmp12_ = (bala_ccode_node_unref (_tmp12_), ((void*)0)))); |
| 33503 | _g_free0 (_tmp10_)(_tmp10_ = (g_free (_tmp10_), ((void*)0))); |
| 33504 | _tmp13_ = bala_lambda_expression_get_method (lambda); |
| 33505 | _tmp14_ = _tmp13_; |
| 33506 | _tmp15_ = bala_method_get_closure (_tmp14_); |
| 33507 | _tmp16_ = _tmp15_; |
| 33508 | if (_tmp16_) { |
| 33509 | gint block_id = 0; |
| 33510 | BalaBlock* _tmp17_; |
| 33511 | BalaBlock* _tmp18_; |
| 33512 | BalaCCodeExpression* delegate_target = NULL((void*)0); |
| 33513 | gchar* _tmp19_; |
| 33514 | gchar* _tmp20_; |
| 33515 | BalaCCodeExpression* _tmp21_; |
| 33516 | BalaCCodeExpression* _tmp22_; |
| 33517 | gboolean _tmp23_ = FALSE(0); |
| 33518 | BalaCCodeExpression* _tmp43_; |
| 33519 | _tmp17_ = bala_ccode_base_module_get_current_closure_block (self); |
| 33520 | _tmp18_ = _tmp17_; |
| 33521 | block_id = bala_ccode_base_module_get_block_id (self, _tmp18_); |
| 33522 | _tmp19_ = g_strdup_printf ("_data%d_", block_id); |
| 33523 | _tmp20_ = _tmp19_; |
| 33524 | _tmp21_ = bala_ccode_base_module_get_variable_cexpression (self, _tmp20_); |
| 33525 | _tmp22_ = _tmp21_; |
| 33526 | _g_free0 (_tmp20_)(_tmp20_ = (g_free (_tmp20_), ((void*)0))); |
| 33527 | delegate_target = _tmp22_; |
| 33528 | if (expr_owned) { |
| 33529 | _tmp23_ = TRUE(!(0)); |
| 33530 | } else { |
| 33531 | BalaDelegateType* _tmp24_; |
| 33532 | gboolean _tmp25_; |
| 33533 | gboolean _tmp26_; |
| 33534 | _tmp24_ = delegate_type; |
| 33535 | _tmp25_ = bala_delegate_type_get_is_called_once (_tmp24_); |
| 33536 | _tmp26_ = _tmp25_; |
| 33537 | _tmp23_ = _tmp26_; |
| 33538 | } |
| 33539 | if (_tmp23_) { |
| 33540 | BalaCCodeFunctionCall* ref_call = NULL((void*)0); |
| 33541 | gchar* _tmp27_; |
| 33542 | gchar* _tmp28_; |
| 33543 | BalaCCodeIdentifier* _tmp29_; |
| 33544 | BalaCCodeIdentifier* _tmp30_; |
| 33545 | BalaCCodeFunctionCall* _tmp31_; |
| 33546 | BalaCCodeFunctionCall* _tmp32_; |
| 33547 | BalaCCodeFunctionCall* _tmp33_; |
| 33548 | BalaCCodeExpression* _tmp34_; |
| 33549 | BalaCCodeFunctionCall* _tmp35_; |
| 33550 | BalaCCodeExpression* _tmp36_; |
| 33551 | gchar* _tmp37_; |
| 33552 | gchar* _tmp38_; |
| 33553 | BalaCCodeIdentifier* _tmp39_; |
| 33554 | BalaCCodeIdentifier* _tmp40_; |
| 33555 | _tmp27_ = g_strdup_printf ("block%d_data_ref", block_id); |
| 33556 | _tmp28_ = _tmp27_; |
| 33557 | _tmp29_ = bala_ccode_identifier_new (_tmp28_); |
| 33558 | _tmp30_ = _tmp29_; |
| 33559 | _tmp31_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp30_); |
| 33560 | _tmp32_ = _tmp31_; |
| 33561 | _bala_ccode_node_unref0 (_tmp30_)((_tmp30_ == ((void*)0)) ? ((void*)0) : (_tmp30_ = (bala_ccode_node_unref (_tmp30_), ((void*)0)))); |
| 33562 | _g_free0 (_tmp28_)(_tmp28_ = (g_free (_tmp28_), ((void*)0))); |
| 33563 | ref_call = _tmp32_; |
| 33564 | _tmp33_ = ref_call; |
| 33565 | _tmp34_ = delegate_target; |
| 33566 | bala_ccode_function_call_add_argument (_tmp33_, _tmp34_); |
| 33567 | _tmp35_ = ref_call; |
| 33568 | _tmp36_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp35_); |
| 33569 | _bala_ccode_node_unref0 (delegate_target)((delegate_target == ((void*)0)) ? ((void*)0) : (delegate_target = (bala_ccode_node_unref (delegate_target), ((void*)0)))); |
| 33570 | delegate_target = _tmp36_; |
| 33571 | _tmp37_ = g_strdup_printf ("block%d_data_unref", block_id); |
| 33572 | _tmp38_ = _tmp37_; |
| 33573 | _tmp39_ = bala_ccode_identifier_new (_tmp38_); |
| 33574 | _tmp40_ = _tmp39_; |
| 33575 | bala_set_delegate_target_destroy_notify ((BalaExpression*) lambda, (BalaCCodeExpression*) _tmp40_); |
| 33576 | _bala_ccode_node_unref0 (_tmp40_)((_tmp40_ == ((void*)0)) ? ((void*)0) : (_tmp40_ = (bala_ccode_node_unref (_tmp40_), ((void*)0)))); |
| 33577 | _g_free0 (_tmp38_)(_tmp38_ = (g_free (_tmp38_), ((void*)0))); |
| 33578 | _bala_ccode_node_unref0 (ref_call)((ref_call == ((void*)0)) ? ((void*)0) : (ref_call = (bala_ccode_node_unref (ref_call), ((void*)0)))); |
| 33579 | } else { |
| 33580 | BalaCCodeConstant* _tmp41_; |
| 33581 | BalaCCodeConstant* _tmp42_; |
| 33582 | _tmp41_ = bala_ccode_constant_new ("NULL"); |
| 33583 | _tmp42_ = _tmp41_; |
| 33584 | bala_set_delegate_target_destroy_notify ((BalaExpression*) lambda, (BalaCCodeExpression*) _tmp42_); |
| 33585 | _bala_ccode_node_unref0 (_tmp42_)((_tmp42_ == ((void*)0)) ? ((void*)0) : (_tmp42_ = (bala_ccode_node_unref (_tmp42_), ((void*)0)))); |
| 33586 | } |
| 33587 | _tmp43_ = delegate_target; |
| 33588 | bala_set_delegate_target ((BalaExpression*) lambda, _tmp43_); |
| 33589 | _bala_ccode_node_unref0 (delegate_target)((delegate_target == ((void*)0)) ? ((void*)0) : (delegate_target = (bala_ccode_node_unref (delegate_target), ((void*)0)))); |
| 33590 | } else { |
| 33591 | BalaDataType* _tmp44_; |
| 33592 | BalaDataType* _tmp45_; |
| 33593 | _tmp44_ = bala_ccode_base_module_get_this_type (self); |
| 33594 | this_type = _tmp44_; |
| 33595 | _tmp45_ = this_type; |
| 33596 | if (_tmp45_ != NULL((void*)0)) { |
| 33597 | BalaCCodeExpression* delegate_target = NULL((void*)0); |
| 33598 | BalaCCodeExpression* _tmp46_; |
| 33599 | BalaCCodeExpression* _tmp47_; |
| 33600 | BalaDataType* _tmp48_; |
| 33601 | BalaCCodeExpression* _tmp49_; |
| 33602 | gboolean _tmp50_ = FALSE(0); |
| 33603 | BalaCCodeExpression* _tmp70_; |
| 33604 | _tmp46_ = bala_ccode_base_module_get_this_cexpression (self); |
| 33605 | delegate_target = _tmp46_; |
| 33606 | _tmp47_ = delegate_target; |
| 33607 | _tmp48_ = this_type; |
| 33608 | _tmp49_ = bala_ccode_base_module_convert_to_generic_pointer (self, _tmp47_, _tmp48_); |
| 33609 | _bala_ccode_node_unref0 (delegate_target)((delegate_target == ((void*)0)) ? ((void*)0) : (delegate_target = (bala_ccode_node_unref (delegate_target), ((void*)0)))); |
| 33610 | delegate_target = _tmp49_; |
| 33611 | if (expr_owned) { |
| 33612 | _tmp50_ = TRUE(!(0)); |
| 33613 | } else { |
| 33614 | BalaDelegateType* _tmp51_; |
| 33615 | gboolean _tmp52_; |
| 33616 | gboolean _tmp53_; |
| 33617 | _tmp51_ = delegate_type; |
| 33618 | _tmp52_ = bala_delegate_type_get_is_called_once (_tmp51_); |
| 33619 | _tmp53_ = _tmp52_; |
| 33620 | _tmp50_ = _tmp53_; |
| 33621 | } |
| 33622 | if (_tmp50_) { |
| 33623 | BalaCCodeFunctionCall* ref_call = NULL((void*)0); |
| 33624 | BalaDataType* _tmp54_; |
| 33625 | BalaSourceReference* _tmp55_; |
| 33626 | BalaSourceReference* _tmp56_; |
| 33627 | BalaCCodeExpression* _tmp57_; |
| 33628 | BalaCCodeExpression* _tmp58_; |
| 33629 | BalaCCodeFunctionCall* _tmp59_; |
| 33630 | BalaCCodeFunctionCall* _tmp60_; |
| 33631 | BalaCCodeFunctionCall* _tmp61_; |
| 33632 | BalaCCodeExpression* _tmp62_; |
| 33633 | BalaCCodeFunctionCall* _tmp63_; |
| 33634 | BalaCCodeExpression* _tmp64_; |
| 33635 | BalaDataType* _tmp65_; |
| 33636 | BalaCCodeExpression* _tmp66_; |
| 33637 | BalaCCodeExpression* _tmp67_; |
| 33638 | _tmp54_ = this_type; |
| 33639 | _tmp55_ = bala_code_node_get_source_reference ((BalaCodeNode*) lambda); |
| 33640 | _tmp56_ = _tmp55_; |
| 33641 | _tmp57_ = bala_ccode_base_module_get_dup_func_expression (self, _tmp54_, _tmp56_, FALSE(0)); |
| 33642 | _tmp58_ = _tmp57_; |
| 33643 | _tmp59_ = bala_ccode_function_call_new (_tmp58_); |
| 33644 | _tmp60_ = _tmp59_; |
| 33645 | _bala_ccode_node_unref0 (_tmp58_)((_tmp58_ == ((void*)0)) ? ((void*)0) : (_tmp58_ = (bala_ccode_node_unref (_tmp58_), ((void*)0)))); |
| 33646 | ref_call = _tmp60_; |
| 33647 | _tmp61_ = ref_call; |
| 33648 | _tmp62_ = delegate_target; |
| 33649 | bala_ccode_function_call_add_argument (_tmp61_, _tmp62_); |
| 33650 | _tmp63_ = ref_call; |
| 33651 | _tmp64_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp63_); |
| 33652 | _bala_ccode_node_unref0 (delegate_target)((delegate_target == ((void*)0)) ? ((void*)0) : (delegate_target = (bala_ccode_node_unref (delegate_target), ((void*)0)))); |
| 33653 | delegate_target = _tmp64_; |
| 33654 | _tmp65_ = this_type; |
| 33655 | _tmp66_ = bala_ccode_base_module_get_destroy_func_expression (self, _tmp65_, FALSE(0)); |
| 33656 | _tmp67_ = _tmp66_; |
| 33657 | bala_set_delegate_target_destroy_notify ((BalaExpression*) lambda, _tmp67_); |
| 33658 | _bala_ccode_node_unref0 (_tmp67_)((_tmp67_ == ((void*)0)) ? ((void*)0) : (_tmp67_ = (bala_ccode_node_unref (_tmp67_), ((void*)0)))); |
| 33659 | _bala_ccode_node_unref0 (ref_call)((ref_call == ((void*)0)) ? ((void*)0) : (ref_call = (bala_ccode_node_unref (ref_call), ((void*)0)))); |
| 33660 | } else { |
| 33661 | BalaCCodeConstant* _tmp68_; |
| 33662 | BalaCCodeConstant* _tmp69_; |
| 33663 | _tmp68_ = bala_ccode_constant_new ("NULL"); |
| 33664 | _tmp69_ = _tmp68_; |
| 33665 | bala_set_delegate_target_destroy_notify ((BalaExpression*) lambda, (BalaCCodeExpression*) _tmp69_); |
| 33666 | _bala_ccode_node_unref0 (_tmp69_)((_tmp69_ == ((void*)0)) ? ((void*)0) : (_tmp69_ = (bala_ccode_node_unref (_tmp69_), ((void*)0)))); |
| 33667 | } |
| 33668 | _tmp70_ = delegate_target; |
| 33669 | bala_set_delegate_target ((BalaExpression*) lambda, _tmp70_); |
| 33670 | _bala_ccode_node_unref0 (delegate_target)((delegate_target == ((void*)0)) ? ((void*)0) : (delegate_target = (bala_ccode_node_unref (delegate_target), ((void*)0)))); |
| 33671 | } else { |
| 33672 | BalaCCodeConstant* _tmp71_; |
| 33673 | BalaCCodeConstant* _tmp72_; |
| 33674 | BalaCCodeConstant* _tmp73_; |
| 33675 | BalaCCodeConstant* _tmp74_; |
| 33676 | _tmp71_ = bala_ccode_constant_new ("NULL"); |
| 33677 | _tmp72_ = _tmp71_; |
| 33678 | bala_set_delegate_target ((BalaExpression*) lambda, (BalaCCodeExpression*) _tmp72_); |
| 33679 | _bala_ccode_node_unref0 (_tmp72_)((_tmp72_ == ((void*)0)) ? ((void*)0) : (_tmp72_ = (bala_ccode_node_unref (_tmp72_), ((void*)0)))); |
| 33680 | _tmp73_ = bala_ccode_constant_new ("NULL"); |
| 33681 | _tmp74_ = _tmp73_; |
| 33682 | bala_set_delegate_target_destroy_notify ((BalaExpression*) lambda, (BalaCCodeExpression*) _tmp74_); |
| 33683 | _bala_ccode_node_unref0 (_tmp74_)((_tmp74_ == ((void*)0)) ? ((void*)0) : (_tmp74_ = (bala_ccode_node_unref (_tmp74_), ((void*)0)))); |
| 33684 | } |
| 33685 | } |
| 33686 | _bala_code_node_unref0 (delegate_type)((delegate_type == ((void*)0)) ? ((void*)0) : (delegate_type = (bala_code_node_unref (delegate_type), ((void*)0)))); |
| 33687 | } |
| 33688 | |
| 33689 | BalaCCodeExpression* |
| 33690 | bala_ccode_base_module_convert_from_generic_pointer (BalaCCodeBaseModule* self, |
| 33691 | BalaCCodeExpression* cexpr, |
| 33692 | BalaDataType* actual_type) |
| 33693 | { |
| 33694 | BalaSemanticAnalyzer* analyzer = NULL((void*)0); |
| 33695 | BalaCodeContext* _tmp0_; |
| 33696 | BalaSemanticAnalyzer* _tmp1_; |
| 33697 | BalaSemanticAnalyzer* _tmp2_; |
| 33698 | BalaCCodeExpression* _result_ = NULL((void*)0); |
| 33699 | BalaCCodeExpression* _tmp3_; |
| 33700 | gboolean _tmp4_ = FALSE(0); |
| 33701 | BalaSemanticAnalyzer* _tmp5_; |
| 33702 | BalaCCodeExpression* result = NULL((void*)0); |
| 33703 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 33704 | g_return_val_if_fail (cexpr != NULL, NULL)do { if ((cexpr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "cexpr != NULL" ); return (((void*)0)); } } while (0); |
| 33705 | g_return_val_if_fail (actual_type != NULL, NULL)do { if ((actual_type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "actual_type != NULL" ); return (((void*)0)); } } while (0); |
| 33706 | _tmp0_ = self->priv->_context; |
| 33707 | _tmp1_ = bala_code_context_get_analyzer (_tmp0_); |
| 33708 | _tmp2_ = _tmp1_; |
| 33709 | analyzer = _tmp2_; |
| 33710 | _tmp3_ = _bala_ccode_node_ref0 (cexpr); |
| 33711 | _result_ = _tmp3_; |
| 33712 | _tmp5_ = analyzer; |
| 33713 | if (bala_semantic_analyzer_is_reference_type_argument (_tmp5_, actual_type)) { |
| 33714 | _tmp4_ = TRUE(!(0)); |
| 33715 | } else { |
| 33716 | BalaSemanticAnalyzer* _tmp6_; |
| 33717 | _tmp6_ = analyzer; |
| 33718 | _tmp4_ = bala_semantic_analyzer_is_nullable_value_type_argument (_tmp6_, actual_type); |
| 33719 | } |
| 33720 | if (_tmp4_) { |
| 33721 | BalaCCodeFile* _tmp7_; |
| 33722 | gchar* _tmp8_; |
| 33723 | gchar* _tmp9_; |
| 33724 | BalaCCodeCastExpression* _tmp10_; |
| 33725 | _tmp7_ = self->cfile; |
| 33726 | bala_ccode_base_module_generate_type_declaration (self, actual_type, _tmp7_); |
| 33727 | _tmp8_ = bala_get_ccode_name ((BalaCodeNode*) actual_type); |
| 33728 | _tmp9_ = _tmp8_; |
| 33729 | _tmp10_ = bala_ccode_cast_expression_new (cexpr, _tmp9_); |
| 33730 | _bala_ccode_node_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_ccode_node_unref (_result_), ((void*)0)))); |
| 33731 | _result_ = (BalaCCodeExpression*) _tmp10_; |
| 33732 | _g_free0 (_tmp9_)(_tmp9_ = (g_free (_tmp9_), ((void*)0))); |
| 33733 | } else { |
| 33734 | BalaSemanticAnalyzer* _tmp11_; |
| 33735 | _tmp11_ = analyzer; |
| 33736 | if (bala_semantic_analyzer_is_signed_integer_type_argument (_tmp11_, actual_type)) { |
| 33737 | BalaCCodeCastExpression* _tmp14_; |
| 33738 | BalaCCodeCastExpression* _tmp15_; |
| 33739 | gchar* _tmp16_; |
| 33740 | gchar* _tmp17_; |
| 33741 | BalaCCodeCastExpression* _tmp18_; |
| 33742 | while (TRUE(!(0))) { |
| 33743 | BalaCCodeExpression* _tmp12_; |
| 33744 | BalaCCodeExpression* _tmp13_; |
| 33745 | if (!G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_CAST_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_cast_expression_get_type ()) ); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 33746 | break; |
| 33747 | } |
| 33748 | _tmp12_ = bala_ccode_cast_expression_get_inner (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_CAST_EXPRESSION, BalaCCodeCastExpression)(((BalaCCodeCastExpression*) g_type_check_instance_cast ((GTypeInstance *) (cexpr), ((bala_ccode_cast_expression_get_type ())))))); |
| 33749 | _tmp13_ = _tmp12_; |
| 33750 | cexpr = _tmp13_; |
| 33751 | } |
| 33752 | _tmp14_ = bala_ccode_cast_expression_new (cexpr, "gintptr"); |
| 33753 | _tmp15_ = _tmp14_; |
| 33754 | _tmp16_ = bala_get_ccode_name ((BalaCodeNode*) actual_type); |
| 33755 | _tmp17_ = _tmp16_; |
| 33756 | _tmp18_ = bala_ccode_cast_expression_new ((BalaCCodeExpression*) _tmp15_, _tmp17_); |
| 33757 | _bala_ccode_node_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_ccode_node_unref (_result_), ((void*)0)))); |
| 33758 | _result_ = (BalaCCodeExpression*) _tmp18_; |
| 33759 | _g_free0 (_tmp17_)(_tmp17_ = (g_free (_tmp17_), ((void*)0))); |
| 33760 | _bala_ccode_node_unref0 (_tmp15_)((_tmp15_ == ((void*)0)) ? ((void*)0) : (_tmp15_ = (bala_ccode_node_unref (_tmp15_), ((void*)0)))); |
| 33761 | } else { |
| 33762 | BalaSemanticAnalyzer* _tmp19_; |
| 33763 | _tmp19_ = analyzer; |
| 33764 | if (bala_semantic_analyzer_is_unsigned_integer_type_argument (_tmp19_, actual_type)) { |
| 33765 | BalaCCodeCastExpression* _tmp22_; |
| 33766 | BalaCCodeCastExpression* _tmp23_; |
| 33767 | gchar* _tmp24_; |
| 33768 | gchar* _tmp25_; |
| 33769 | BalaCCodeCastExpression* _tmp26_; |
| 33770 | while (TRUE(!(0))) { |
| 33771 | BalaCCodeExpression* _tmp20_; |
| 33772 | BalaCCodeExpression* _tmp21_; |
| 33773 | if (!G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_CAST_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_cast_expression_get_type ()) ); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 33774 | break; |
| 33775 | } |
| 33776 | _tmp20_ = bala_ccode_cast_expression_get_inner (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_CAST_EXPRESSION, BalaCCodeCastExpression)(((BalaCCodeCastExpression*) g_type_check_instance_cast ((GTypeInstance *) (cexpr), ((bala_ccode_cast_expression_get_type ())))))); |
| 33777 | _tmp21_ = _tmp20_; |
| 33778 | cexpr = _tmp21_; |
| 33779 | } |
| 33780 | _tmp22_ = bala_ccode_cast_expression_new (cexpr, "guintptr"); |
| 33781 | _tmp23_ = _tmp22_; |
| 33782 | _tmp24_ = bala_get_ccode_name ((BalaCodeNode*) actual_type); |
| 33783 | _tmp25_ = _tmp24_; |
| 33784 | _tmp26_ = bala_ccode_cast_expression_new ((BalaCCodeExpression*) _tmp23_, _tmp25_); |
| 33785 | _bala_ccode_node_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_ccode_node_unref (_result_), ((void*)0)))); |
| 33786 | _result_ = (BalaCCodeExpression*) _tmp26_; |
| 33787 | _g_free0 (_tmp25_)(_tmp25_ = (g_free (_tmp25_), ((void*)0))); |
| 33788 | _bala_ccode_node_unref0 (_tmp23_)((_tmp23_ == ((void*)0)) ? ((void*)0) : (_tmp23_ = (bala_ccode_node_unref (_tmp23_), ((void*)0)))); |
| 33789 | } |
| 33790 | } |
| 33791 | } |
| 33792 | result = _result_; |
| 33793 | return result; |
| 33794 | } |
| 33795 | |
| 33796 | BalaCCodeExpression* |
| 33797 | bala_ccode_base_module_convert_to_generic_pointer (BalaCCodeBaseModule* self, |
| 33798 | BalaCCodeExpression* cexpr, |
| 33799 | BalaDataType* actual_type) |
| 33800 | { |
| 33801 | BalaSemanticAnalyzer* analyzer = NULL((void*)0); |
| 33802 | BalaCodeContext* _tmp0_; |
| 33803 | BalaSemanticAnalyzer* _tmp1_; |
| 33804 | BalaSemanticAnalyzer* _tmp2_; |
| 33805 | BalaCCodeExpression* _result_ = NULL((void*)0); |
| 33806 | BalaCCodeExpression* _tmp3_; |
| 33807 | BalaSemanticAnalyzer* _tmp4_; |
| 33808 | BalaCCodeExpression* result = NULL((void*)0); |
| 33809 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 33810 | g_return_val_if_fail (cexpr != NULL, NULL)do { if ((cexpr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "cexpr != NULL" ); return (((void*)0)); } } while (0); |
| 33811 | g_return_val_if_fail (actual_type != NULL, NULL)do { if ((actual_type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "actual_type != NULL" ); return (((void*)0)); } } while (0); |
| 33812 | _tmp0_ = self->priv->_context; |
| 33813 | _tmp1_ = bala_code_context_get_analyzer (_tmp0_); |
| 33814 | _tmp2_ = _tmp1_; |
| 33815 | analyzer = _tmp2_; |
| 33816 | _tmp3_ = _bala_ccode_node_ref0 (cexpr); |
| 33817 | _result_ = _tmp3_; |
| 33818 | _tmp4_ = analyzer; |
| 33819 | if (bala_semantic_analyzer_is_signed_integer_type_argument (_tmp4_, actual_type)) { |
| 33820 | BalaCCodeCastExpression* _tmp7_; |
| 33821 | BalaCCodeCastExpression* _tmp8_; |
| 33822 | BalaDataType* _tmp9_; |
| 33823 | gchar* _tmp10_; |
| 33824 | gchar* _tmp11_; |
| 33825 | BalaCCodeCastExpression* _tmp12_; |
| 33826 | while (TRUE(!(0))) { |
| 33827 | BalaCCodeExpression* _tmp5_; |
| 33828 | BalaCCodeExpression* _tmp6_; |
| 33829 | if (!G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_CAST_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_cast_expression_get_type ()) ); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 33830 | break; |
| 33831 | } |
| 33832 | _tmp5_ = bala_ccode_cast_expression_get_inner (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_CAST_EXPRESSION, BalaCCodeCastExpression)(((BalaCCodeCastExpression*) g_type_check_instance_cast ((GTypeInstance *) (cexpr), ((bala_ccode_cast_expression_get_type ())))))); |
| 33833 | _tmp6_ = _tmp5_; |
| 33834 | cexpr = _tmp6_; |
| 33835 | } |
| 33836 | _tmp7_ = bala_ccode_cast_expression_new (cexpr, "gintptr"); |
| 33837 | _tmp8_ = _tmp7_; |
| 33838 | _tmp9_ = self->pointer_type; |
| 33839 | _tmp10_ = bala_get_ccode_name ((BalaCodeNode*) _tmp9_); |
| 33840 | _tmp11_ = _tmp10_; |
| 33841 | _tmp12_ = bala_ccode_cast_expression_new ((BalaCCodeExpression*) _tmp8_, _tmp11_); |
| 33842 | _bala_ccode_node_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_ccode_node_unref (_result_), ((void*)0)))); |
| 33843 | _result_ = (BalaCCodeExpression*) _tmp12_; |
| 33844 | _g_free0 (_tmp11_)(_tmp11_ = (g_free (_tmp11_), ((void*)0))); |
| 33845 | _bala_ccode_node_unref0 (_tmp8_)((_tmp8_ == ((void*)0)) ? ((void*)0) : (_tmp8_ = (bala_ccode_node_unref (_tmp8_), ((void*)0)))); |
| 33846 | } else { |
| 33847 | BalaSemanticAnalyzer* _tmp13_; |
| 33848 | _tmp13_ = analyzer; |
| 33849 | if (bala_semantic_analyzer_is_unsigned_integer_type_argument (_tmp13_, actual_type)) { |
| 33850 | BalaCCodeCastExpression* _tmp16_; |
| 33851 | BalaCCodeCastExpression* _tmp17_; |
| 33852 | BalaDataType* _tmp18_; |
| 33853 | gchar* _tmp19_; |
| 33854 | gchar* _tmp20_; |
| 33855 | BalaCCodeCastExpression* _tmp21_; |
| 33856 | while (TRUE(!(0))) { |
| 33857 | BalaCCodeExpression* _tmp14_; |
| 33858 | BalaCCodeExpression* _tmp15_; |
| 33859 | if (!G_TYPE_CHECK_INSTANCE_TYPE (cexpr, BALA_TYPE_CCODE_CAST_EXPRESSION)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( cexpr); GType __t = ((bala_ccode_cast_expression_get_type ()) ); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 33860 | break; |
| 33861 | } |
| 33862 | _tmp14_ = bala_ccode_cast_expression_get_inner (G_TYPE_CHECK_INSTANCE_CAST (cexpr, BALA_TYPE_CCODE_CAST_EXPRESSION, BalaCCodeCastExpression)(((BalaCCodeCastExpression*) g_type_check_instance_cast ((GTypeInstance *) (cexpr), ((bala_ccode_cast_expression_get_type ())))))); |
| 33863 | _tmp15_ = _tmp14_; |
| 33864 | cexpr = _tmp15_; |
| 33865 | } |
| 33866 | _tmp16_ = bala_ccode_cast_expression_new (cexpr, "guintptr"); |
| 33867 | _tmp17_ = _tmp16_; |
| 33868 | _tmp18_ = self->pointer_type; |
| 33869 | _tmp19_ = bala_get_ccode_name ((BalaCodeNode*) _tmp18_); |
| 33870 | _tmp20_ = _tmp19_; |
| 33871 | _tmp21_ = bala_ccode_cast_expression_new ((BalaCCodeExpression*) _tmp17_, _tmp20_); |
| 33872 | _bala_ccode_node_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_ccode_node_unref (_result_), ((void*)0)))); |
| 33873 | _result_ = (BalaCCodeExpression*) _tmp21_; |
| 33874 | _g_free0 (_tmp20_)(_tmp20_ = (g_free (_tmp20_), ((void*)0))); |
| 33875 | _bala_ccode_node_unref0 (_tmp17_)((_tmp17_ == ((void*)0)) ? ((void*)0) : (_tmp17_ = (bala_ccode_node_unref (_tmp17_), ((void*)0)))); |
| 33876 | } |
| 33877 | } |
| 33878 | result = _result_; |
| 33879 | return result; |
| 33880 | } |
| 33881 | |
| 33882 | BalaTargetValue* |
| 33883 | bala_ccode_base_module_transform_value (BalaCCodeBaseModule* self, |
| 33884 | BalaTargetValue* value, |
| 33885 | BalaDataType* target_type, |
| 33886 | BalaCodeNode* node) |
| 33887 | { |
| 33888 | BalaDataType* type = NULL((void*)0); |
| 33889 | BalaDataType* _tmp0_; |
| 33890 | BalaDataType* _tmp1_; |
| 33891 | BalaDataType* _tmp2_; |
| 33892 | BalaGLibValue* _result_ = NULL((void*)0); |
| 33893 | BalaGLibValue* _tmp3_; |
| 33894 | gboolean _tmp4_ = FALSE(0); |
| 33895 | gboolean _tmp5_ = FALSE(0); |
| 33896 | BalaDataType* _tmp6_; |
| 33897 | gboolean _tmp7_; |
| 33898 | gboolean _tmp8_; |
| 33899 | gboolean _tmp63_ = FALSE(0); |
| 33900 | gboolean _tmp64_ = FALSE(0); |
| 33901 | gboolean _tmp65_ = FALSE(0); |
| 33902 | BalaDataType* _tmp66_; |
| 33903 | gboolean boxing = FALSE(0); |
| 33904 | gboolean _tmp72_ = FALSE(0); |
| 33905 | gboolean _tmp73_ = FALSE(0); |
| 33906 | gboolean _tmp74_ = FALSE(0); |
| 33907 | BalaDataType* _tmp75_; |
| 33908 | gboolean unboxing = FALSE(0); |
| 33909 | gboolean _tmp81_ = FALSE(0); |
| 33910 | gboolean _tmp82_ = FALSE(0); |
| 33911 | gboolean _tmp83_ = FALSE(0); |
| 33912 | gboolean _tmp84_ = FALSE(0); |
| 33913 | BalaCodeContext* _tmp85_; |
| 33914 | BalaProfile _tmp86_; |
| 33915 | BalaProfile _tmp87_; |
| 33916 | gboolean gvalue_boxing = FALSE(0); |
| 33917 | gboolean _tmp95_ = FALSE(0); |
| 33918 | gboolean _tmp96_ = FALSE(0); |
| 33919 | gboolean _tmp97_ = FALSE(0); |
| 33920 | gboolean _tmp98_ = FALSE(0); |
| 33921 | BalaCodeContext* _tmp99_; |
| 33922 | BalaProfile _tmp100_; |
| 33923 | BalaProfile _tmp101_; |
| 33924 | gboolean gvariant_boxing = FALSE(0); |
| 33925 | gboolean _tmp110_ = FALSE(0); |
| 33926 | gboolean _tmp111_ = FALSE(0); |
| 33927 | BalaDataType* _tmp112_; |
| 33928 | gboolean _tmp113_; |
| 33929 | gboolean _tmp114_; |
| 33930 | BalaGLibValue* _tmp143_; |
| 33931 | BalaDataType* _tmp144_; |
| 33932 | BalaDataType* _tmp145_; |
| 33933 | gboolean array_needs_copy = FALSE(0); |
| 33934 | gboolean _tmp356_ = FALSE(0); |
| 33935 | BalaDataType* _tmp357_; |
| 33936 | gboolean _tmp375_ = FALSE(0); |
| 33937 | gboolean _tmp376_ = FALSE(0); |
| 33938 | gboolean _tmp377_ = FALSE(0); |
| 33939 | gboolean _tmp378_ = FALSE(0); |
| 33940 | gboolean _tmp379_ = FALSE(0); |
| 33941 | BalaTargetValue* result = NULL((void*)0); |
| 33942 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 33943 | g_return_val_if_fail (value != NULL, NULL)do { if ((value != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "value != NULL" ); return (((void*)0)); } } while (0); |
| 33944 | g_return_val_if_fail (node != NULL, NULL)do { if ((node != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "node != NULL" ); return (((void*)0)); } } while (0); |
| 33945 | _tmp0_ = bala_target_value_get_value_type (value); |
| 33946 | _tmp1_ = _tmp0_; |
| 33947 | _tmp2_ = _bala_code_node_ref0 (_tmp1_); |
| 33948 | type = _tmp2_; |
| 33949 | _tmp3_ = bala_glib_value_copy (G_TYPE_CHECK_INSTANCE_CAST (value, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (value), ((bala_glib_value_get_type ())))))); |
| 33950 | _result_ = _tmp3_; |
| 33951 | _tmp6_ = type; |
| 33952 | _tmp7_ = bala_data_type_get_value_owned (_tmp6_); |
| 33953 | _tmp8_ = _tmp7_; |
| 33954 | if (_tmp8_) { |
| 33955 | gboolean _tmp9_ = FALSE(0); |
| 33956 | gboolean _tmp10_ = FALSE(0); |
| 33957 | if (target_type == NULL((void*)0)) { |
| 33958 | _tmp10_ = TRUE(!(0)); |
| 33959 | } else { |
| 33960 | _tmp10_ = G_TYPE_CHECK_INSTANCE_TYPE (target_type, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( target_type); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 33961 | } |
| 33962 | if (_tmp10_) { |
| 33963 | _tmp9_ = TRUE(!(0)); |
| 33964 | } else { |
| 33965 | gboolean _tmp11_; |
| 33966 | gboolean _tmp12_; |
| 33967 | _tmp11_ = bala_data_type_get_floating_reference (target_type); |
| 33968 | _tmp12_ = _tmp11_; |
| 33969 | _tmp9_ = !_tmp12_; |
| 33970 | } |
| 33971 | _tmp5_ = _tmp9_; |
| 33972 | } else { |
| 33973 | _tmp5_ = FALSE(0); |
| 33974 | } |
| 33975 | if (_tmp5_) { |
| 33976 | BalaDataType* _tmp13_; |
| 33977 | gboolean _tmp14_; |
| 33978 | gboolean _tmp15_; |
| 33979 | _tmp13_ = type; |
| 33980 | _tmp14_ = bala_data_type_get_floating_reference (_tmp13_); |
| 33981 | _tmp15_ = _tmp14_; |
| 33982 | _tmp4_ = _tmp15_; |
| 33983 | } else { |
| 33984 | _tmp4_ = FALSE(0); |
| 33985 | } |
| 33986 | if (_tmp4_) { |
| 33987 | BalaObjectTypeSymbol* cl = NULL((void*)0); |
| 33988 | BalaDataType* _tmp16_; |
| 33989 | BalaTypeSymbol* _tmp17_; |
| 33990 | BalaTypeSymbol* _tmp18_; |
| 33991 | gchar* _tmp19_ = NULL((void*)0); |
| 33992 | BalaObjectTypeSymbol* _tmp20_; |
| 33993 | gchar* sink_func = NULL((void*)0); |
| 33994 | gchar* _tmp24_; |
| 33995 | const gchar* _tmp25_; |
| 33996 | _tmp16_ = type; |
| 33997 | _tmp17_ = bala_data_type_get_type_symbol (_tmp16_); |
| 33998 | _tmp18_ = _tmp17_; |
| 33999 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, BALA_TYPE_OBJECT_TYPE_SYMBOL)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp18_); GType __t = ((bala_object_type_symbol_get_type ())) ; gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } ))) ? ((BalaObjectTypeSymbol*) _tmp18_) : NULL((void*)0); |
| 34000 | _tmp20_ = cl; |
| 34001 | if (_tmp20_ != NULL((void*)0)) { |
| 34002 | BalaObjectTypeSymbol* _tmp21_; |
| 34003 | gchar* _tmp22_; |
| 34004 | _tmp21_ = cl; |
| 34005 | _tmp22_ = bala_get_ccode_ref_sink_function (_tmp21_); |
| 34006 | _g_free0 (_tmp19_)(_tmp19_ = (g_free (_tmp19_), ((void*)0))); |
| 34007 | _tmp19_ = _tmp22_; |
| 34008 | } else { |
| 34009 | gchar* _tmp23_; |
| 34010 | _tmp23_ = g_strdup (""); |
| 34011 | _g_free0 (_tmp19_)(_tmp19_ = (g_free (_tmp19_), ((void*)0))); |
| 34012 | _tmp19_ = _tmp23_; |
| 34013 | } |
| 34014 | _tmp24_ = g_strdup (_tmp19_); |
| 34015 | sink_func = _tmp24_; |
| 34016 | _tmp25_ = sink_func; |
| 34017 | if (g_strcmp0 (_tmp25_, "") != 0) { |
| 34018 | BalaDataType* _tmp26_; |
| 34019 | gboolean _tmp27_; |
| 34020 | gboolean _tmp28_; |
| 34021 | BalaCCodeFunctionCall* csink = NULL((void*)0); |
| 34022 | const gchar* _tmp38_; |
| 34023 | BalaCCodeIdentifier* _tmp39_; |
| 34024 | BalaCCodeIdentifier* _tmp40_; |
| 34025 | BalaCCodeFunctionCall* _tmp41_; |
| 34026 | BalaCCodeFunctionCall* _tmp42_; |
| 34027 | BalaCCodeFunctionCall* _tmp43_; |
| 34028 | BalaGLibValue* _tmp44_; |
| 34029 | BalaCCodeExpression* _tmp45_; |
| 34030 | BalaCCodeFunction* _tmp46_; |
| 34031 | BalaCCodeFunction* _tmp47_; |
| 34032 | BalaCCodeFunctionCall* _tmp48_; |
| 34033 | BalaDataType* _tmp49_; |
| 34034 | gboolean _tmp50_; |
| 34035 | gboolean _tmp51_; |
| 34036 | _tmp26_ = type; |
| 34037 | _tmp27_ = bala_data_type_get_nullable (_tmp26_); |
| 34038 | _tmp28_ = _tmp27_; |
| 34039 | if (_tmp28_) { |
| 34040 | BalaCCodeBinaryExpression* is_not_null = NULL((void*)0); |
| 34041 | BalaGLibValue* _tmp29_; |
| 34042 | BalaCCodeExpression* _tmp30_; |
| 34043 | BalaCCodeConstant* _tmp31_; |
| 34044 | BalaCCodeConstant* _tmp32_; |
| 34045 | BalaCCodeBinaryExpression* _tmp33_; |
| 34046 | BalaCCodeBinaryExpression* _tmp34_; |
| 34047 | BalaCCodeFunction* _tmp35_; |
| 34048 | BalaCCodeFunction* _tmp36_; |
| 34049 | BalaCCodeBinaryExpression* _tmp37_; |
| 34050 | _tmp29_ = _result_; |
| 34051 | _tmp30_ = _tmp29_->cvalue; |
| 34052 | _tmp31_ = bala_ccode_constant_new ("NULL"); |
| 34053 | _tmp32_ = _tmp31_; |
| 34054 | _tmp33_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_INEQUALITY, _tmp30_, (BalaCCodeExpression*) _tmp32_); |
| 34055 | _tmp34_ = _tmp33_; |
| 34056 | _bala_ccode_node_unref0 (_tmp32_)((_tmp32_ == ((void*)0)) ? ((void*)0) : (_tmp32_ = (bala_ccode_node_unref (_tmp32_), ((void*)0)))); |
| 34057 | is_not_null = _tmp34_; |
| 34058 | _tmp35_ = bala_ccode_base_module_get_ccode (self); |
| 34059 | _tmp36_ = _tmp35_; |
| 34060 | _tmp37_ = is_not_null; |
| 34061 | bala_ccode_function_open_if (_tmp36_, (BalaCCodeExpression*) _tmp37_); |
| 34062 | _bala_ccode_node_unref0 (is_not_null)((is_not_null == ((void*)0)) ? ((void*)0) : (is_not_null = (bala_ccode_node_unref (is_not_null), ((void*)0)))); |
| 34063 | } |
| 34064 | _tmp38_ = sink_func; |
| 34065 | _tmp39_ = bala_ccode_identifier_new (_tmp38_); |
| 34066 | _tmp40_ = _tmp39_; |
| 34067 | _tmp41_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp40_); |
| 34068 | _tmp42_ = _tmp41_; |
| 34069 | _bala_ccode_node_unref0 (_tmp40_)((_tmp40_ == ((void*)0)) ? ((void*)0) : (_tmp40_ = (bala_ccode_node_unref (_tmp40_), ((void*)0)))); |
| 34070 | csink = _tmp42_; |
| 34071 | _tmp43_ = csink; |
| 34072 | _tmp44_ = _result_; |
| 34073 | _tmp45_ = _tmp44_->cvalue; |
| 34074 | bala_ccode_function_call_add_argument (_tmp43_, _tmp45_); |
| 34075 | _tmp46_ = bala_ccode_base_module_get_ccode (self); |
| 34076 | _tmp47_ = _tmp46_; |
| 34077 | _tmp48_ = csink; |
| 34078 | bala_ccode_function_add_expression (_tmp47_, (BalaCCodeExpression*) _tmp48_); |
| 34079 | _tmp49_ = type; |
| 34080 | _tmp50_ = bala_data_type_get_nullable (_tmp49_); |
| 34081 | _tmp51_ = _tmp50_; |
| 34082 | if (_tmp51_) { |
| 34083 | BalaCCodeFunction* _tmp52_; |
| 34084 | BalaCCodeFunction* _tmp53_; |
| 34085 | _tmp52_ = bala_ccode_base_module_get_ccode (self); |
| 34086 | _tmp53_ = _tmp52_; |
| 34087 | bala_ccode_function_close (_tmp53_); |
| 34088 | } |
| 34089 | _bala_ccode_node_unref0 (csink)((csink == ((void*)0)) ? ((void*)0) : (csink = (bala_ccode_node_unref (csink), ((void*)0)))); |
| 34090 | } else { |
| 34091 | BalaSourceReference* _tmp54_; |
| 34092 | BalaSourceReference* _tmp55_; |
| 34093 | BalaDataType* _tmp56_; |
| 34094 | BalaTypeSymbol* _tmp57_; |
| 34095 | BalaTypeSymbol* _tmp58_; |
| 34096 | const gchar* _tmp59_; |
| 34097 | const gchar* _tmp60_; |
| 34098 | gchar* _tmp61_; |
| 34099 | gchar* _tmp62_; |
| 34100 | _tmp54_ = bala_code_node_get_source_reference (node); |
| 34101 | _tmp55_ = _tmp54_; |
| 34102 | _tmp56_ = type; |
| 34103 | _tmp57_ = bala_data_type_get_type_symbol (_tmp56_); |
| 34104 | _tmp58_ = _tmp57_; |
| 34105 | _tmp59_ = bala_symbol_get_name ((BalaSymbol*) _tmp58_); |
| 34106 | _tmp60_ = _tmp59_; |
| 34107 | _tmp61_ = g_strdup_printf ("type `%s' does not support floating references", _tmp60_); |
| 34108 | _tmp62_ = _tmp61_; |
| 34109 | bala_report_error (_tmp55_, _tmp62_); |
| 34110 | _g_free0 (_tmp62_)(_tmp62_ = (g_free (_tmp62_), ((void*)0))); |
| 34111 | } |
| 34112 | _g_free0 (sink_func)(sink_func = (g_free (sink_func), ((void*)0))); |
| 34113 | _g_free0 (_tmp19_)(_tmp19_ = (g_free (_tmp19_), ((void*)0))); |
| 34114 | } |
| 34115 | _tmp66_ = type; |
| 34116 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp66_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp66_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 34117 | BalaDataType* _tmp67_; |
| 34118 | gboolean _tmp68_; |
| 34119 | gboolean _tmp69_; |
| 34120 | _tmp67_ = type; |
| 34121 | _tmp68_ = bala_data_type_get_nullable (_tmp67_); |
| 34122 | _tmp69_ = _tmp68_; |
| 34123 | _tmp65_ = !_tmp69_; |
| 34124 | } else { |
| 34125 | _tmp65_ = FALSE(0); |
| 34126 | } |
| 34127 | if (_tmp65_) { |
| 34128 | _tmp64_ = G_TYPE_CHECK_INSTANCE_TYPE (target_type, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( target_type); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 34129 | } else { |
| 34130 | _tmp64_ = FALSE(0); |
| 34131 | } |
| 34132 | if (_tmp64_) { |
| 34133 | gboolean _tmp70_; |
| 34134 | gboolean _tmp71_; |
| 34135 | _tmp70_ = bala_data_type_get_nullable (target_type); |
| 34136 | _tmp71_ = _tmp70_; |
| 34137 | _tmp63_ = _tmp71_; |
| 34138 | } else { |
| 34139 | _tmp63_ = FALSE(0); |
| 34140 | } |
| 34141 | boxing = _tmp63_; |
| 34142 | _tmp75_ = type; |
| 34143 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp75_, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp75_); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 34144 | BalaDataType* _tmp76_; |
| 34145 | gboolean _tmp77_; |
| 34146 | gboolean _tmp78_; |
| 34147 | _tmp76_ = type; |
| 34148 | _tmp77_ = bala_data_type_get_nullable (_tmp76_); |
| 34149 | _tmp78_ = _tmp77_; |
| 34150 | _tmp74_ = _tmp78_; |
| 34151 | } else { |
| 34152 | _tmp74_ = FALSE(0); |
| 34153 | } |
| 34154 | if (_tmp74_) { |
| 34155 | _tmp73_ = G_TYPE_CHECK_INSTANCE_TYPE (target_type, BALA_TYPE_VALUE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( target_type); GType __t = ((bala_value_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 34156 | } else { |
| 34157 | _tmp73_ = FALSE(0); |
| 34158 | } |
| 34159 | if (_tmp73_) { |
| 34160 | gboolean _tmp79_; |
| 34161 | gboolean _tmp80_; |
| 34162 | _tmp79_ = bala_data_type_get_nullable (target_type); |
| 34163 | _tmp80_ = _tmp79_; |
| 34164 | _tmp72_ = !_tmp80_; |
| 34165 | } else { |
| 34166 | _tmp72_ = FALSE(0); |
| 34167 | } |
| 34168 | unboxing = _tmp72_; |
| 34169 | _tmp85_ = self->priv->_context; |
| 34170 | _tmp86_ = bala_code_context_get_profile (_tmp85_); |
| 34171 | _tmp87_ = _tmp86_; |
| 34172 | if (_tmp87_ == BALA_PROFILE_GOBJECT) { |
| 34173 | _tmp84_ = target_type != NULL((void*)0); |
| 34174 | } else { |
| 34175 | _tmp84_ = FALSE(0); |
| 34176 | } |
| 34177 | if (_tmp84_) { |
| 34178 | BalaTypeSymbol* _tmp88_; |
| 34179 | BalaTypeSymbol* _tmp89_; |
| 34180 | BalaStruct* _tmp90_; |
| 34181 | _tmp88_ = bala_data_type_get_type_symbol (target_type); |
| 34182 | _tmp89_ = _tmp88_; |
| 34183 | _tmp90_ = self->gvalue_type; |
| 34184 | _tmp83_ = _tmp89_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp90_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp90_), ((bala_typesymbol_get_type ()))))); |
| 34185 | } else { |
| 34186 | _tmp83_ = FALSE(0); |
| 34187 | } |
| 34188 | if (_tmp83_) { |
| 34189 | BalaDataType* _tmp91_; |
| 34190 | _tmp91_ = type; |
| 34191 | _tmp82_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp91_, BALA_TYPE_NULL_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp91_); GType __t = ((bala_null_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 34192 | } else { |
| 34193 | _tmp82_ = FALSE(0); |
| 34194 | } |
| 34195 | if (_tmp82_) { |
| 34196 | BalaDataType* _tmp92_; |
| 34197 | gchar* _tmp93_; |
| 34198 | gchar* _tmp94_; |
| 34199 | _tmp92_ = type; |
| 34200 | _tmp93_ = bala_get_ccode_type_id ((BalaCodeNode*) _tmp92_); |
| 34201 | _tmp94_ = _tmp93_; |
| 34202 | _tmp81_ = g_strcmp0 (_tmp94_, "G_TYPE_VALUE") != 0; |
| 34203 | _g_free0 (_tmp94_)(_tmp94_ = (g_free (_tmp94_), ((void*)0))); |
| 34204 | } else { |
| 34205 | _tmp81_ = FALSE(0); |
| 34206 | } |
| 34207 | gvalue_boxing = _tmp81_; |
| 34208 | _tmp99_ = self->priv->_context; |
| 34209 | _tmp100_ = bala_code_context_get_profile (_tmp99_); |
| 34210 | _tmp101_ = _tmp100_; |
| 34211 | if (_tmp101_ == BALA_PROFILE_GOBJECT) { |
| 34212 | _tmp98_ = target_type != NULL((void*)0); |
| 34213 | } else { |
| 34214 | _tmp98_ = FALSE(0); |
| 34215 | } |
| 34216 | if (_tmp98_) { |
| 34217 | BalaTypeSymbol* _tmp102_; |
| 34218 | BalaTypeSymbol* _tmp103_; |
| 34219 | BalaClass* _tmp104_; |
| 34220 | _tmp102_ = bala_data_type_get_type_symbol (target_type); |
| 34221 | _tmp103_ = _tmp102_; |
| 34222 | _tmp104_ = self->gvariant_type; |
| 34223 | _tmp97_ = _tmp103_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp104_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp104_), ((bala_typesymbol_get_type ()))))); |
| 34224 | } else { |
| 34225 | _tmp97_ = FALSE(0); |
| 34226 | } |
| 34227 | if (_tmp97_) { |
| 34228 | BalaDataType* _tmp105_; |
| 34229 | _tmp105_ = type; |
| 34230 | _tmp96_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp105_, BALA_TYPE_NULL_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp105_); GType __t = ((bala_null_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 34231 | } else { |
| 34232 | _tmp96_ = FALSE(0); |
| 34233 | } |
| 34234 | if (_tmp96_) { |
| 34235 | BalaDataType* _tmp106_; |
| 34236 | BalaTypeSymbol* _tmp107_; |
| 34237 | BalaTypeSymbol* _tmp108_; |
| 34238 | BalaClass* _tmp109_; |
| 34239 | _tmp106_ = type; |
| 34240 | _tmp107_ = bala_data_type_get_type_symbol (_tmp106_); |
| 34241 | _tmp108_ = _tmp107_; |
| 34242 | _tmp109_ = self->gvariant_type; |
| 34243 | _tmp95_ = _tmp108_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp109_, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (_tmp109_), ((bala_typesymbol_get_type ()))))); |
| 34244 | } else { |
| 34245 | _tmp95_ = FALSE(0); |
| 34246 | } |
| 34247 | gvariant_boxing = _tmp95_; |
| 34248 | _tmp112_ = type; |
| 34249 | _tmp113_ = bala_data_type_get_value_owned (_tmp112_); |
| 34250 | _tmp114_ = _tmp113_; |
| 34251 | if (_tmp114_) { |
| 34252 | gboolean _tmp115_ = FALSE(0); |
| 34253 | gboolean _tmp116_ = FALSE(0); |
| 34254 | gboolean _tmp117_ = FALSE(0); |
| 34255 | gboolean _tmp118_ = FALSE(0); |
| 34256 | if (target_type == NULL((void*)0)) { |
| 34257 | _tmp118_ = TRUE(!(0)); |
| 34258 | } else { |
| 34259 | gboolean _tmp119_; |
| 34260 | gboolean _tmp120_; |
| 34261 | _tmp119_ = bala_data_type_get_value_owned (target_type); |
| 34262 | _tmp120_ = _tmp119_; |
| 34263 | _tmp118_ = !_tmp120_; |
| 34264 | } |
| 34265 | if (_tmp118_) { |
| 34266 | _tmp117_ = TRUE(!(0)); |
| 34267 | } else { |
| 34268 | _tmp117_ = boxing; |
| 34269 | } |
| 34270 | if (_tmp117_) { |
| 34271 | _tmp116_ = TRUE(!(0)); |
| 34272 | } else { |
| 34273 | _tmp116_ = unboxing; |
| 34274 | } |
| 34275 | if (_tmp116_) { |
| 34276 | _tmp115_ = TRUE(!(0)); |
| 34277 | } else { |
| 34278 | _tmp115_ = gvariant_boxing; |
| 34279 | } |
| 34280 | _tmp111_ = _tmp115_; |
| 34281 | } else { |
| 34282 | _tmp111_ = FALSE(0); |
| 34283 | } |
| 34284 | if (_tmp111_) { |
| 34285 | _tmp110_ = !gvalue_boxing; |
| 34286 | } else { |
| 34287 | _tmp110_ = FALSE(0); |
| 34288 | } |
| 34289 | if (_tmp110_) { |
| 34290 | if (G_TYPE_CHECK_INSTANCE_TYPE (target_type, BALA_TYPE_POINTER_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( target_type); GType __t = ((bala_pointer_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 34291 | } else { |
| 34292 | BalaDataType* _tmp121_; |
| 34293 | _tmp121_ = type; |
| 34294 | if (bala_ccode_base_module_requires_destroy (_tmp121_)) { |
| 34295 | BalaDataType* _tmp122_; |
| 34296 | _tmp122_ = type; |
| 34297 | if (!bala_ccode_base_module_is_lvalue_access_allowed (self, _tmp122_)) { |
| 34298 | BalaArrayList* _tmp123_; |
| 34299 | BalaArrayList* _tmp124_; |
| 34300 | BalaGLibValue* _tmp125_; |
| 34301 | BalaGLibValue* _tmp126_; |
| 34302 | BalaGLibValue* _tmp127_; |
| 34303 | _tmp123_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 34304 | _tmp124_ = _tmp123_; |
| 34305 | _tmp125_ = _result_; |
| 34306 | _tmp126_ = bala_glib_value_copy (_tmp125_); |
| 34307 | _tmp127_ = _tmp126_; |
| 34308 | bala_list_insert ((BalaList*) _tmp124_, 0, (BalaTargetValue*) _tmp127_); |
| 34309 | _bala_target_value_unref0 (_tmp127_)((_tmp127_ == ((void*)0)) ? ((void*)0) : (_tmp127_ = (bala_target_value_unref (_tmp127_), ((void*)0)))); |
| 34310 | } else { |
| 34311 | BalaTargetValue* temp_value = NULL((void*)0); |
| 34312 | BalaDataType* _tmp128_; |
| 34313 | BalaTargetValue* _tmp129_; |
| 34314 | BalaArrayList* _tmp130_; |
| 34315 | BalaArrayList* _tmp131_; |
| 34316 | BalaTargetValue* _tmp132_; |
| 34317 | BalaGLibValue* _tmp133_; |
| 34318 | BalaGLibValue* _tmp134_; |
| 34319 | BalaTargetValue* _tmp135_; |
| 34320 | BalaGLibValue* _tmp136_; |
| 34321 | BalaSourceReference* _tmp137_; |
| 34322 | BalaSourceReference* _tmp138_; |
| 34323 | BalaGLibValue* _tmp139_; |
| 34324 | BalaTargetValue* _tmp140_; |
| 34325 | BalaCCodeExpression* _tmp141_; |
| 34326 | BalaCCodeExpression* _tmp142_; |
| 34327 | _tmp128_ = type; |
| 34328 | _tmp129_ = bala_ccode_base_module_create_temp_value (self, _tmp128_, FALSE(0), node, NULL((void*)0)); |
| 34329 | temp_value = _tmp129_; |
| 34330 | _tmp130_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 34331 | _tmp131_ = _tmp130_; |
| 34332 | _tmp132_ = temp_value; |
| 34333 | _tmp133_ = bala_glib_value_copy (G_TYPE_CHECK_INSTANCE_CAST (_tmp132_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp132_), ((bala_glib_value_get_type ())))))); |
| 34334 | _tmp134_ = _tmp133_; |
| 34335 | bala_list_insert ((BalaList*) _tmp131_, 0, (BalaTargetValue*) _tmp134_); |
| 34336 | _bala_target_value_unref0 (_tmp134_)((_tmp134_ == ((void*)0)) ? ((void*)0) : (_tmp134_ = (bala_target_value_unref (_tmp134_), ((void*)0)))); |
| 34337 | _tmp135_ = temp_value; |
| 34338 | _tmp136_ = _result_; |
| 34339 | _tmp137_ = bala_code_node_get_source_reference (node); |
| 34340 | _tmp138_ = _tmp137_; |
| 34341 | bala_ccode_base_module_store_value (self, _tmp135_, (BalaTargetValue*) _tmp136_, _tmp138_); |
| 34342 | _tmp139_ = _result_; |
| 34343 | _tmp140_ = temp_value; |
| 34344 | _tmp141_ = bala_get_cvalue_ (_tmp140_); |
| 34345 | _tmp142_ = _bala_ccode_node_ref0 (_tmp141_); |
| 34346 | _bala_ccode_node_unref0 (_tmp139_->cvalue)((_tmp139_->cvalue == ((void*)0)) ? ((void*)0) : (_tmp139_ ->cvalue = (bala_ccode_node_unref (_tmp139_->cvalue), ( (void*)0)))); |
| 34347 | _tmp139_->cvalue = _tmp142_; |
| 34348 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 34349 | } |
| 34350 | } |
| 34351 | } |
| 34352 | } |
| 34353 | if (target_type == NULL((void*)0)) { |
| 34354 | result = (BalaTargetValue*) _result_; |
| 34355 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 34356 | return result; |
| 34357 | } |
| 34358 | _tmp143_ = _result_; |
| 34359 | _tmp144_ = bala_data_type_copy (target_type); |
| 34360 | _tmp145_ = _tmp144_; |
| 34361 | bala_target_value_set_value_type ((BalaTargetValue*) _tmp143_, _tmp145_); |
| 34362 | _bala_code_node_unref0 (_tmp145_)((_tmp145_ == ((void*)0)) ? ((void*)0) : (_tmp145_ = (bala_code_node_unref (_tmp145_), ((void*)0)))); |
| 34363 | if (gvalue_boxing) { |
| 34364 | BalaTargetValue* temp_value = NULL((void*)0); |
| 34365 | gboolean _tmp146_; |
| 34366 | BalaTargetValue* _tmp147_; |
| 34367 | gboolean _tmp148_; |
| 34368 | gboolean _tmp149_; |
| 34369 | gboolean _tmp155_; |
| 34370 | gboolean _tmp156_; |
| 34371 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 34372 | BalaCCodeIdentifier* _tmp174_; |
| 34373 | BalaCCodeIdentifier* _tmp175_; |
| 34374 | BalaCCodeFunctionCall* _tmp176_; |
| 34375 | BalaCCodeFunctionCall* _tmp177_; |
| 34376 | gboolean _tmp178_; |
| 34377 | gboolean _tmp179_; |
| 34378 | gchar* type_id = NULL((void*)0); |
| 34379 | BalaDataType* _tmp188_; |
| 34380 | gchar* _tmp189_; |
| 34381 | const gchar* _tmp190_; |
| 34382 | BalaCCodeFunctionCall* _tmp198_; |
| 34383 | const gchar* _tmp199_; |
| 34384 | BalaCCodeIdentifier* _tmp200_; |
| 34385 | BalaCCodeIdentifier* _tmp201_; |
| 34386 | BalaCCodeFunction* _tmp202_; |
| 34387 | BalaCCodeFunction* _tmp203_; |
| 34388 | BalaCCodeFunctionCall* _tmp204_; |
| 34389 | BalaDataType* _tmp205_; |
| 34390 | gboolean _tmp214_; |
| 34391 | gboolean _tmp215_; |
| 34392 | BalaDataType* _tmp224_; |
| 34393 | BalaCCodeFunction* _tmp233_; |
| 34394 | BalaCCodeFunction* _tmp234_; |
| 34395 | BalaCCodeFunctionCall* _tmp235_; |
| 34396 | BalaTargetValue* _tmp236_; |
| 34397 | BalaGLibValue* _tmp237_; |
| 34398 | _tmp146_ = TRUE(!(0)); |
| 34399 | _tmp147_ = bala_ccode_base_module_create_temp_value (self, target_type, TRUE(!(0)), node, &_tmp146_); |
| 34400 | temp_value = _tmp147_; |
| 34401 | _tmp148_ = bala_data_type_get_value_owned (target_type); |
| 34402 | _tmp149_ = _tmp148_; |
| 34403 | if (!_tmp149_) { |
| 34404 | BalaArrayList* _tmp150_; |
| 34405 | BalaArrayList* _tmp151_; |
| 34406 | BalaTargetValue* _tmp152_; |
| 34407 | BalaGLibValue* _tmp153_; |
| 34408 | BalaGLibValue* _tmp154_; |
| 34409 | _tmp150_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 34410 | _tmp151_ = _tmp150_; |
| 34411 | _tmp152_ = temp_value; |
| 34412 | _tmp153_ = bala_glib_value_copy (G_TYPE_CHECK_INSTANCE_CAST (_tmp152_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp152_), ((bala_glib_value_get_type ())))))); |
| 34413 | _tmp154_ = _tmp153_; |
| 34414 | bala_list_insert ((BalaList*) _tmp151_, 0, (BalaTargetValue*) _tmp154_); |
| 34415 | _bala_target_value_unref0 (_tmp154_)((_tmp154_ == ((void*)0)) ? ((void*)0) : (_tmp154_ = (bala_target_value_unref (_tmp154_), ((void*)0)))); |
| 34416 | } |
| 34417 | _tmp155_ = bala_data_type_get_nullable (target_type); |
| 34418 | _tmp156_ = _tmp155_; |
| 34419 | if (_tmp156_) { |
| 34420 | BalaCCodeFunctionCall* newcall = NULL((void*)0); |
| 34421 | BalaCCodeIdentifier* _tmp157_; |
| 34422 | BalaCCodeIdentifier* _tmp158_; |
| 34423 | BalaCCodeFunctionCall* _tmp159_; |
| 34424 | BalaCCodeFunctionCall* _tmp160_; |
| 34425 | BalaCCodeFunctionCall* _tmp161_; |
| 34426 | BalaCCodeConstant* _tmp162_; |
| 34427 | BalaCCodeConstant* _tmp163_; |
| 34428 | BalaCCodeFunctionCall* _tmp164_; |
| 34429 | BalaCCodeConstant* _tmp165_; |
| 34430 | BalaCCodeConstant* _tmp166_; |
| 34431 | BalaCCodeAssignment* newassignment = NULL((void*)0); |
| 34432 | BalaTargetValue* _tmp167_; |
| 34433 | BalaCCodeExpression* _tmp168_; |
| 34434 | BalaCCodeFunctionCall* _tmp169_; |
| 34435 | BalaCCodeAssignment* _tmp170_; |
| 34436 | BalaCCodeFunction* _tmp171_; |
| 34437 | BalaCCodeFunction* _tmp172_; |
| 34438 | BalaCCodeAssignment* _tmp173_; |
| 34439 | _tmp157_ = bala_ccode_identifier_new ("g_new0"); |
| 34440 | _tmp158_ = _tmp157_; |
| 34441 | _tmp159_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp158_); |
| 34442 | _tmp160_ = _tmp159_; |
| 34443 | _bala_ccode_node_unref0 (_tmp158_)((_tmp158_ == ((void*)0)) ? ((void*)0) : (_tmp158_ = (bala_ccode_node_unref (_tmp158_), ((void*)0)))); |
| 34444 | newcall = _tmp160_; |
| 34445 | _tmp161_ = newcall; |
| 34446 | _tmp162_ = bala_ccode_constant_new ("GValue"); |
| 34447 | _tmp163_ = _tmp162_; |
| 34448 | bala_ccode_function_call_add_argument (_tmp161_, (BalaCCodeExpression*) _tmp163_); |
| 34449 | _bala_ccode_node_unref0 (_tmp163_)((_tmp163_ == ((void*)0)) ? ((void*)0) : (_tmp163_ = (bala_ccode_node_unref (_tmp163_), ((void*)0)))); |
| 34450 | _tmp164_ = newcall; |
| 34451 | _tmp165_ = bala_ccode_constant_new ("1"); |
| 34452 | _tmp166_ = _tmp165_; |
| 34453 | bala_ccode_function_call_add_argument (_tmp164_, (BalaCCodeExpression*) _tmp166_); |
| 34454 | _bala_ccode_node_unref0 (_tmp166_)((_tmp166_ == ((void*)0)) ? ((void*)0) : (_tmp166_ = (bala_ccode_node_unref (_tmp166_), ((void*)0)))); |
| 34455 | _tmp167_ = temp_value; |
| 34456 | _tmp168_ = bala_get_cvalue_ (_tmp167_); |
| 34457 | _tmp169_ = newcall; |
| 34458 | _tmp170_ = bala_ccode_assignment_new (_tmp168_, (BalaCCodeExpression*) _tmp169_, BALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE); |
| 34459 | newassignment = _tmp170_; |
| 34460 | _tmp171_ = bala_ccode_base_module_get_ccode (self); |
| 34461 | _tmp172_ = _tmp171_; |
| 34462 | _tmp173_ = newassignment; |
| 34463 | bala_ccode_function_add_expression (_tmp172_, (BalaCCodeExpression*) _tmp173_); |
| 34464 | _bala_ccode_node_unref0 (newassignment)((newassignment == ((void*)0)) ? ((void*)0) : (newassignment = (bala_ccode_node_unref (newassignment), ((void*)0)))); |
| 34465 | _bala_ccode_node_unref0 (newcall)((newcall == ((void*)0)) ? ((void*)0) : (newcall = (bala_ccode_node_unref (newcall), ((void*)0)))); |
| 34466 | } |
| 34467 | _tmp174_ = bala_ccode_identifier_new ("g_value_init"); |
| 34468 | _tmp175_ = _tmp174_; |
| 34469 | _tmp176_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp175_); |
| 34470 | _tmp177_ = _tmp176_; |
| 34471 | _bala_ccode_node_unref0 (_tmp175_)((_tmp175_ == ((void*)0)) ? ((void*)0) : (_tmp175_ = (bala_ccode_node_unref (_tmp175_), ((void*)0)))); |
| 34472 | ccall = _tmp177_; |
| 34473 | _tmp178_ = bala_data_type_get_nullable (target_type); |
| 34474 | _tmp179_ = _tmp178_; |
| 34475 | if (_tmp179_) { |
| 34476 | BalaCCodeFunctionCall* _tmp180_; |
| 34477 | BalaTargetValue* _tmp181_; |
| 34478 | BalaCCodeExpression* _tmp182_; |
| 34479 | _tmp180_ = ccall; |
| 34480 | _tmp181_ = temp_value; |
| 34481 | _tmp182_ = bala_get_cvalue_ (_tmp181_); |
| 34482 | bala_ccode_function_call_add_argument (_tmp180_, _tmp182_); |
| 34483 | } else { |
| 34484 | BalaCCodeFunctionCall* _tmp183_; |
| 34485 | BalaTargetValue* _tmp184_; |
| 34486 | BalaCCodeExpression* _tmp185_; |
| 34487 | BalaCCodeUnaryExpression* _tmp186_; |
| 34488 | BalaCCodeUnaryExpression* _tmp187_; |
| 34489 | _tmp183_ = ccall; |
| 34490 | _tmp184_ = temp_value; |
| 34491 | _tmp185_ = bala_get_cvalue_ (_tmp184_); |
| 34492 | _tmp186_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp185_); |
| 34493 | _tmp187_ = _tmp186_; |
| 34494 | bala_ccode_function_call_add_argument (_tmp183_, (BalaCCodeExpression*) _tmp187_); |
| 34495 | _bala_ccode_node_unref0 (_tmp187_)((_tmp187_ == ((void*)0)) ? ((void*)0) : (_tmp187_ = (bala_ccode_node_unref (_tmp187_), ((void*)0)))); |
| 34496 | } |
| 34497 | _tmp188_ = type; |
| 34498 | _tmp189_ = bala_get_ccode_type_id ((BalaCodeNode*) _tmp188_); |
| 34499 | type_id = _tmp189_; |
| 34500 | _tmp190_ = type_id; |
| 34501 | if (g_strcmp0 (_tmp190_, "") == 0) { |
| 34502 | BalaSourceReference* _tmp191_; |
| 34503 | BalaSourceReference* _tmp192_; |
| 34504 | BalaDataType* _tmp193_; |
| 34505 | gchar* _tmp194_; |
| 34506 | gchar* _tmp195_; |
| 34507 | gchar* _tmp196_; |
| 34508 | gchar* _tmp197_; |
| 34509 | _tmp191_ = bala_code_node_get_source_reference (node); |
| 34510 | _tmp192_ = _tmp191_; |
| 34511 | _tmp193_ = type; |
| 34512 | _tmp194_ = bala_code_node_to_string ((BalaCodeNode*) _tmp193_); |
| 34513 | _tmp195_ = _tmp194_; |
| 34514 | _tmp196_ = g_strdup_printf ("GValue boxing of type `%s' is not supported", _tmp195_); |
| 34515 | _tmp197_ = _tmp196_; |
| 34516 | bala_report_error (_tmp192_, _tmp197_); |
| 34517 | _g_free0 (_tmp197_)(_tmp197_ = (g_free (_tmp197_), ((void*)0))); |
| 34518 | _g_free0 (_tmp195_)(_tmp195_ = (g_free (_tmp195_), ((void*)0))); |
| 34519 | } |
| 34520 | _tmp198_ = ccall; |
| 34521 | _tmp199_ = type_id; |
| 34522 | _tmp200_ = bala_ccode_identifier_new (_tmp199_); |
| 34523 | _tmp201_ = _tmp200_; |
| 34524 | bala_ccode_function_call_add_argument (_tmp198_, (BalaCCodeExpression*) _tmp201_); |
| 34525 | _bala_ccode_node_unref0 (_tmp201_)((_tmp201_ == ((void*)0)) ? ((void*)0) : (_tmp201_ = (bala_ccode_node_unref (_tmp201_), ((void*)0)))); |
| 34526 | _tmp202_ = bala_ccode_base_module_get_ccode (self); |
| 34527 | _tmp203_ = _tmp202_; |
| 34528 | _tmp204_ = ccall; |
| 34529 | bala_ccode_function_add_expression (_tmp203_, (BalaCCodeExpression*) _tmp204_); |
| 34530 | _tmp205_ = type; |
| 34531 | if (bala_ccode_base_module_requires_destroy (_tmp205_)) { |
| 34532 | BalaDataType* _tmp206_; |
| 34533 | BalaCCodeExpression* _tmp207_; |
| 34534 | BalaCCodeExpression* _tmp208_; |
| 34535 | BalaCCodeFunctionCall* _tmp209_; |
| 34536 | _tmp206_ = type; |
| 34537 | _tmp207_ = bala_ccode_base_module_get_value_taker_function (self, _tmp206_); |
| 34538 | _tmp208_ = _tmp207_; |
| 34539 | _tmp209_ = bala_ccode_function_call_new (_tmp208_); |
| 34540 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 34541 | ccall = _tmp209_; |
| 34542 | _bala_ccode_node_unref0 (_tmp208_)((_tmp208_ == ((void*)0)) ? ((void*)0) : (_tmp208_ = (bala_ccode_node_unref (_tmp208_), ((void*)0)))); |
| 34543 | } else { |
| 34544 | BalaDataType* _tmp210_; |
| 34545 | BalaCCodeExpression* _tmp211_; |
| 34546 | BalaCCodeExpression* _tmp212_; |
| 34547 | BalaCCodeFunctionCall* _tmp213_; |
| 34548 | _tmp210_ = type; |
| 34549 | _tmp211_ = bala_ccode_base_module_get_value_setter_function (self, _tmp210_); |
| 34550 | _tmp212_ = _tmp211_; |
| 34551 | _tmp213_ = bala_ccode_function_call_new (_tmp212_); |
| 34552 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 34553 | ccall = _tmp213_; |
| 34554 | _bala_ccode_node_unref0 (_tmp212_)((_tmp212_ == ((void*)0)) ? ((void*)0) : (_tmp212_ = (bala_ccode_node_unref (_tmp212_), ((void*)0)))); |
| 34555 | } |
| 34556 | _tmp214_ = bala_data_type_get_nullable (target_type); |
| 34557 | _tmp215_ = _tmp214_; |
| 34558 | if (_tmp215_) { |
| 34559 | BalaCCodeFunctionCall* _tmp216_; |
| 34560 | BalaTargetValue* _tmp217_; |
| 34561 | BalaCCodeExpression* _tmp218_; |
| 34562 | _tmp216_ = ccall; |
| 34563 | _tmp217_ = temp_value; |
| 34564 | _tmp218_ = bala_get_cvalue_ (_tmp217_); |
| 34565 | bala_ccode_function_call_add_argument (_tmp216_, _tmp218_); |
| 34566 | } else { |
| 34567 | BalaCCodeFunctionCall* _tmp219_; |
| 34568 | BalaTargetValue* _tmp220_; |
| 34569 | BalaCCodeExpression* _tmp221_; |
| 34570 | BalaCCodeUnaryExpression* _tmp222_; |
| 34571 | BalaCCodeUnaryExpression* _tmp223_; |
| 34572 | _tmp219_ = ccall; |
| 34573 | _tmp220_ = temp_value; |
| 34574 | _tmp221_ = bala_get_cvalue_ (_tmp220_); |
| 34575 | _tmp222_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp221_); |
| 34576 | _tmp223_ = _tmp222_; |
| 34577 | bala_ccode_function_call_add_argument (_tmp219_, (BalaCCodeExpression*) _tmp223_); |
| 34578 | _bala_ccode_node_unref0 (_tmp223_)((_tmp223_ == ((void*)0)) ? ((void*)0) : (_tmp223_ = (bala_ccode_node_unref (_tmp223_), ((void*)0)))); |
| 34579 | } |
| 34580 | _tmp224_ = type; |
| 34581 | if (bala_data_type_is_real_non_null_struct_type (_tmp224_)) { |
| 34582 | BalaCCodeFunctionCall* _tmp225_; |
| 34583 | BalaGLibValue* _tmp226_; |
| 34584 | BalaCCodeExpression* _tmp227_; |
| 34585 | BalaCCodeUnaryExpression* _tmp228_; |
| 34586 | BalaCCodeUnaryExpression* _tmp229_; |
| 34587 | _tmp225_ = ccall; |
| 34588 | _tmp226_ = _result_; |
| 34589 | _tmp227_ = _tmp226_->cvalue; |
| 34590 | _tmp228_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp227_); |
| 34591 | _tmp229_ = _tmp228_; |
| 34592 | bala_ccode_function_call_add_argument (_tmp225_, (BalaCCodeExpression*) _tmp229_); |
| 34593 | _bala_ccode_node_unref0 (_tmp229_)((_tmp229_ == ((void*)0)) ? ((void*)0) : (_tmp229_ = (bala_ccode_node_unref (_tmp229_), ((void*)0)))); |
| 34594 | } else { |
| 34595 | BalaCCodeFunctionCall* _tmp230_; |
| 34596 | BalaGLibValue* _tmp231_; |
| 34597 | BalaCCodeExpression* _tmp232_; |
| 34598 | _tmp230_ = ccall; |
| 34599 | _tmp231_ = _result_; |
| 34600 | _tmp232_ = _tmp231_->cvalue; |
| 34601 | bala_ccode_function_call_add_argument (_tmp230_, _tmp232_); |
| 34602 | } |
| 34603 | _tmp233_ = bala_ccode_base_module_get_ccode (self); |
| 34604 | _tmp234_ = _tmp233_; |
| 34605 | _tmp235_ = ccall; |
| 34606 | bala_ccode_function_add_expression (_tmp234_, (BalaCCodeExpression*) _tmp235_); |
| 34607 | _tmp236_ = temp_value; |
| 34608 | _tmp237_ = _bala_target_value_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp236_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp236_), ((bala_glib_value_get_type ())))))); |
| 34609 | _bala_target_value_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_target_value_unref (_result_), ((void*)0)))); |
| 34610 | _result_ = _tmp237_; |
| 34611 | _g_free0 (type_id)(type_id = (g_free (type_id), ((void*)0))); |
| 34612 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 34613 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 34614 | } else { |
| 34615 | if (gvariant_boxing) { |
| 34616 | gchar* variant_func = NULL((void*)0); |
| 34617 | gint _tmp238_; |
| 34618 | gchar* _tmp239_; |
| 34619 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 34620 | const gchar* _tmp240_; |
| 34621 | BalaCCodeIdentifier* _tmp241_; |
| 34622 | BalaCCodeIdentifier* _tmp242_; |
| 34623 | BalaCCodeFunctionCall* _tmp243_; |
| 34624 | BalaCCodeFunctionCall* _tmp244_; |
| 34625 | BalaCCodeFunctionCall* _tmp245_; |
| 34626 | BalaGLibValue* _tmp246_; |
| 34627 | BalaCCodeExpression* _tmp247_; |
| 34628 | BalaCCodeFunction* cfunc = NULL((void*)0); |
| 34629 | const gchar* _tmp248_; |
| 34630 | BalaCCodeFunction* _tmp249_; |
| 34631 | BalaCCodeFunction* _tmp250_; |
| 34632 | BalaCCodeFunction* _tmp251_; |
| 34633 | BalaDataType* _tmp252_; |
| 34634 | gchar* _tmp253_; |
| 34635 | gchar* _tmp254_; |
| 34636 | BalaCCodeParameter* _tmp255_; |
| 34637 | BalaCCodeParameter* _tmp256_; |
| 34638 | BalaDataType* _tmp257_; |
| 34639 | BalaCCodeFunction* _tmp276_; |
| 34640 | BalaCCodeFunctionCall* sink = NULL((void*)0); |
| 34641 | BalaCCodeIdentifier* _tmp277_; |
| 34642 | BalaCCodeIdentifier* _tmp278_; |
| 34643 | BalaCCodeFunctionCall* _tmp279_; |
| 34644 | BalaCCodeFunctionCall* _tmp280_; |
| 34645 | BalaCCodeFunctionCall* _tmp281_; |
| 34646 | BalaDataType* _tmp282_; |
| 34647 | BalaCCodeIdentifier* _tmp283_; |
| 34648 | BalaCCodeIdentifier* _tmp284_; |
| 34649 | BalaCCodeExpression* _tmp285_; |
| 34650 | BalaCCodeExpression* _tmp286_; |
| 34651 | BalaCCodeFunction* _tmp287_; |
| 34652 | BalaCCodeFunction* _tmp288_; |
| 34653 | BalaCCodeFunctionCall* _tmp289_; |
| 34654 | BalaCCodeFile* _tmp290_; |
| 34655 | BalaCCodeFunction* _tmp291_; |
| 34656 | BalaCCodeFile* _tmp292_; |
| 34657 | BalaCCodeFunction* _tmp293_; |
| 34658 | BalaGLibValue* _tmp294_; |
| 34659 | BalaCCodeFunctionCall* _tmp295_; |
| 34660 | BalaCCodeExpression* _tmp296_; |
| 34661 | BalaGLibValue* _tmp297_; |
| 34662 | BalaDataType* _tmp298_; |
| 34663 | BalaDataType* _tmp299_; |
| 34664 | BalaGLibValue* _tmp300_; |
| 34665 | BalaTargetValue* _tmp301_; |
| 34666 | gboolean _tmp302_; |
| 34667 | gboolean _tmp303_; |
| 34668 | self->priv->next_variant_function_id = self->priv->next_variant_function_id + 1; |
| 34669 | _tmp238_ = self->priv->next_variant_function_id; |
| 34670 | _tmp239_ = g_strdup_printf ("_variant_new%d", _tmp238_); |
| 34671 | variant_func = _tmp239_; |
| 34672 | _tmp240_ = variant_func; |
| 34673 | _tmp241_ = bala_ccode_identifier_new (_tmp240_); |
| 34674 | _tmp242_ = _tmp241_; |
| 34675 | _tmp243_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp242_); |
| 34676 | _tmp244_ = _tmp243_; |
| 34677 | _bala_ccode_node_unref0 (_tmp242_)((_tmp242_ == ((void*)0)) ? ((void*)0) : (_tmp242_ = (bala_ccode_node_unref (_tmp242_), ((void*)0)))); |
| 34678 | ccall = _tmp244_; |
| 34679 | _tmp245_ = ccall; |
| 34680 | _tmp246_ = _result_; |
| 34681 | _tmp247_ = _tmp246_->cvalue; |
| 34682 | bala_ccode_function_call_add_argument (_tmp245_, _tmp247_); |
| 34683 | _tmp248_ = variant_func; |
| 34684 | _tmp249_ = bala_ccode_function_new (_tmp248_, "GVariant*"); |
| 34685 | cfunc = _tmp249_; |
| 34686 | _tmp250_ = cfunc; |
| 34687 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp250_, BALA_CCODE_MODIFIERS_STATIC); |
| 34688 | _tmp251_ = cfunc; |
| 34689 | _tmp252_ = type; |
| 34690 | _tmp253_ = bala_get_ccode_name ((BalaCodeNode*) _tmp252_); |
| 34691 | _tmp254_ = _tmp253_; |
| 34692 | _tmp255_ = bala_ccode_parameter_new ("value", _tmp254_); |
| 34693 | _tmp256_ = _tmp255_; |
| 34694 | bala_ccode_function_add_parameter (_tmp251_, _tmp256_); |
| 34695 | _bala_ccode_node_unref0 (_tmp256_)((_tmp256_ == ((void*)0)) ? ((void*)0) : (_tmp256_ = (bala_ccode_node_unref (_tmp256_), ((void*)0)))); |
| 34696 | _g_free0 (_tmp254_)(_tmp254_ = (g_free (_tmp254_), ((void*)0))); |
| 34697 | _tmp257_ = type; |
| 34698 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp257_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp257_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 34699 | BalaArrayType* array_type = NULL((void*)0); |
| 34700 | BalaDataType* _tmp258_; |
| 34701 | BalaArrayType* _tmp259_; |
| 34702 | gchar* length_ctype = NULL((void*)0); |
| 34703 | BalaArrayType* _tmp260_; |
| 34704 | gchar* _tmp261_; |
| 34705 | _tmp258_ = type; |
| 34706 | _tmp259_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp258_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp258_), ((bala_array_type_get_type ())))))); |
| 34707 | array_type = _tmp259_; |
| 34708 | _tmp260_ = array_type; |
| 34709 | _tmp261_ = bala_get_ccode_array_length_type ((BalaCodeNode*) _tmp260_); |
| 34710 | length_ctype = _tmp261_; |
| 34711 | { |
| 34712 | gint dim = 0; |
| 34713 | dim = 1; |
| 34714 | { |
| 34715 | gboolean _tmp262_ = FALSE(0); |
| 34716 | _tmp262_ = TRUE(!(0)); |
| 34717 | while (TRUE(!(0))) { |
| 34718 | BalaArrayType* _tmp264_; |
| 34719 | gint _tmp265_; |
| 34720 | gint _tmp266_; |
| 34721 | BalaCCodeFunctionCall* _tmp267_; |
| 34722 | BalaCCodeExpression* _tmp268_; |
| 34723 | BalaCCodeExpression* _tmp269_; |
| 34724 | BalaCCodeFunction* _tmp270_; |
| 34725 | gchar* _tmp271_; |
| 34726 | gchar* _tmp272_; |
| 34727 | const gchar* _tmp273_; |
| 34728 | BalaCCodeParameter* _tmp274_; |
| 34729 | BalaCCodeParameter* _tmp275_; |
| 34730 | if (!_tmp262_) { |
| 34731 | gint _tmp263_; |
| 34732 | _tmp263_ = dim; |
| 34733 | dim = _tmp263_ + 1; |
| 34734 | } |
| 34735 | _tmp262_ = FALSE(0); |
| 34736 | _tmp264_ = array_type; |
| 34737 | _tmp265_ = bala_array_type_get_rank (_tmp264_); |
| 34738 | _tmp266_ = _tmp265_; |
| 34739 | if (!(dim <= _tmp266_)) { |
| 34740 | break; |
| 34741 | } |
| 34742 | _tmp267_ = ccall; |
| 34743 | _tmp268_ = bala_ccode_base_module_get_array_length_cvalue (self, value, dim); |
| 34744 | _tmp269_ = _tmp268_; |
| 34745 | bala_ccode_function_call_add_argument (_tmp267_, _tmp269_); |
| 34746 | _bala_ccode_node_unref0 (_tmp269_)((_tmp269_ == ((void*)0)) ? ((void*)0) : (_tmp269_ = (bala_ccode_node_unref (_tmp269_), ((void*)0)))); |
| 34747 | _tmp270_ = cfunc; |
| 34748 | _tmp271_ = bala_ccode_base_module_get_array_length_cname (self, "value", dim); |
| 34749 | _tmp272_ = _tmp271_; |
| 34750 | _tmp273_ = length_ctype; |
| 34751 | _tmp274_ = bala_ccode_parameter_new (_tmp272_, _tmp273_); |
| 34752 | _tmp275_ = _tmp274_; |
| 34753 | bala_ccode_function_add_parameter (_tmp270_, _tmp275_); |
| 34754 | _bala_ccode_node_unref0 (_tmp275_)((_tmp275_ == ((void*)0)) ? ((void*)0) : (_tmp275_ = (bala_ccode_node_unref (_tmp275_), ((void*)0)))); |
| 34755 | _g_free0 (_tmp272_)(_tmp272_ = (g_free (_tmp272_), ((void*)0))); |
| 34756 | } |
| 34757 | } |
| 34758 | } |
| 34759 | _g_free0 (length_ctype)(length_ctype = (g_free (length_ctype), ((void*)0))); |
| 34760 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 34761 | } |
| 34762 | _tmp276_ = cfunc; |
| 34763 | bala_ccode_base_module_push_function (self, _tmp276_); |
| 34764 | _tmp277_ = bala_ccode_identifier_new ("g_variant_ref_sink"); |
| 34765 | _tmp278_ = _tmp277_; |
| 34766 | _tmp279_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp278_); |
| 34767 | _tmp280_ = _tmp279_; |
| 34768 | _bala_ccode_node_unref0 (_tmp278_)((_tmp278_ == ((void*)0)) ? ((void*)0) : (_tmp278_ = (bala_ccode_node_unref (_tmp278_), ((void*)0)))); |
| 34769 | sink = _tmp280_; |
| 34770 | _tmp281_ = sink; |
| 34771 | _tmp282_ = type; |
| 34772 | _tmp283_ = bala_ccode_identifier_new ("value"); |
| 34773 | _tmp284_ = _tmp283_; |
| 34774 | _tmp285_ = bala_ccode_base_module_serialize_expression (self, _tmp282_, (BalaCCodeExpression*) _tmp284_); |
| 34775 | _tmp286_ = _tmp285_; |
| 34776 | bala_ccode_function_call_add_argument (_tmp281_, _tmp286_); |
| 34777 | _bala_ccode_node_unref0 (_tmp286_)((_tmp286_ == ((void*)0)) ? ((void*)0) : (_tmp286_ = (bala_ccode_node_unref (_tmp286_), ((void*)0)))); |
| 34778 | _bala_ccode_node_unref0 (_tmp284_)((_tmp284_ == ((void*)0)) ? ((void*)0) : (_tmp284_ = (bala_ccode_node_unref (_tmp284_), ((void*)0)))); |
| 34779 | _tmp287_ = bala_ccode_base_module_get_ccode (self); |
| 34780 | _tmp288_ = _tmp287_; |
| 34781 | _tmp289_ = sink; |
| 34782 | bala_ccode_function_add_return (_tmp288_, (BalaCCodeExpression*) _tmp289_); |
| 34783 | bala_ccode_base_module_pop_function (self); |
| 34784 | _tmp290_ = self->cfile; |
| 34785 | _tmp291_ = cfunc; |
| 34786 | bala_ccode_file_add_function_declaration (_tmp290_, _tmp291_); |
| 34787 | _tmp292_ = self->cfile; |
| 34788 | _tmp293_ = cfunc; |
| 34789 | bala_ccode_file_add_function (_tmp292_, _tmp293_); |
| 34790 | _tmp294_ = _result_; |
| 34791 | _tmp295_ = ccall; |
| 34792 | _tmp296_ = _bala_ccode_node_ref0 ((BalaCCodeExpression*) _tmp295_); |
| 34793 | _bala_ccode_node_unref0 (_tmp294_->cvalue)((_tmp294_->cvalue == ((void*)0)) ? ((void*)0) : (_tmp294_ ->cvalue = (bala_ccode_node_unref (_tmp294_->cvalue), ( (void*)0)))); |
| 34794 | _tmp294_->cvalue = _tmp296_; |
| 34795 | _tmp297_ = _result_; |
| 34796 | _tmp298_ = bala_target_value_get_value_type ((BalaTargetValue*) _tmp297_); |
| 34797 | _tmp299_ = _tmp298_; |
| 34798 | bala_data_type_set_value_owned (_tmp299_, TRUE(!(0))); |
| 34799 | _tmp300_ = _result_; |
| 34800 | _tmp301_ = bala_ccode_base_module_store_temp_value (self, (BalaTargetValue*) _tmp300_, node, NULL((void*)0)); |
| 34801 | _bala_target_value_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_target_value_unref (_result_), ((void*)0)))); |
| 34802 | _result_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp301_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp301_), ((bala_glib_value_get_type ()))))); |
| 34803 | _tmp302_ = bala_data_type_get_value_owned (target_type); |
| 34804 | _tmp303_ = _tmp302_; |
| 34805 | if (!_tmp303_) { |
| 34806 | BalaArrayList* _tmp304_; |
| 34807 | BalaArrayList* _tmp305_; |
| 34808 | BalaGLibValue* _tmp306_; |
| 34809 | BalaGLibValue* _tmp307_; |
| 34810 | BalaGLibValue* _tmp308_; |
| 34811 | _tmp304_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 34812 | _tmp305_ = _tmp304_; |
| 34813 | _tmp306_ = _result_; |
| 34814 | _tmp307_ = bala_glib_value_copy (G_TYPE_CHECK_INSTANCE_CAST (_tmp306_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp306_), ((bala_glib_value_get_type ())))))); |
| 34815 | _tmp308_ = _tmp307_; |
| 34816 | bala_list_insert ((BalaList*) _tmp305_, 0, (BalaTargetValue*) _tmp308_); |
| 34817 | _bala_target_value_unref0 (_tmp308_)((_tmp308_ == ((void*)0)) ? ((void*)0) : (_tmp308_ = (bala_target_value_unref (_tmp308_), ((void*)0)))); |
| 34818 | } |
| 34819 | _bala_ccode_node_unref0 (sink)((sink == ((void*)0)) ? ((void*)0) : (sink = (bala_ccode_node_unref (sink), ((void*)0)))); |
| 34820 | _bala_ccode_node_unref0 (cfunc)((cfunc == ((void*)0)) ? ((void*)0) : (cfunc = (bala_ccode_node_unref (cfunc), ((void*)0)))); |
| 34821 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 34822 | _g_free0 (variant_func)(variant_func = (g_free (variant_func), ((void*)0))); |
| 34823 | } else { |
| 34824 | if (boxing) { |
| 34825 | BalaGLibValue* _tmp309_; |
| 34826 | BalaDataType* _tmp310_; |
| 34827 | BalaDataType* _tmp311_; |
| 34828 | gboolean _tmp312_ = FALSE(0); |
| 34829 | BalaGLibValue* _tmp313_; |
| 34830 | BalaGLibValue* _tmp330_; |
| 34831 | BalaGLibValue* _tmp331_; |
| 34832 | BalaCCodeExpression* _tmp332_; |
| 34833 | BalaCCodeUnaryExpression* _tmp333_; |
| 34834 | BalaGLibValue* _tmp334_; |
| 34835 | BalaGLibValue* _tmp335_; |
| 34836 | BalaDataType* _tmp336_; |
| 34837 | BalaDataType* _tmp337_; |
| 34838 | _tmp309_ = _result_; |
| 34839 | _tmp310_ = bala_target_value_get_value_type ((BalaTargetValue*) _tmp309_); |
| 34840 | _tmp311_ = _tmp310_; |
| 34841 | bala_data_type_set_nullable (_tmp311_, FALSE(0)); |
| 34842 | _tmp313_ = _result_; |
| 34843 | if (!_tmp313_->lvalue) { |
| 34844 | _tmp312_ = TRUE(!(0)); |
| 34845 | } else { |
| 34846 | BalaGLibValue* _tmp314_; |
| 34847 | BalaDataType* _tmp315_; |
| 34848 | BalaDataType* _tmp316_; |
| 34849 | BalaDataType* _tmp317_; |
| 34850 | BalaDataType* _tmp318_; |
| 34851 | _tmp314_ = _result_; |
| 34852 | _tmp315_ = bala_target_value_get_value_type ((BalaTargetValue*) _tmp314_); |
| 34853 | _tmp316_ = _tmp315_; |
| 34854 | _tmp317_ = bala_target_value_get_value_type (value); |
| 34855 | _tmp318_ = _tmp317_; |
| 34856 | _tmp312_ = !bala_data_type_equals (_tmp316_, _tmp318_); |
| 34857 | } |
| 34858 | if (_tmp312_) { |
| 34859 | BalaGLibValue* _tmp319_; |
| 34860 | BalaGLibValue* _tmp320_; |
| 34861 | BalaCCodeExpression* _tmp321_; |
| 34862 | BalaDataType* _tmp322_; |
| 34863 | BalaDataType* _tmp323_; |
| 34864 | BalaGLibValue* _tmp324_; |
| 34865 | BalaDataType* _tmp325_; |
| 34866 | BalaDataType* _tmp326_; |
| 34867 | BalaCCodeExpression* _tmp327_; |
| 34868 | BalaGLibValue* _tmp328_; |
| 34869 | BalaTargetValue* _tmp329_; |
| 34870 | _tmp319_ = _result_; |
| 34871 | _tmp320_ = _result_; |
| 34872 | _tmp321_ = _tmp320_->cvalue; |
| 34873 | _tmp322_ = bala_target_value_get_value_type (value); |
| 34874 | _tmp323_ = _tmp322_; |
| 34875 | _tmp324_ = _result_; |
| 34876 | _tmp325_ = bala_target_value_get_value_type ((BalaTargetValue*) _tmp324_); |
| 34877 | _tmp326_ = _tmp325_; |
| 34878 | _tmp327_ = bala_ccode_base_module_get_implicit_cast_expression (self, _tmp321_, _tmp323_, _tmp326_, node); |
| 34879 | _bala_ccode_node_unref0 (_tmp319_->cvalue)((_tmp319_->cvalue == ((void*)0)) ? ((void*)0) : (_tmp319_ ->cvalue = (bala_ccode_node_unref (_tmp319_->cvalue), ( (void*)0)))); |
| 34880 | _tmp319_->cvalue = _tmp327_; |
| 34881 | _tmp328_ = _result_; |
| 34882 | _tmp329_ = bala_ccode_base_module_store_temp_value (self, (BalaTargetValue*) _tmp328_, node, NULL((void*)0)); |
| 34883 | _bala_target_value_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_target_value_unref (_result_), ((void*)0)))); |
| 34884 | _result_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp329_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp329_), ((bala_glib_value_get_type ()))))); |
| 34885 | } |
| 34886 | _tmp330_ = _result_; |
| 34887 | _tmp331_ = _result_; |
| 34888 | _tmp332_ = _tmp331_->cvalue; |
| 34889 | _tmp333_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp332_); |
| 34890 | _bala_ccode_node_unref0 (_tmp330_->cvalue)((_tmp330_->cvalue == ((void*)0)) ? ((void*)0) : (_tmp330_ ->cvalue = (bala_ccode_node_unref (_tmp330_->cvalue), ( (void*)0)))); |
| 34891 | _tmp330_->cvalue = (BalaCCodeExpression*) _tmp333_; |
| 34892 | _tmp334_ = _result_; |
| 34893 | _tmp334_->lvalue = FALSE(0); |
| 34894 | _tmp335_ = _result_; |
| 34895 | _tmp336_ = bala_target_value_get_value_type ((BalaTargetValue*) _tmp335_); |
| 34896 | _tmp337_ = _tmp336_; |
| 34897 | bala_data_type_set_nullable (_tmp337_, TRUE(!(0))); |
| 34898 | } else { |
| 34899 | if (unboxing) { |
| 34900 | BalaGLibValue* _tmp338_; |
| 34901 | BalaGLibValue* _tmp339_; |
| 34902 | BalaCCodeExpression* _tmp340_; |
| 34903 | BalaCCodeUnaryExpression* _tmp341_; |
| 34904 | _tmp338_ = _result_; |
| 34905 | _tmp339_ = _result_; |
| 34906 | _tmp340_ = _tmp339_->cvalue; |
| 34907 | _tmp341_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, _tmp340_); |
| 34908 | _bala_ccode_node_unref0 (_tmp338_->cvalue)((_tmp338_->cvalue == ((void*)0)) ? ((void*)0) : (_tmp338_ ->cvalue = (bala_ccode_node_unref (_tmp338_->cvalue), ( (void*)0)))); |
| 34909 | _tmp338_->cvalue = (BalaCCodeExpression*) _tmp341_; |
| 34910 | } else { |
| 34911 | BalaCCodeExpression* old_cexpr = NULL((void*)0); |
| 34912 | BalaGLibValue* _tmp342_; |
| 34913 | BalaCCodeExpression* _tmp343_; |
| 34914 | BalaCCodeExpression* _tmp344_; |
| 34915 | BalaGLibValue* _tmp345_; |
| 34916 | BalaGLibValue* _tmp346_; |
| 34917 | BalaCCodeExpression* _tmp347_; |
| 34918 | BalaDataType* _tmp348_; |
| 34919 | BalaCCodeExpression* _tmp349_; |
| 34920 | gboolean _tmp350_ = FALSE(0); |
| 34921 | BalaGLibValue* _tmp351_; |
| 34922 | BalaGLibValue* _tmp355_; |
| 34923 | _tmp342_ = _result_; |
| 34924 | _tmp343_ = _tmp342_->cvalue; |
| 34925 | _tmp344_ = _bala_ccode_node_ref0 (_tmp343_); |
| 34926 | old_cexpr = _tmp344_; |
| 34927 | _tmp345_ = _result_; |
| 34928 | _tmp346_ = _result_; |
| 34929 | _tmp347_ = _tmp346_->cvalue; |
| 34930 | _tmp348_ = type; |
| 34931 | _tmp349_ = bala_ccode_base_module_get_implicit_cast_expression (self, _tmp347_, _tmp348_, target_type, node); |
| 34932 | _bala_ccode_node_unref0 (_tmp345_->cvalue)((_tmp345_->cvalue == ((void*)0)) ? ((void*)0) : (_tmp345_ ->cvalue = (bala_ccode_node_unref (_tmp345_->cvalue), ( (void*)0)))); |
| 34933 | _tmp345_->cvalue = _tmp349_; |
| 34934 | _tmp351_ = _result_; |
| 34935 | if (_tmp351_->lvalue) { |
| 34936 | BalaGLibValue* _tmp352_; |
| 34937 | BalaCCodeExpression* _tmp353_; |
| 34938 | BalaCCodeExpression* _tmp354_; |
| 34939 | _tmp352_ = _result_; |
| 34940 | _tmp353_ = _tmp352_->cvalue; |
| 34941 | _tmp354_ = old_cexpr; |
| 34942 | _tmp350_ = _tmp353_ == _tmp354_; |
| 34943 | } else { |
| 34944 | _tmp350_ = FALSE(0); |
| 34945 | } |
| 34946 | _tmp355_ = _result_; |
| 34947 | _tmp355_->lvalue = _tmp350_; |
| 34948 | _bala_ccode_node_unref0 (old_cexpr)((old_cexpr == ((void*)0)) ? ((void*)0) : (old_cexpr = (bala_ccode_node_unref (old_cexpr), ((void*)0)))); |
| 34949 | } |
| 34950 | } |
| 34951 | } |
| 34952 | } |
| 34953 | array_needs_copy = FALSE(0); |
| 34954 | _tmp357_ = type; |
| 34955 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp357_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp357_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 34956 | _tmp356_ = G_TYPE_CHECK_INSTANCE_TYPE (target_type, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( target_type); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 34957 | } else { |
| 34958 | _tmp356_ = FALSE(0); |
| 34959 | } |
| 34960 | if (_tmp356_) { |
| 34961 | BalaArrayType* array = NULL((void*)0); |
| 34962 | BalaDataType* _tmp358_; |
| 34963 | BalaArrayType* _tmp359_; |
| 34964 | BalaArrayType* target_array = NULL((void*)0); |
| 34965 | BalaArrayType* _tmp360_; |
| 34966 | gboolean _tmp361_ = FALSE(0); |
| 34967 | BalaArrayType* _tmp362_; |
| 34968 | BalaDataType* _tmp363_; |
| 34969 | BalaDataType* _tmp364_; |
| 34970 | gboolean _tmp365_; |
| 34971 | gboolean _tmp366_; |
| 34972 | _tmp358_ = type; |
| 34973 | _tmp359_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp358_, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp358_), ((bala_array_type_get_type ())))))); |
| 34974 | array = _tmp359_; |
| 34975 | _tmp360_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (target_type, BALA_TYPE_ARRAY_TYPE, BalaArrayType)(((BalaArrayType*) g_type_check_instance_cast ((GTypeInstance *) (target_type), ((bala_array_type_get_type ())))))); |
| 34976 | target_array = _tmp360_; |
| 34977 | _tmp362_ = target_array; |
| 34978 | _tmp363_ = bala_array_type_get_element_type (_tmp362_); |
| 34979 | _tmp364_ = _tmp363_; |
| 34980 | _tmp365_ = bala_data_type_get_value_owned (_tmp364_); |
| 34981 | _tmp366_ = _tmp365_; |
| 34982 | if (_tmp366_) { |
| 34983 | BalaArrayType* _tmp367_; |
| 34984 | BalaDataType* _tmp368_; |
| 34985 | BalaDataType* _tmp369_; |
| 34986 | gboolean _tmp370_; |
| 34987 | gboolean _tmp371_; |
| 34988 | _tmp367_ = array; |
| 34989 | _tmp368_ = bala_array_type_get_element_type (_tmp367_); |
| 34990 | _tmp369_ = _tmp368_; |
| 34991 | _tmp370_ = bala_data_type_get_value_owned (_tmp369_); |
| 34992 | _tmp371_ = _tmp370_; |
| 34993 | _tmp361_ = !_tmp371_; |
| 34994 | } else { |
| 34995 | _tmp361_ = FALSE(0); |
| 34996 | } |
| 34997 | if (_tmp361_) { |
| 34998 | BalaArrayType* _tmp372_; |
| 34999 | BalaDataType* _tmp373_; |
| 35000 | BalaDataType* _tmp374_; |
| 35001 | _tmp372_ = target_array; |
| 35002 | _tmp373_ = bala_array_type_get_element_type (_tmp372_); |
| 35003 | _tmp374_ = _tmp373_; |
| 35004 | array_needs_copy = bala_ccode_base_module_requires_copy (_tmp374_); |
| 35005 | } |
| 35006 | _bala_code_node_unref0 (target_array)((target_array == ((void*)0)) ? ((void*)0) : (target_array = ( bala_code_node_unref (target_array), ((void*)0)))); |
| 35007 | _bala_code_node_unref0 (array)((array == ((void*)0)) ? ((void*)0) : (array = (bala_code_node_unref (array), ((void*)0)))); |
| 35008 | } |
| 35009 | if (!gvalue_boxing) { |
| 35010 | _tmp379_ = !gvariant_boxing; |
| 35011 | } else { |
| 35012 | _tmp379_ = FALSE(0); |
| 35013 | } |
| 35014 | if (_tmp379_) { |
| 35015 | gboolean _tmp380_; |
| 35016 | gboolean _tmp381_; |
| 35017 | _tmp380_ = bala_data_type_get_value_owned (target_type); |
| 35018 | _tmp381_ = _tmp380_; |
| 35019 | _tmp378_ = _tmp381_; |
| 35020 | } else { |
| 35021 | _tmp378_ = FALSE(0); |
| 35022 | } |
| 35023 | if (_tmp378_) { |
| 35024 | gboolean _tmp382_ = FALSE(0); |
| 35025 | gboolean _tmp383_ = FALSE(0); |
| 35026 | gboolean _tmp384_ = FALSE(0); |
| 35027 | BalaDataType* _tmp385_; |
| 35028 | gboolean _tmp386_; |
| 35029 | gboolean _tmp387_; |
| 35030 | _tmp385_ = type; |
| 35031 | _tmp386_ = bala_data_type_get_value_owned (_tmp385_); |
| 35032 | _tmp387_ = _tmp386_; |
| 35033 | if (!_tmp387_) { |
| 35034 | _tmp384_ = TRUE(!(0)); |
| 35035 | } else { |
| 35036 | _tmp384_ = boxing; |
| 35037 | } |
| 35038 | if (_tmp384_) { |
| 35039 | _tmp383_ = TRUE(!(0)); |
| 35040 | } else { |
| 35041 | _tmp383_ = unboxing; |
| 35042 | } |
| 35043 | if (_tmp383_) { |
| 35044 | _tmp382_ = TRUE(!(0)); |
| 35045 | } else { |
| 35046 | _tmp382_ = array_needs_copy; |
| 35047 | } |
| 35048 | _tmp377_ = _tmp382_; |
| 35049 | } else { |
| 35050 | _tmp377_ = FALSE(0); |
| 35051 | } |
| 35052 | if (_tmp377_) { |
| 35053 | _tmp376_ = bala_ccode_base_module_requires_copy (target_type); |
| 35054 | } else { |
| 35055 | _tmp376_ = FALSE(0); |
| 35056 | } |
| 35057 | if (_tmp376_) { |
| 35058 | BalaDataType* _tmp388_; |
| 35059 | _tmp388_ = type; |
| 35060 | _tmp375_ = !G_TYPE_CHECK_INSTANCE_TYPE (_tmp388_, BALA_TYPE_NULL_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp388_); GType __t = ((bala_null_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 35061 | } else { |
| 35062 | _tmp375_ = FALSE(0); |
| 35063 | } |
| 35064 | if (_tmp375_) { |
| 35065 | BalaGLibValue* copy = NULL((void*)0); |
| 35066 | BalaGLibValue* _tmp389_; |
| 35067 | BalaTargetValue* _tmp390_; |
| 35068 | gboolean _tmp391_ = FALSE(0); |
| 35069 | BalaTypeSymbol* _tmp392_; |
| 35070 | BalaTypeSymbol* _tmp393_; |
| 35071 | gboolean _tmp403_ = FALSE(0); |
| 35072 | BalaGLibValue* _tmp414_; |
| 35073 | BalaGLibValue* _tmp415_; |
| 35074 | BalaPropertyAccessor* prop_acc = NULL((void*)0); |
| 35075 | BalaPropertyAccessor* _tmp416_; |
| 35076 | gboolean _tmp417_ = FALSE(0); |
| 35077 | gboolean _tmp418_ = FALSE(0); |
| 35078 | BalaPropertyAccessor* _tmp419_; |
| 35079 | _tmp389_ = _result_; |
| 35080 | _tmp390_ = bala_ccode_base_module_copy_value (self, (BalaTargetValue*) _tmp389_, node); |
| 35081 | copy = G_TYPE_CHECK_INSTANCE_CAST (_tmp390_, BALA_TYPE_GLIB_VALUE, BalaGLibValue)(((BalaGLibValue*) g_type_check_instance_cast ((GTypeInstance *) (_tmp390_), ((bala_glib_value_get_type ()))))); |
| 35082 | _tmp392_ = bala_data_type_get_type_symbol (target_type); |
| 35083 | _tmp393_ = _tmp392_; |
| 35084 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp393_, BALA_TYPE_INTERFACE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp393_); GType __t = ((bala_interface_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 35085 | BalaGLibValue* _tmp394_; |
| 35086 | _tmp394_ = copy; |
| 35087 | _tmp391_ = _tmp394_ == NULL((void*)0); |
| 35088 | } else { |
| 35089 | _tmp391_ = FALSE(0); |
| 35090 | } |
| 35091 | if (_tmp391_) { |
| 35092 | BalaSourceReference* _tmp395_; |
| 35093 | BalaSourceReference* _tmp396_; |
| 35094 | BalaTypeSymbol* _tmp397_; |
| 35095 | BalaTypeSymbol* _tmp398_; |
| 35096 | gchar* _tmp399_; |
| 35097 | gchar* _tmp400_; |
| 35098 | gchar* _tmp401_; |
| 35099 | gchar* _tmp402_; |
| 35100 | _tmp395_ = bala_code_node_get_source_reference (node); |
| 35101 | _tmp396_ = _tmp395_; |
| 35102 | _tmp397_ = bala_data_type_get_type_symbol (target_type); |
| 35103 | _tmp398_ = _tmp397_; |
| 35104 | _tmp399_ = bala_symbol_get_full_name ((BalaSymbol*) _tmp398_); |
| 35105 | _tmp400_ = _tmp399_; |
| 35106 | _tmp401_ = g_strdup_printf ("missing class prerequisite for interface `%s', add GLib.Object to inte" \ |
| 35107 | "rface declaration if unsure", _tmp400_); |
| 35108 | _tmp402_ = _tmp401_; |
| 35109 | bala_report_error (_tmp396_, _tmp402_); |
| 35110 | _g_free0 (_tmp402_)(_tmp402_ = (g_free (_tmp402_), ((void*)0))); |
| 35111 | _g_free0 (_tmp400_)(_tmp400_ = (g_free (_tmp400_), ((void*)0))); |
| 35112 | result = (BalaTargetValue*) _result_; |
| 35113 | _bala_target_value_unref0 (copy)((copy == ((void*)0)) ? ((void*)0) : (copy = (bala_target_value_unref (copy), ((void*)0)))); |
| 35114 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 35115 | return result; |
| 35116 | } |
| 35117 | if (array_needs_copy) { |
| 35118 | BalaDataType* _tmp404_; |
| 35119 | _tmp404_ = type; |
| 35120 | _tmp403_ = bala_ccode_base_module_requires_destroy (_tmp404_); |
| 35121 | } else { |
| 35122 | _tmp403_ = FALSE(0); |
| 35123 | } |
| 35124 | if (_tmp403_) { |
| 35125 | BalaGLibValue* _tmp405_; |
| 35126 | BalaDataType* _tmp406_; |
| 35127 | BalaDataType* _tmp407_; |
| 35128 | BalaDataType* _tmp408_; |
| 35129 | BalaCCodeFunction* _tmp409_; |
| 35130 | BalaCCodeFunction* _tmp410_; |
| 35131 | BalaGLibValue* _tmp411_; |
| 35132 | BalaCCodeExpression* _tmp412_; |
| 35133 | BalaCCodeExpression* _tmp413_; |
| 35134 | _tmp405_ = _result_; |
| 35135 | _tmp406_ = type; |
| 35136 | _tmp407_ = bala_data_type_copy (_tmp406_); |
| 35137 | _tmp408_ = _tmp407_; |
| 35138 | bala_target_value_set_value_type ((BalaTargetValue*) _tmp405_, _tmp408_); |
| 35139 | _bala_code_node_unref0 (_tmp408_)((_tmp408_ == ((void*)0)) ? ((void*)0) : (_tmp408_ = (bala_code_node_unref (_tmp408_), ((void*)0)))); |
| 35140 | _tmp409_ = bala_ccode_base_module_get_ccode (self); |
| 35141 | _tmp410_ = _tmp409_; |
| 35142 | _tmp411_ = _result_; |
| 35143 | _tmp412_ = bala_ccode_base_module_destroy_value (self, (BalaTargetValue*) _tmp411_, FALSE(0)); |
| 35144 | _tmp413_ = _tmp412_; |
| 35145 | bala_ccode_function_add_expression (_tmp410_, _tmp413_); |
| 35146 | _bala_ccode_node_unref0 (_tmp413_)((_tmp413_ == ((void*)0)) ? ((void*)0) : (_tmp413_ = (bala_ccode_node_unref (_tmp413_), ((void*)0)))); |
| 35147 | } |
| 35148 | _tmp414_ = copy; |
| 35149 | _tmp415_ = _bala_target_value_ref0 (_tmp414_); |
| 35150 | _bala_target_value_unref0 (_result_)((_result_ == ((void*)0)) ? ((void*)0) : (_result_ = (bala_target_value_unref (_result_), ((void*)0)))); |
| 35151 | _result_ = _tmp415_; |
| 35152 | _tmp416_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (node, BALA_TYPE_PROPERTY_ACCESSOR)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( node); GType __t = ((bala_property_accessor_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaPropertyAccessor*) node) : NULL((void*)0)); |
| 35153 | prop_acc = _tmp416_; |
| 35154 | _tmp419_ = prop_acc; |
| 35155 | if (_tmp419_ != NULL((void*)0)) { |
| 35156 | BalaPropertyAccessor* _tmp420_; |
| 35157 | gboolean _tmp421_; |
| 35158 | gboolean _tmp422_; |
| 35159 | _tmp420_ = prop_acc; |
| 35160 | _tmp421_ = bala_property_accessor_get_automatic_body (_tmp420_); |
| 35161 | _tmp422_ = _tmp421_; |
| 35162 | _tmp418_ = !_tmp422_; |
| 35163 | } else { |
| 35164 | _tmp418_ = FALSE(0); |
| 35165 | } |
| 35166 | if (_tmp418_) { |
| 35167 | BalaGLibValue* _tmp423_; |
| 35168 | BalaDataType* _tmp424_; |
| 35169 | BalaDataType* _tmp425_; |
| 35170 | _tmp423_ = _result_; |
| 35171 | _tmp424_ = bala_target_value_get_value_type ((BalaTargetValue*) _tmp423_); |
| 35172 | _tmp425_ = _tmp424_; |
| 35173 | _tmp417_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp425_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp425_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 35174 | } else { |
| 35175 | _tmp417_ = FALSE(0); |
| 35176 | } |
| 35177 | if (_tmp417_) { |
| 35178 | BalaSourceReference* _tmp426_; |
| 35179 | BalaSourceReference* _tmp427_; |
| 35180 | _tmp426_ = bala_code_node_get_source_reference (node); |
| 35181 | _tmp427_ = _tmp426_; |
| 35182 | bala_report_deprecated (_tmp427_, "implicit copy of array is deprecated, explicitly invoke the copy metho" \ |
| 35183 | "d instead"); |
| 35184 | } |
| 35185 | _bala_code_node_unref0 (prop_acc)((prop_acc == ((void*)0)) ? ((void*)0) : (prop_acc = (bala_code_node_unref (prop_acc), ((void*)0)))); |
| 35186 | _bala_target_value_unref0 (copy)((copy == ((void*)0)) ? ((void*)0) : (copy = (bala_target_value_unref (copy), ((void*)0)))); |
| 35187 | } |
| 35188 | result = (BalaTargetValue*) _result_; |
| 35189 | _bala_code_node_unref0 (type)((type == ((void*)0)) ? ((void*)0) : (type = (bala_code_node_unref (type), ((void*)0)))); |
| 35190 | return result; |
| 35191 | } |
| 35192 | |
| 35193 | static BalaCCodeExpression* |
| 35194 | bala_ccode_base_module_real_get_implicit_cast_expression (BalaCCodeBaseModule* self, |
| 35195 | BalaCCodeExpression* source_cexpr, |
| 35196 | BalaDataType* expression_type, |
| 35197 | BalaDataType* target_type, |
| 35198 | BalaCodeNode* node) |
| 35199 | { |
| 35200 | BalaCCodeExpression* cexpr = NULL((void*)0); |
| 35201 | BalaCCodeExpression* _tmp0_; |
| 35202 | gboolean _tmp1_ = FALSE(0); |
| 35203 | BalaTypeSymbol* _tmp2_; |
| 35204 | BalaTypeSymbol* _tmp3_; |
| 35205 | BalaCCodeFile* _tmp8_; |
| 35206 | BalaClass* cl = NULL((void*)0); |
| 35207 | BalaTypeSymbol* _tmp9_; |
| 35208 | BalaTypeSymbol* _tmp10_; |
| 35209 | BalaInterface* iface = NULL((void*)0); |
| 35210 | BalaTypeSymbol* _tmp11_; |
| 35211 | BalaTypeSymbol* _tmp12_; |
| 35212 | gboolean _tmp13_ = FALSE(0); |
| 35213 | BalaCodeContext* _tmp14_; |
| 35214 | gboolean _tmp15_; |
| 35215 | gboolean _tmp16_; |
| 35216 | BalaCCodeExpression* result = NULL((void*)0); |
| 35217 | g_return_val_if_fail (source_cexpr != NULL, NULL)do { if ((source_cexpr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "source_cexpr != NULL" ); return (((void*)0)); } } while (0); |
| 35218 | _tmp0_ = _bala_ccode_node_ref0 (source_cexpr); |
| 35219 | cexpr = _tmp0_; |
| 35220 | _tmp2_ = bala_data_type_get_type_symbol (expression_type); |
| 35221 | _tmp3_ = _tmp2_; |
| 35222 | if (_tmp3_ != NULL((void*)0)) { |
| 35223 | BalaTypeSymbol* _tmp4_; |
| 35224 | BalaTypeSymbol* _tmp5_; |
| 35225 | BalaTypeSymbol* _tmp6_; |
| 35226 | BalaTypeSymbol* _tmp7_; |
| 35227 | _tmp4_ = bala_data_type_get_type_symbol (expression_type); |
| 35228 | _tmp5_ = _tmp4_; |
| 35229 | _tmp6_ = bala_data_type_get_type_symbol (target_type); |
| 35230 | _tmp7_ = _tmp6_; |
| 35231 | _tmp1_ = _tmp5_ == _tmp7_; |
| 35232 | } else { |
| 35233 | _tmp1_ = FALSE(0); |
| 35234 | } |
| 35235 | if (_tmp1_) { |
| 35236 | result = cexpr; |
| 35237 | return result; |
| 35238 | } |
| 35239 | if (G_TYPE_CHECK_INSTANCE_TYPE (expression_type, BALA_TYPE_NULL_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( expression_type); GType __t = ((bala_null_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } )))) { |
| 35240 | result = cexpr; |
| 35241 | return result; |
| 35242 | } |
| 35243 | _tmp8_ = self->cfile; |
| 35244 | bala_ccode_base_module_generate_type_declaration (self, target_type, _tmp8_); |
| 35245 | _tmp9_ = bala_data_type_get_type_symbol (target_type); |
| 35246 | _tmp10_ = _tmp9_; |
| 35247 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp10_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp10_) : NULL((void*)0); |
| 35248 | _tmp11_ = bala_data_type_get_type_symbol (target_type); |
| 35249 | _tmp12_ = _tmp11_; |
| 35250 | iface = G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, BALA_TYPE_INTERFACE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp12_); GType __t = ((bala_interface_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaInterface*) _tmp12_) : NULL((void*)0); |
| 35251 | _tmp14_ = self->priv->_context; |
| 35252 | _tmp15_ = bala_code_context_get_checking (_tmp14_); |
| 35253 | _tmp16_ = _tmp15_; |
| 35254 | if (_tmp16_) { |
| 35255 | gboolean _tmp17_ = FALSE(0); |
| 35256 | BalaInterface* _tmp18_; |
| 35257 | _tmp18_ = iface; |
| 35258 | if (_tmp18_ != NULL((void*)0)) { |
| 35259 | _tmp17_ = TRUE(!(0)); |
| 35260 | } else { |
| 35261 | gboolean _tmp19_ = FALSE(0); |
| 35262 | BalaClass* _tmp20_; |
| 35263 | _tmp20_ = cl; |
| 35264 | if (_tmp20_ != NULL((void*)0)) { |
| 35265 | BalaClass* _tmp21_; |
| 35266 | gboolean _tmp22_; |
| 35267 | gboolean _tmp23_; |
| 35268 | _tmp21_ = cl; |
| 35269 | _tmp22_ = bala_class_get_is_compact (_tmp21_); |
| 35270 | _tmp23_ = _tmp22_; |
| 35271 | _tmp19_ = !_tmp23_; |
| 35272 | } else { |
| 35273 | _tmp19_ = FALSE(0); |
| 35274 | } |
| 35275 | _tmp17_ = _tmp19_; |
| 35276 | } |
| 35277 | _tmp13_ = _tmp17_; |
| 35278 | } else { |
| 35279 | _tmp13_ = FALSE(0); |
| 35280 | } |
| 35281 | if (_tmp13_) { |
| 35282 | BalaCCodeExpression* _tmp24_; |
| 35283 | BalaTypeSymbol* _tmp25_; |
| 35284 | BalaTypeSymbol* _tmp26_; |
| 35285 | BalaCCodeFunctionCall* _tmp27_; |
| 35286 | _tmp24_ = cexpr; |
| 35287 | _tmp25_ = bala_data_type_get_type_symbol (target_type); |
| 35288 | _tmp26_ = _tmp25_; |
| 35289 | _tmp27_ = bala_ccode_base_module_generate_instance_cast (self, _tmp24_, _tmp26_); |
| 35290 | result = (BalaCCodeExpression*) _tmp27_; |
| 35291 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 35292 | return result; |
| 35293 | } else { |
| 35294 | gboolean _tmp28_ = FALSE(0); |
| 35295 | BalaTypeSymbol* _tmp29_; |
| 35296 | BalaTypeSymbol* _tmp30_; |
| 35297 | _tmp29_ = bala_data_type_get_type_symbol (target_type); |
| 35298 | _tmp30_ = _tmp29_; |
| 35299 | if (_tmp30_ != NULL((void*)0)) { |
| 35300 | gchar* _tmp31_; |
| 35301 | gchar* _tmp32_; |
| 35302 | gchar* _tmp33_; |
| 35303 | gchar* _tmp34_; |
| 35304 | _tmp31_ = bala_get_ccode_name ((BalaCodeNode*) expression_type); |
| 35305 | _tmp32_ = _tmp31_; |
| 35306 | _tmp33_ = bala_get_ccode_name ((BalaCodeNode*) target_type); |
| 35307 | _tmp34_ = _tmp33_; |
| 35308 | _tmp28_ = g_strcmp0 (_tmp32_, _tmp34_) != 0; |
| 35309 | _g_free0 (_tmp34_)(_tmp34_ = (g_free (_tmp34_), ((void*)0))); |
| 35310 | _g_free0 (_tmp32_)(_tmp32_ = (g_free (_tmp32_), ((void*)0))); |
| 35311 | } else { |
| 35312 | _tmp28_ = FALSE(0); |
| 35313 | } |
| 35314 | if (_tmp28_) { |
| 35315 | BalaStruct* st = NULL((void*)0); |
| 35316 | BalaTypeSymbol* _tmp35_; |
| 35317 | BalaTypeSymbol* _tmp36_; |
| 35318 | gboolean _tmp37_ = FALSE(0); |
| 35319 | BalaTypeSymbol* _tmp38_; |
| 35320 | BalaTypeSymbol* _tmp39_; |
| 35321 | _tmp35_ = bala_data_type_get_type_symbol (target_type); |
| 35322 | _tmp36_ = _tmp35_; |
| 35323 | st = G_TYPE_CHECK_INSTANCE_TYPE (_tmp36_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp36_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp36_) : NULL((void*)0); |
| 35324 | _tmp38_ = bala_data_type_get_type_symbol (target_type); |
| 35325 | _tmp39_ = _tmp38_; |
| 35326 | if (bala_typesymbol_is_reference_type (_tmp39_)) { |
| 35327 | _tmp37_ = TRUE(!(0)); |
| 35328 | } else { |
| 35329 | gboolean _tmp40_ = FALSE(0); |
| 35330 | BalaStruct* _tmp41_; |
| 35331 | _tmp41_ = st; |
| 35332 | if (_tmp41_ != NULL((void*)0)) { |
| 35333 | BalaStruct* _tmp42_; |
| 35334 | _tmp42_ = st; |
| 35335 | _tmp40_ = bala_struct_is_simple_type (_tmp42_); |
| 35336 | } else { |
| 35337 | _tmp40_ = FALSE(0); |
| 35338 | } |
| 35339 | _tmp37_ = _tmp40_; |
| 35340 | } |
| 35341 | if (_tmp37_) { |
| 35342 | BalaCCodeExpression* _tmp43_; |
| 35343 | gchar* _tmp44_; |
| 35344 | gchar* _tmp45_; |
| 35345 | BalaCCodeCastExpression* _tmp46_; |
| 35346 | BalaCCodeExpression* _tmp47_; |
| 35347 | _tmp43_ = cexpr; |
| 35348 | _tmp44_ = bala_get_ccode_name ((BalaCodeNode*) target_type); |
| 35349 | _tmp45_ = _tmp44_; |
| 35350 | _tmp46_ = bala_ccode_cast_expression_new (_tmp43_, _tmp45_); |
| 35351 | _tmp47_ = (BalaCCodeExpression*) _tmp46_; |
| 35352 | _g_free0 (_tmp45_)(_tmp45_ = (g_free (_tmp45_), ((void*)0))); |
| 35353 | result = _tmp47_; |
| 35354 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 35355 | return result; |
| 35356 | } else { |
| 35357 | result = cexpr; |
| 35358 | return result; |
| 35359 | } |
| 35360 | } else { |
| 35361 | result = cexpr; |
| 35362 | return result; |
| 35363 | } |
| 35364 | } |
| 35365 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 35366 | } |
| 35367 | |
| 35368 | BalaCCodeExpression* |
| 35369 | bala_ccode_base_module_get_implicit_cast_expression (BalaCCodeBaseModule* self, |
| 35370 | BalaCCodeExpression* source_cexpr, |
| 35371 | BalaDataType* expression_type, |
| 35372 | BalaDataType* target_type, |
| 35373 | BalaCodeNode* node) |
| 35374 | { |
| 35375 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 35376 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_implicit_cast_expression (self, source_cexpr, expression_type, target_type, node); |
| 35377 | } |
| 35378 | |
| 35379 | void |
| 35380 | bala_ccode_base_module_store_property (BalaCCodeBaseModule* self, |
| 35381 | BalaProperty* prop, |
| 35382 | BalaExpression* instance, |
| 35383 | BalaTargetValue* value) |
| 35384 | { |
| 35385 | BalaProperty* base_prop = NULL((void*)0); |
| 35386 | BalaProperty* _tmp0_; |
| 35387 | BalaProperty* _tmp1_; |
| 35388 | gboolean _tmp8_ = FALSE(0); |
| 35389 | gchar* set_func = NULL((void*)0); |
| 35390 | gchar* _tmp83_; |
| 35391 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 35392 | const gchar* _tmp98_; |
| 35393 | BalaCCodeIdentifier* _tmp99_; |
| 35394 | BalaCCodeIdentifier* _tmp100_; |
| 35395 | BalaCCodeFunctionCall* _tmp101_; |
| 35396 | BalaCCodeFunctionCall* _tmp102_; |
| 35397 | BalaMemberBinding _tmp103_; |
| 35398 | BalaMemberBinding _tmp104_; |
| 35399 | BalaCCodeExpression* cexpr = NULL((void*)0); |
| 35400 | BalaCCodeExpression* _tmp125_; |
| 35401 | BalaCCodeExpression* _tmp126_; |
| 35402 | BalaDataType* _tmp127_; |
| 35403 | BalaDataType* _tmp128_; |
| 35404 | BalaArrayType* array_type = NULL((void*)0); |
| 35405 | BalaDataType* _tmp138_; |
| 35406 | BalaDataType* _tmp139_; |
| 35407 | BalaArrayType* _tmp140_; |
| 35408 | BalaCCodeFunctionCall* _tmp141_; |
| 35409 | BalaCCodeExpression* _tmp142_; |
| 35410 | gboolean _tmp143_ = FALSE(0); |
| 35411 | BalaArrayType* _tmp144_; |
| 35412 | BalaCCodeFunction* _tmp180_; |
| 35413 | BalaCCodeFunction* _tmp181_; |
| 35414 | BalaCCodeFunctionCall* _tmp182_; |
| 35415 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 35416 | g_return_if_fail (prop != NULL)do { if ((prop != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "prop != NULL" ); return; } } while (0); |
| 35417 | g_return_if_fail (value != NULL)do { if ((value != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "value != NULL" ); return; } } while (0); |
| 35418 | base_prop = prop; |
| 35419 | _tmp0_ = bala_property_get_base_property (prop); |
| 35420 | _tmp1_ = _tmp0_; |
| 35421 | if (_tmp1_ != NULL((void*)0)) { |
| 35422 | BalaProperty* _tmp2_; |
| 35423 | BalaProperty* _tmp3_; |
| 35424 | _tmp2_ = bala_property_get_base_property (prop); |
| 35425 | _tmp3_ = _tmp2_; |
| 35426 | base_prop = _tmp3_; |
| 35427 | } else { |
| 35428 | BalaProperty* _tmp4_; |
| 35429 | BalaProperty* _tmp5_; |
| 35430 | _tmp4_ = bala_property_get_base_interface_property (prop); |
| 35431 | _tmp5_ = _tmp4_; |
| 35432 | if (_tmp5_ != NULL((void*)0)) { |
| 35433 | BalaProperty* _tmp6_; |
| 35434 | BalaProperty* _tmp7_; |
| 35435 | _tmp6_ = bala_property_get_base_interface_property (prop); |
| 35436 | _tmp7_ = _tmp6_; |
| 35437 | base_prop = _tmp7_; |
| 35438 | } |
| 35439 | } |
| 35440 | if (G_TYPE_CHECK_INSTANCE_TYPE (instance, BALA_TYPE_BASE_ACCESS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( instance); GType __t = ((bala_base_access_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 35441 | gboolean _tmp9_ = FALSE(0); |
| 35442 | BalaProperty* _tmp10_; |
| 35443 | gboolean _tmp11_; |
| 35444 | gboolean _tmp12_; |
| 35445 | _tmp10_ = base_prop; |
| 35446 | _tmp11_ = bala_property_get_is_abstract (_tmp10_); |
| 35447 | _tmp12_ = _tmp11_; |
| 35448 | if (_tmp12_) { |
| 35449 | _tmp9_ = TRUE(!(0)); |
| 35450 | } else { |
| 35451 | BalaProperty* _tmp13_; |
| 35452 | gboolean _tmp14_; |
| 35453 | gboolean _tmp15_; |
| 35454 | _tmp13_ = base_prop; |
| 35455 | _tmp14_ = bala_property_get_is_virtual (_tmp13_); |
| 35456 | _tmp15_ = _tmp14_; |
| 35457 | _tmp9_ = _tmp15_; |
| 35458 | } |
| 35459 | _tmp8_ = _tmp9_; |
| 35460 | } else { |
| 35461 | _tmp8_ = FALSE(0); |
| 35462 | } |
| 35463 | if (_tmp8_) { |
| 35464 | BalaCCodeExpression* vcast = NULL((void*)0); |
| 35465 | BalaProperty* _tmp16_; |
| 35466 | BalaSymbol* _tmp17_; |
| 35467 | BalaSymbol* _tmp18_; |
| 35468 | BalaCCodeExpression* _tmp45_; |
| 35469 | vcast = NULL((void*)0); |
| 35470 | _tmp16_ = base_prop; |
| 35471 | _tmp17_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp16_); |
| 35472 | _tmp18_ = _tmp17_; |
| 35473 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp18_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 35474 | BalaClass* base_class = NULL((void*)0); |
| 35475 | BalaProperty* _tmp19_; |
| 35476 | BalaSymbol* _tmp20_; |
| 35477 | BalaSymbol* _tmp21_; |
| 35478 | BalaClass* _tmp22_; |
| 35479 | gchar* _tmp23_; |
| 35480 | gchar* _tmp24_; |
| 35481 | BalaCCodeIdentifier* _tmp25_; |
| 35482 | BalaCCodeIdentifier* _tmp26_; |
| 35483 | BalaCCodeFunctionCall* _tmp27_; |
| 35484 | BalaCCodeExpression* _tmp28_; |
| 35485 | BalaClass* _tmp29_; |
| 35486 | BalaClass* _tmp30_; |
| 35487 | gchar* _tmp31_; |
| 35488 | gchar* _tmp32_; |
| 35489 | gchar* _tmp33_; |
| 35490 | gchar* _tmp34_; |
| 35491 | BalaCCodeIdentifier* _tmp35_; |
| 35492 | BalaCCodeIdentifier* _tmp36_; |
| 35493 | _tmp19_ = base_prop; |
| 35494 | _tmp20_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp19_); |
| 35495 | _tmp21_ = _tmp20_; |
| 35496 | base_class = G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, BALA_TYPE_CLASS, BalaClass)(((BalaClass*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp21_), ((bala_class_get_type ()))))); |
| 35497 | _tmp22_ = base_class; |
| 35498 | _tmp23_ = bala_get_ccode_class_type_function (_tmp22_); |
| 35499 | _tmp24_ = _tmp23_; |
| 35500 | _tmp25_ = bala_ccode_identifier_new (_tmp24_); |
| 35501 | _tmp26_ = _tmp25_; |
| 35502 | _tmp27_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp26_); |
| 35503 | _bala_ccode_node_unref0 (vcast)((vcast == ((void*)0)) ? ((void*)0) : (vcast = (bala_ccode_node_unref (vcast), ((void*)0)))); |
| 35504 | vcast = (BalaCCodeExpression*) _tmp27_; |
| 35505 | _bala_ccode_node_unref0 (_tmp26_)((_tmp26_ == ((void*)0)) ? ((void*)0) : (_tmp26_ = (bala_ccode_node_unref (_tmp26_), ((void*)0)))); |
| 35506 | _g_free0 (_tmp24_)(_tmp24_ = (g_free (_tmp24_), ((void*)0))); |
| 35507 | _tmp28_ = vcast; |
| 35508 | _tmp29_ = bala_ccode_base_module_get_current_class (self); |
| 35509 | _tmp30_ = _tmp29_; |
| 35510 | _tmp31_ = bala_get_ccode_lower_case_name ((BalaCodeNode*) _tmp30_, NULL((void*)0)); |
| 35511 | _tmp32_ = _tmp31_; |
| 35512 | _tmp33_ = g_strdup_printf ("%s_parent_class", _tmp32_); |
| 35513 | _tmp34_ = _tmp33_; |
| 35514 | _tmp35_ = bala_ccode_identifier_new (_tmp34_); |
| 35515 | _tmp36_ = _tmp35_; |
| 35516 | bala_ccode_function_call_add_argument (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, BALA_TYPE_CCODE_FUNCTION_CALL, BalaCCodeFunctionCall)(((BalaCCodeFunctionCall*) g_type_check_instance_cast ((GTypeInstance *) (_tmp28_), ((bala_ccode_function_call_get_type ()))))), (BalaCCodeExpression*) _tmp36_); |
| 35517 | _bala_ccode_node_unref0 (_tmp36_)((_tmp36_ == ((void*)0)) ? ((void*)0) : (_tmp36_ = (bala_ccode_node_unref (_tmp36_), ((void*)0)))); |
| 35518 | _g_free0 (_tmp34_)(_tmp34_ = (g_free (_tmp34_), ((void*)0))); |
| 35519 | _g_free0 (_tmp32_)(_tmp32_ = (g_free (_tmp32_), ((void*)0))); |
| 35520 | } else { |
| 35521 | BalaProperty* _tmp37_; |
| 35522 | BalaSymbol* _tmp38_; |
| 35523 | BalaSymbol* _tmp39_; |
| 35524 | _tmp37_ = base_prop; |
| 35525 | _tmp38_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp37_); |
| 35526 | _tmp39_ = _tmp38_; |
| 35527 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp39_, BALA_TYPE_INTERFACE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp39_); GType __t = ((bala_interface_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 35528 | BalaInterface* base_iface = NULL((void*)0); |
| 35529 | BalaProperty* _tmp40_; |
| 35530 | BalaSymbol* _tmp41_; |
| 35531 | BalaSymbol* _tmp42_; |
| 35532 | BalaInterface* _tmp43_; |
| 35533 | BalaCCodeExpression* _tmp44_; |
| 35534 | _tmp40_ = base_prop; |
| 35535 | _tmp41_ = bala_symbol_get_parent_symbol ((BalaSymbol*) _tmp40_); |
| 35536 | _tmp42_ = _tmp41_; |
| 35537 | base_iface = G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, BALA_TYPE_INTERFACE, BalaInterface)(((BalaInterface*) g_type_check_instance_cast ((GTypeInstance *) (_tmp42_), ((bala_interface_get_type ()))))); |
| 35538 | _tmp43_ = base_iface; |
| 35539 | _tmp44_ = bala_ccode_base_module_get_this_interface_cexpression (self, _tmp43_); |
| 35540 | _bala_ccode_node_unref0 (vcast)((vcast == ((void*)0)) ? ((void*)0) : (vcast = (bala_ccode_node_unref (vcast), ((void*)0)))); |
| 35541 | vcast = _tmp44_; |
| 35542 | } |
| 35543 | } |
| 35544 | _tmp45_ = vcast; |
| 35545 | if (_tmp45_ != NULL((void*)0)) { |
| 35546 | BalaCCodeFunctionCall* ccall = NULL((void*)0); |
| 35547 | BalaCCodeExpression* _tmp46_; |
| 35548 | const gchar* _tmp47_; |
| 35549 | const gchar* _tmp48_; |
| 35550 | gchar* _tmp49_; |
| 35551 | gchar* _tmp50_; |
| 35552 | BalaCCodeMemberAccess* _tmp51_; |
| 35553 | BalaCCodeMemberAccess* _tmp52_; |
| 35554 | BalaCCodeFunctionCall* _tmp53_; |
| 35555 | BalaCCodeFunctionCall* _tmp54_; |
| 35556 | BalaCCodeFunctionCall* _tmp55_; |
| 35557 | BalaCCodeExpression* _tmp56_; |
| 35558 | BalaCCodeExpression* _tmp57_; |
| 35559 | BalaCCodeExpression* cexpr = NULL((void*)0); |
| 35560 | BalaCCodeExpression* _tmp58_; |
| 35561 | BalaCCodeExpression* _tmp59_; |
| 35562 | BalaDataType* _tmp60_; |
| 35563 | BalaDataType* _tmp61_; |
| 35564 | BalaCCodeFunctionCall* _tmp71_; |
| 35565 | BalaCCodeExpression* _tmp72_; |
| 35566 | BalaCCodeFunction* _tmp73_; |
| 35567 | BalaCCodeFunction* _tmp74_; |
| 35568 | BalaCCodeFunctionCall* _tmp75_; |
| 35569 | _tmp46_ = vcast; |
| 35570 | _tmp47_ = bala_symbol_get_name ((BalaSymbol*) prop); |
| 35571 | _tmp48_ = _tmp47_; |
| 35572 | _tmp49_ = g_strdup_printf ("set_%s", _tmp48_); |
| 35573 | _tmp50_ = _tmp49_; |
| 35574 | _tmp51_ = bala_ccode_member_access_new_pointer (_tmp46_, _tmp50_); |
| 35575 | _tmp52_ = _tmp51_; |
| 35576 | _tmp53_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp52_); |
| 35577 | _tmp54_ = _tmp53_; |
| 35578 | _bala_ccode_node_unref0 (_tmp52_)((_tmp52_ == ((void*)0)) ? ((void*)0) : (_tmp52_ = (bala_ccode_node_unref (_tmp52_), ((void*)0)))); |
| 35579 | _g_free0 (_tmp50_)(_tmp50_ = (g_free (_tmp50_), ((void*)0))); |
| 35580 | ccall = _tmp54_; |
| 35581 | _tmp55_ = ccall; |
| 35582 | _tmp56_ = bala_ccode_base_module_get_ccodenode (self, instance); |
| 35583 | _tmp57_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, BALA_TYPE_CCODE_EXPRESSION, BalaCCodeExpression)(((BalaCCodeExpression*) g_type_check_instance_cast ((GTypeInstance *) (_tmp56_), ((bala_ccode_expression_get_type ()))))); |
| 35584 | bala_ccode_function_call_add_argument (_tmp55_, _tmp57_); |
| 35585 | _bala_ccode_node_unref0 (_tmp57_)((_tmp57_ == ((void*)0)) ? ((void*)0) : (_tmp57_ = (bala_ccode_node_unref (_tmp57_), ((void*)0)))); |
| 35586 | _tmp58_ = bala_get_cvalue_ (value); |
| 35587 | _tmp59_ = _bala_ccode_node_ref0 (_tmp58_); |
| 35588 | cexpr = _tmp59_; |
| 35589 | _tmp60_ = bala_property_get_property_type (prop); |
| 35590 | _tmp61_ = _tmp60_; |
| 35591 | if (bala_data_type_is_real_non_null_struct_type (_tmp61_)) { |
| 35592 | gboolean _tmp62_ = FALSE(0); |
| 35593 | BalaCCodeExpression* _tmp63_; |
| 35594 | BalaCCodeExpression* _tmp69_; |
| 35595 | BalaCCodeUnaryExpression* _tmp70_; |
| 35596 | _tmp63_ = cexpr; |
| 35597 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp63_, BALA_TYPE_CCODE_CONSTANT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp63_); GType __t = ((bala_ccode_constant_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 35598 | _tmp62_ = TRUE(!(0)); |
| 35599 | } else { |
| 35600 | BalaCCodeExpression* _tmp64_; |
| 35601 | _tmp64_ = cexpr; |
| 35602 | _tmp62_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp64_, BALA_TYPE_CCODE_IDENTIFIER)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp64_); GType __t = ((bala_ccode_identifier_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 35603 | } |
| 35604 | if (!_tmp62_) { |
| 35605 | BalaTargetValue* temp_value = NULL((void*)0); |
| 35606 | BalaTargetValue* _tmp65_; |
| 35607 | BalaTargetValue* _tmp66_; |
| 35608 | BalaCCodeExpression* _tmp67_; |
| 35609 | BalaCCodeExpression* _tmp68_; |
| 35610 | _tmp65_ = bala_ccode_base_module_store_temp_value (self, value, (BalaCodeNode*) instance, NULL((void*)0)); |
| 35611 | temp_value = _tmp65_; |
| 35612 | _tmp66_ = temp_value; |
| 35613 | _tmp67_ = bala_get_cvalue_ (_tmp66_); |
| 35614 | _tmp68_ = _bala_ccode_node_ref0 (_tmp67_); |
| 35615 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 35616 | cexpr = _tmp68_; |
| 35617 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 35618 | } |
| 35619 | _tmp69_ = cexpr; |
| 35620 | _tmp70_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp69_); |
| 35621 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 35622 | cexpr = (BalaCCodeExpression*) _tmp70_; |
| 35623 | } |
| 35624 | _tmp71_ = ccall; |
| 35625 | _tmp72_ = cexpr; |
| 35626 | bala_ccode_function_call_add_argument (_tmp71_, _tmp72_); |
| 35627 | _tmp73_ = bala_ccode_base_module_get_ccode (self); |
| 35628 | _tmp74_ = _tmp73_; |
| 35629 | _tmp75_ = ccall; |
| 35630 | bala_ccode_function_add_expression (_tmp74_, (BalaCCodeExpression*) _tmp75_); |
| 35631 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 35632 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 35633 | } else { |
| 35634 | BalaSourceReference* _tmp76_; |
| 35635 | BalaSourceReference* _tmp77_; |
| 35636 | BalaProperty* _tmp78_; |
| 35637 | gchar* _tmp79_; |
| 35638 | gchar* _tmp80_; |
| 35639 | gchar* _tmp81_; |
| 35640 | gchar* _tmp82_; |
| 35641 | _tmp76_ = bala_code_node_get_source_reference ((BalaCodeNode*) instance); |
| 35642 | _tmp77_ = _tmp76_; |
| 35643 | _tmp78_ = base_prop; |
| 35644 | _tmp79_ = bala_symbol_get_full_name ((BalaSymbol*) _tmp78_); |
| 35645 | _tmp80_ = _tmp79_; |
| 35646 | _tmp81_ = g_strdup_printf ("internal: Invalid assignment to `%s'", _tmp80_); |
| 35647 | _tmp82_ = _tmp81_; |
| 35648 | bala_report_error (_tmp77_, _tmp82_); |
| 35649 | _g_free0 (_tmp82_)(_tmp82_ = (g_free (_tmp82_), ((void*)0))); |
| 35650 | _g_free0 (_tmp80_)(_tmp80_ = (g_free (_tmp80_), ((void*)0))); |
| 35651 | } |
| 35652 | _bala_ccode_node_unref0 (vcast)((vcast == ((void*)0)) ? ((void*)0) : (vcast = (bala_ccode_node_unref (vcast), ((void*)0)))); |
| 35653 | return; |
| 35654 | } |
| 35655 | _tmp83_ = g_strdup ("g_object_set"); |
| 35656 | set_func = _tmp83_; |
| 35657 | if (!bala_get_ccode_no_accessor_method (prop)) { |
| 35658 | if (G_TYPE_CHECK_INSTANCE_TYPE (prop, BALA_TYPE_DYNAMIC_PROPERTY)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( prop); GType __t = ((bala_dynamic_property_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 35659 | gchar* _tmp84_; |
| 35660 | _tmp84_ = bala_ccode_base_module_get_dynamic_property_setter_cname (self, G_TYPE_CHECK_INSTANCE_CAST (prop, BALA_TYPE_DYNAMIC_PROPERTY, BalaDynamicProperty)(((BalaDynamicProperty*) g_type_check_instance_cast ((GTypeInstance *) (prop), ((bala_dynamic_property_get_type ())))))); |
| 35661 | _g_free0 (set_func)(set_func = (g_free (set_func), ((void*)0))); |
| 35662 | set_func = _tmp84_; |
| 35663 | } else { |
| 35664 | BalaProperty* _tmp85_; |
| 35665 | BalaPropertyAccessor* _tmp86_; |
| 35666 | BalaPropertyAccessor* _tmp87_; |
| 35667 | BalaCCodeFile* _tmp88_; |
| 35668 | BalaProperty* _tmp89_; |
| 35669 | BalaPropertyAccessor* _tmp90_; |
| 35670 | BalaPropertyAccessor* _tmp91_; |
| 35671 | gchar* _tmp92_; |
| 35672 | gboolean _tmp93_ = FALSE(0); |
| 35673 | gboolean _tmp94_; |
| 35674 | gboolean _tmp95_; |
| 35675 | _tmp85_ = base_prop; |
| 35676 | _tmp86_ = bala_property_get_set_accessor (_tmp85_); |
| 35677 | _tmp87_ = _tmp86_; |
| 35678 | _tmp88_ = self->cfile; |
| 35679 | bala_ccode_base_module_generate_property_accessor_declaration (self, _tmp87_, _tmp88_); |
| 35680 | _tmp89_ = base_prop; |
| 35681 | _tmp90_ = bala_property_get_set_accessor (_tmp89_); |
| 35682 | _tmp91_ = _tmp90_; |
| 35683 | _tmp92_ = bala_get_ccode_name ((BalaCodeNode*) _tmp91_); |
| 35684 | _g_free0 (set_func)(set_func = (g_free (set_func), ((void*)0))); |
| 35685 | set_func = _tmp92_; |
| 35686 | _tmp94_ = bala_symbol_get_external ((BalaSymbol*) prop); |
| 35687 | _tmp95_ = _tmp94_; |
| 35688 | if (!_tmp95_) { |
| 35689 | gboolean _tmp96_; |
| 35690 | gboolean _tmp97_; |
| 35691 | _tmp96_ = bala_symbol_get_external_package ((BalaSymbol*) prop); |
| 35692 | _tmp97_ = _tmp96_; |
| 35693 | _tmp93_ = _tmp97_; |
| 35694 | } else { |
| 35695 | _tmp93_ = FALSE(0); |
| 35696 | } |
| 35697 | if (_tmp93_) { |
| 35698 | if (bala_ccode_base_module_add_generated_external_symbol (self, (BalaSymbol*) prop)) { |
| 35699 | bala_code_visitor_visit_property ((BalaCodeVisitor*) self, prop); |
| 35700 | } |
| 35701 | } |
| 35702 | } |
| 35703 | } |
| 35704 | _tmp98_ = set_func; |
| 35705 | _tmp99_ = bala_ccode_identifier_new (_tmp98_); |
| 35706 | _tmp100_ = _tmp99_; |
| 35707 | _tmp101_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp100_); |
| 35708 | _tmp102_ = _tmp101_; |
| 35709 | _bala_ccode_node_unref0 (_tmp100_)((_tmp100_ == ((void*)0)) ? ((void*)0) : (_tmp100_ = (bala_ccode_node_unref (_tmp100_), ((void*)0)))); |
| 35710 | ccall = _tmp102_; |
| 35711 | _tmp103_ = bala_property_get_binding (prop); |
| 35712 | _tmp104_ = _tmp103_; |
| 35713 | if (_tmp104_ == BALA_MEMBER_BINDING_INSTANCE) { |
| 35714 | BalaCCodeExpression* cinstance = NULL((void*)0); |
| 35715 | BalaCCodeExpression* _tmp105_; |
| 35716 | gboolean _tmp106_ = FALSE(0); |
| 35717 | BalaSymbol* _tmp107_; |
| 35718 | BalaSymbol* _tmp108_; |
| 35719 | BalaCCodeFunctionCall* _tmp120_; |
| 35720 | BalaCCodeExpression* _tmp121_; |
| 35721 | _tmp105_ = bala_ccode_base_module_get_ccodenode (self, instance); |
| 35722 | cinstance = G_TYPE_CHECK_INSTANCE_CAST (_tmp105_, BALA_TYPE_CCODE_EXPRESSION, BalaCCodeExpression)(((BalaCCodeExpression*) g_type_check_instance_cast ((GTypeInstance *) (_tmp105_), ((bala_ccode_expression_get_type ()))))); |
| 35723 | _tmp107_ = bala_symbol_get_parent_symbol ((BalaSymbol*) prop); |
| 35724 | _tmp108_ = _tmp107_; |
| 35725 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp108_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp108_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 35726 | BalaSymbol* _tmp109_; |
| 35727 | BalaSymbol* _tmp110_; |
| 35728 | _tmp109_ = bala_symbol_get_parent_symbol ((BalaSymbol*) prop); |
| 35729 | _tmp110_ = _tmp109_; |
| 35730 | _tmp106_ = !bala_struct_is_simple_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp110_, BALA_TYPE_STRUCT, BalaStruct)(((BalaStruct*) g_type_check_instance_cast ((GTypeInstance*) ( _tmp110_), ((bala_struct_get_type ())))))); |
| 35731 | } else { |
| 35732 | _tmp106_ = FALSE(0); |
| 35733 | } |
| 35734 | if (_tmp106_) { |
| 35735 | BalaTargetValue* instance_value = NULL((void*)0); |
| 35736 | BalaTargetValue* _tmp111_; |
| 35737 | BalaTargetValue* _tmp112_; |
| 35738 | BalaTargetValue* _tmp113_; |
| 35739 | BalaTargetValue* _tmp114_; |
| 35740 | BalaTargetValue* _tmp117_; |
| 35741 | BalaCCodeExpression* _tmp118_; |
| 35742 | BalaCCodeUnaryExpression* _tmp119_; |
| 35743 | _tmp111_ = bala_expression_get_target_value (instance); |
| 35744 | _tmp112_ = _tmp111_; |
| 35745 | _tmp113_ = _bala_target_value_ref0 (_tmp112_); |
| 35746 | instance_value = _tmp113_; |
| 35747 | _tmp114_ = instance_value; |
| 35748 | if (!bala_get_lvalue (_tmp114_)) { |
| 35749 | BalaTargetValue* _tmp115_; |
| 35750 | BalaTargetValue* _tmp116_; |
| 35751 | _tmp115_ = instance_value; |
| 35752 | _tmp116_ = bala_ccode_base_module_store_temp_value (self, _tmp115_, (BalaCodeNode*) instance, NULL((void*)0)); |
| 35753 | _bala_target_value_unref0 (instance_value)((instance_value == ((void*)0)) ? ((void*)0) : (instance_value = (bala_target_value_unref (instance_value), ((void*)0)))); |
| 35754 | instance_value = _tmp116_; |
| 35755 | } |
| 35756 | _tmp117_ = instance_value; |
| 35757 | _tmp118_ = bala_get_cvalue_ (_tmp117_); |
| 35758 | _tmp119_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp118_); |
| 35759 | _bala_ccode_node_unref0 (cinstance)((cinstance == ((void*)0)) ? ((void*)0) : (cinstance = (bala_ccode_node_unref (cinstance), ((void*)0)))); |
| 35760 | cinstance = (BalaCCodeExpression*) _tmp119_; |
| 35761 | _bala_target_value_unref0 (instance_value)((instance_value == ((void*)0)) ? ((void*)0) : (instance_value = (bala_target_value_unref (instance_value), ((void*)0)))); |
| 35762 | } |
| 35763 | _tmp120_ = ccall; |
| 35764 | _tmp121_ = cinstance; |
| 35765 | bala_ccode_function_call_add_argument (_tmp120_, _tmp121_); |
| 35766 | _bala_ccode_node_unref0 (cinstance)((cinstance == ((void*)0)) ? ((void*)0) : (cinstance = (bala_ccode_node_unref (cinstance), ((void*)0)))); |
| 35767 | } |
| 35768 | if (bala_get_ccode_no_accessor_method (prop)) { |
| 35769 | BalaCCodeFunctionCall* _tmp122_; |
| 35770 | BalaCCodeConstant* _tmp123_; |
| 35771 | BalaCCodeConstant* _tmp124_; |
| 35772 | _tmp122_ = ccall; |
| 35773 | _tmp123_ = bala_ccode_base_module_get_property_canonical_cconstant (self, prop); |
| 35774 | _tmp124_ = _tmp123_; |
| 35775 | bala_ccode_function_call_add_argument (_tmp122_, (BalaCCodeExpression*) _tmp124_); |
| 35776 | _bala_ccode_node_unref0 (_tmp124_)((_tmp124_ == ((void*)0)) ? ((void*)0) : (_tmp124_ = (bala_ccode_node_unref (_tmp124_), ((void*)0)))); |
| 35777 | } |
| 35778 | _tmp125_ = bala_get_cvalue_ (value); |
| 35779 | _tmp126_ = _bala_ccode_node_ref0 (_tmp125_); |
| 35780 | cexpr = _tmp126_; |
| 35781 | _tmp127_ = bala_property_get_property_type (prop); |
| 35782 | _tmp128_ = _tmp127_; |
| 35783 | if (bala_data_type_is_real_non_null_struct_type (_tmp128_)) { |
| 35784 | gboolean _tmp129_ = FALSE(0); |
| 35785 | BalaCCodeExpression* _tmp130_; |
| 35786 | BalaCCodeExpression* _tmp136_; |
| 35787 | BalaCCodeUnaryExpression* _tmp137_; |
| 35788 | _tmp130_ = cexpr; |
| 35789 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp130_, BALA_TYPE_CCODE_CONSTANT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp130_); GType __t = ((bala_ccode_constant_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 35790 | _tmp129_ = TRUE(!(0)); |
| 35791 | } else { |
| 35792 | BalaCCodeExpression* _tmp131_; |
| 35793 | _tmp131_ = cexpr; |
| 35794 | _tmp129_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp131_, BALA_TYPE_CCODE_IDENTIFIER)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp131_); GType __t = ((bala_ccode_identifier_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0) ); else __r = g_type_check_instance_is_a (__inst, __t); __r; } ))); |
| 35795 | } |
| 35796 | if (!_tmp129_) { |
| 35797 | BalaTargetValue* temp_value = NULL((void*)0); |
| 35798 | BalaTargetValue* _tmp132_; |
| 35799 | BalaTargetValue* _tmp133_; |
| 35800 | BalaCCodeExpression* _tmp134_; |
| 35801 | BalaCCodeExpression* _tmp135_; |
| 35802 | _tmp132_ = bala_ccode_base_module_store_temp_value (self, value, (BalaCodeNode*) instance, NULL((void*)0)); |
| 35803 | temp_value = _tmp132_; |
| 35804 | _tmp133_ = temp_value; |
| 35805 | _tmp134_ = bala_get_cvalue_ (_tmp133_); |
| 35806 | _tmp135_ = _bala_ccode_node_ref0 (_tmp134_); |
| 35807 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 35808 | cexpr = _tmp135_; |
| 35809 | _bala_target_value_unref0 (temp_value)((temp_value == ((void*)0)) ? ((void*)0) : (temp_value = (bala_target_value_unref (temp_value), ((void*)0)))); |
| 35810 | } |
| 35811 | _tmp136_ = cexpr; |
| 35812 | _tmp137_ = bala_ccode_unary_expression_new (BALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp136_); |
| 35813 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 35814 | cexpr = (BalaCCodeExpression*) _tmp137_; |
| 35815 | } |
| 35816 | _tmp138_ = bala_property_get_property_type (prop); |
| 35817 | _tmp139_ = _tmp138_; |
| 35818 | _tmp140_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp139_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp139_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) _tmp139_) : NULL((void*)0)); |
| 35819 | array_type = _tmp140_; |
| 35820 | _tmp141_ = ccall; |
| 35821 | _tmp142_ = cexpr; |
| 35822 | bala_ccode_function_call_add_argument (_tmp141_, _tmp142_); |
| 35823 | _tmp144_ = array_type; |
| 35824 | if (_tmp144_ != NULL((void*)0)) { |
| 35825 | _tmp143_ = bala_get_ccode_array_length ((BalaCodeNode*) prop); |
| 35826 | } else { |
| 35827 | _tmp143_ = FALSE(0); |
| 35828 | } |
| 35829 | if (_tmp143_) { |
| 35830 | { |
| 35831 | gint dim = 0; |
| 35832 | dim = 1; |
| 35833 | { |
| 35834 | gboolean _tmp145_ = FALSE(0); |
| 35835 | _tmp145_ = TRUE(!(0)); |
| 35836 | while (TRUE(!(0))) { |
| 35837 | BalaArrayType* _tmp147_; |
| 35838 | gint _tmp148_; |
| 35839 | gint _tmp149_; |
| 35840 | BalaCCodeFunctionCall* _tmp150_; |
| 35841 | BalaCCodeExpression* _tmp151_; |
| 35842 | BalaCCodeExpression* _tmp152_; |
| 35843 | if (!_tmp145_) { |
| 35844 | gint _tmp146_; |
| 35845 | _tmp146_ = dim; |
| 35846 | dim = _tmp146_ + 1; |
| 35847 | } |
| 35848 | _tmp145_ = FALSE(0); |
| 35849 | _tmp147_ = array_type; |
| 35850 | _tmp148_ = bala_array_type_get_rank (_tmp147_); |
| 35851 | _tmp149_ = _tmp148_; |
| 35852 | if (!(dim <= _tmp149_)) { |
| 35853 | break; |
| 35854 | } |
| 35855 | _tmp150_ = ccall; |
| 35856 | _tmp151_ = bala_ccode_base_module_get_array_length_cvalue (self, value, dim); |
| 35857 | _tmp152_ = _tmp151_; |
| 35858 | bala_ccode_function_call_add_argument (_tmp150_, _tmp152_); |
| 35859 | _bala_ccode_node_unref0 (_tmp152_)((_tmp152_ == ((void*)0)) ? ((void*)0) : (_tmp152_ = (bala_ccode_node_unref (_tmp152_), ((void*)0)))); |
| 35860 | } |
| 35861 | } |
| 35862 | } |
| 35863 | } else { |
| 35864 | BalaDataType* _tmp153_; |
| 35865 | BalaDataType* _tmp154_; |
| 35866 | _tmp153_ = bala_property_get_property_type (prop); |
| 35867 | _tmp154_ = _tmp153_; |
| 35868 | if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp154_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp154_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 35869 | BalaDelegateType* delegate_type = NULL((void*)0); |
| 35870 | BalaDataType* _tmp155_; |
| 35871 | BalaDataType* _tmp156_; |
| 35872 | BalaDelegateType* _tmp157_; |
| 35873 | gboolean _tmp158_ = FALSE(0); |
| 35874 | _tmp155_ = bala_property_get_property_type (prop); |
| 35875 | _tmp156_ = _tmp155_; |
| 35876 | _tmp157_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp156_, BALA_TYPE_DELEGATE_TYPE, BalaDelegateType)(((BalaDelegateType*) g_type_check_instance_cast ((GTypeInstance *) (_tmp156_), ((bala_delegate_type_get_type ())))))); |
| 35877 | delegate_type = _tmp157_; |
| 35878 | if (bala_get_ccode_delegate_target ((BalaCodeNode*) prop)) { |
| 35879 | BalaDelegateType* _tmp159_; |
| 35880 | BalaDelegate* _tmp160_; |
| 35881 | BalaDelegate* _tmp161_; |
| 35882 | gboolean _tmp162_; |
| 35883 | gboolean _tmp163_; |
| 35884 | _tmp159_ = delegate_type; |
| 35885 | _tmp160_ = bala_delegate_type_get_delegate_symbol (_tmp159_); |
| 35886 | _tmp161_ = _tmp160_; |
| 35887 | _tmp162_ = bala_delegate_get_has_target (_tmp161_); |
| 35888 | _tmp163_ = _tmp162_; |
| 35889 | _tmp158_ = _tmp163_; |
| 35890 | } else { |
| 35891 | _tmp158_ = FALSE(0); |
| 35892 | } |
| 35893 | if (_tmp158_) { |
| 35894 | BalaCCodeFunctionCall* _tmp164_; |
| 35895 | BalaCCodeExpression* _tmp165_; |
| 35896 | BalaCCodeExpression* _tmp166_; |
| 35897 | BalaProperty* _tmp167_; |
| 35898 | BalaPropertyAccessor* _tmp168_; |
| 35899 | BalaPropertyAccessor* _tmp169_; |
| 35900 | BalaDataType* _tmp170_; |
| 35901 | BalaDataType* _tmp171_; |
| 35902 | gboolean _tmp172_; |
| 35903 | gboolean _tmp173_; |
| 35904 | _tmp164_ = ccall; |
| 35905 | _tmp165_ = bala_ccode_base_module_get_delegate_target_cvalue (self, value); |
| 35906 | _tmp166_ = _tmp165_; |
| 35907 | bala_ccode_function_call_add_argument (_tmp164_, _tmp166_); |
| 35908 | _bala_ccode_node_unref0 (_tmp166_)((_tmp166_ == ((void*)0)) ? ((void*)0) : (_tmp166_ = (bala_ccode_node_unref (_tmp166_), ((void*)0)))); |
| 35909 | _tmp167_ = base_prop; |
| 35910 | _tmp168_ = bala_property_get_set_accessor (_tmp167_); |
| 35911 | _tmp169_ = _tmp168_; |
| 35912 | _tmp170_ = bala_property_accessor_get_value_type (_tmp169_); |
| 35913 | _tmp171_ = _tmp170_; |
| 35914 | _tmp172_ = bala_data_type_get_value_owned (_tmp171_); |
| 35915 | _tmp173_ = _tmp172_; |
| 35916 | if (_tmp173_) { |
| 35917 | BalaCCodeFunctionCall* _tmp174_; |
| 35918 | BalaCCodeExpression* _tmp175_; |
| 35919 | BalaCCodeExpression* _tmp176_; |
| 35920 | _tmp174_ = ccall; |
| 35921 | _tmp175_ = bala_ccode_base_module_get_delegate_target_destroy_notify_cvalue (self, value); |
| 35922 | _tmp176_ = _tmp175_; |
| 35923 | bala_ccode_function_call_add_argument (_tmp174_, _tmp176_); |
| 35924 | _bala_ccode_node_unref0 (_tmp176_)((_tmp176_ == ((void*)0)) ? ((void*)0) : (_tmp176_ = (bala_ccode_node_unref (_tmp176_), ((void*)0)))); |
| 35925 | } |
| 35926 | } |
| 35927 | _bala_code_node_unref0 (delegate_type)((delegate_type == ((void*)0)) ? ((void*)0) : (delegate_type = (bala_code_node_unref (delegate_type), ((void*)0)))); |
| 35928 | } |
| 35929 | } |
| 35930 | if (bala_get_ccode_no_accessor_method (prop)) { |
| 35931 | BalaCCodeFunctionCall* _tmp177_; |
| 35932 | BalaCCodeConstant* _tmp178_; |
| 35933 | BalaCCodeConstant* _tmp179_; |
| 35934 | _tmp177_ = ccall; |
| 35935 | _tmp178_ = bala_ccode_constant_new ("NULL"); |
| 35936 | _tmp179_ = _tmp178_; |
| 35937 | bala_ccode_function_call_add_argument (_tmp177_, (BalaCCodeExpression*) _tmp179_); |
| 35938 | _bala_ccode_node_unref0 (_tmp179_)((_tmp179_ == ((void*)0)) ? ((void*)0) : (_tmp179_ = (bala_ccode_node_unref (_tmp179_), ((void*)0)))); |
| 35939 | } |
| 35940 | _tmp180_ = bala_ccode_base_module_get_ccode (self); |
| 35941 | _tmp181_ = _tmp180_; |
| 35942 | _tmp182_ = ccall; |
| 35943 | bala_ccode_function_add_expression (_tmp181_, (BalaCCodeExpression*) _tmp182_); |
| 35944 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 35945 | _bala_ccode_node_unref0 (cexpr)((cexpr == ((void*)0)) ? ((void*)0) : (cexpr = (bala_ccode_node_unref (cexpr), ((void*)0)))); |
| 35946 | _bala_ccode_node_unref0 (ccall)((ccall == ((void*)0)) ? ((void*)0) : (ccall = (bala_ccode_node_unref (ccall), ((void*)0)))); |
| 35947 | _g_free0 (set_func)(set_func = (g_free (set_func), ((void*)0))); |
| 35948 | } |
| 35949 | |
| 35950 | gboolean |
| 35951 | bala_ccode_base_module_add_wrapper (BalaCCodeBaseModule* self, |
| 35952 | const gchar* wrapper_name) |
| 35953 | { |
| 35954 | BalaSet* _tmp0_; |
| 35955 | gboolean result = FALSE(0); |
| 35956 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 35957 | g_return_val_if_fail (wrapper_name != NULL, FALSE)do { if ((wrapper_name != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "wrapper_name != NULL" ); return ((0)); } } while (0); |
| 35958 | _tmp0_ = self->wrappers; |
| 35959 | result = bala_collection_add ((BalaCollection*) _tmp0_, wrapper_name); |
| 35960 | return result; |
| 35961 | } |
| 35962 | |
| 35963 | gboolean |
| 35964 | bala_ccode_base_module_add_generated_external_symbol (BalaCCodeBaseModule* self, |
| 35965 | BalaSymbol* external_symbol) |
| 35966 | { |
| 35967 | BalaSet* _tmp0_; |
| 35968 | gboolean result = FALSE(0); |
| 35969 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 35970 | g_return_val_if_fail (external_symbol != NULL, FALSE)do { if ((external_symbol != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "external_symbol != NULL" ); return ((0)); } } while (0); |
| 35971 | _tmp0_ = self->priv->generated_external_symbols; |
| 35972 | result = bala_collection_add ((BalaCollection*) _tmp0_, external_symbol); |
| 35973 | return result; |
| 35974 | } |
| 35975 | |
| 35976 | BalaDataType* |
| 35977 | bala_ccode_base_module_get_callable_creturn_type (BalaCallable* c) |
| 35978 | { |
| 35979 | gboolean _tmp0_ = FALSE(0); |
| 35980 | BalaDataType* creturn_type = NULL((void*)0); |
| 35981 | BalaDataType* _tmp1_; |
| 35982 | BalaDataType* _tmp2_; |
| 35983 | BalaDataType* _tmp3_; |
| 35984 | BalaDataType* result = NULL((void*)0); |
| 35985 | g_return_val_if_fail (c != NULL, NULL)do { if ((c != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "c != NULL"); return (((void*)0)); } } while (0); |
| 35986 | if (G_TYPE_CHECK_INSTANCE_TYPE (c, BALA_TYPE_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( c); GType __t = ((bala_method_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst ->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 35987 | _tmp0_ = TRUE(!(0)); |
| 35988 | } else { |
| 35989 | _tmp0_ = G_TYPE_CHECK_INSTANCE_TYPE (c, BALA_TYPE_DELEGATE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( c); GType __t = ((bala_delegate_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst ->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 35990 | } |
| 35991 | _bala_assert (_tmp0_, "c is Method || c is Delegate")if (_tmp0_) ; else g_assertion_message_expr ("bala-ccodegen", "balaccodebasemodule.c", 35991, ((const char*) (__func__)), "c is Method || c is Delegate" );; |
| 35992 | _tmp1_ = bala_callable_get_return_type (c); |
| 35993 | _tmp2_ = _tmp1_; |
| 35994 | _tmp3_ = bala_data_type_copy (_tmp2_); |
| 35995 | creturn_type = _tmp3_; |
| 35996 | if (G_TYPE_CHECK_INSTANCE_TYPE (c, BALA_TYPE_CREATION_METHOD)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( c); GType __t = ((bala_creation_method_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 35997 | BalaClass* cl = NULL((void*)0); |
| 35998 | BalaSymbol* _tmp4_; |
| 35999 | BalaSymbol* _tmp5_; |
| 36000 | BalaStruct* st = NULL((void*)0); |
| 36001 | BalaSymbol* _tmp6_; |
| 36002 | BalaSymbol* _tmp7_; |
| 36003 | BalaClass* _tmp8_; |
| 36004 | _tmp4_ = bala_symbol_get_parent_symbol ((BalaSymbol*) c); |
| 36005 | _tmp5_ = _tmp4_; |
| 36006 | cl = G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, BALA_TYPE_CLASS)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp5_); GType __t = ((bala_class_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaClass*) _tmp5_) : NULL((void*)0); |
| 36007 | _tmp6_ = bala_symbol_get_parent_symbol ((BalaSymbol*) c); |
| 36008 | _tmp7_ = _tmp6_; |
| 36009 | st = G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp7_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp7_) : NULL((void*)0); |
| 36010 | _tmp8_ = cl; |
| 36011 | if (_tmp8_ != NULL((void*)0)) { |
| 36012 | BalaClass* _tmp9_; |
| 36013 | BalaObjectType* _tmp10_; |
| 36014 | _tmp9_ = cl; |
| 36015 | _tmp10_ = bala_object_type_new ((BalaObjectTypeSymbol*) _tmp9_); |
| 36016 | _bala_code_node_unref0 (creturn_type)((creturn_type == ((void*)0)) ? ((void*)0) : (creturn_type = ( bala_code_node_unref (creturn_type), ((void*)0)))); |
| 36017 | creturn_type = (BalaDataType*) _tmp10_; |
| 36018 | } else { |
| 36019 | gboolean _tmp11_ = FALSE(0); |
| 36020 | BalaStruct* _tmp12_; |
| 36021 | _tmp12_ = st; |
| 36022 | if (_tmp12_ != NULL((void*)0)) { |
| 36023 | BalaStruct* _tmp13_; |
| 36024 | _tmp13_ = st; |
| 36025 | _tmp11_ = bala_struct_is_simple_type (_tmp13_); |
| 36026 | } else { |
| 36027 | _tmp11_ = FALSE(0); |
| 36028 | } |
| 36029 | if (_tmp11_) { |
| 36030 | BalaStruct* _tmp14_; |
| 36031 | BalaStructValueType* _tmp15_; |
| 36032 | _tmp14_ = st; |
| 36033 | _tmp15_ = bala_struct_value_type_new (_tmp14_); |
| 36034 | _bala_code_node_unref0 (creturn_type)((creturn_type == ((void*)0)) ? ((void*)0) : (creturn_type = ( bala_code_node_unref (creturn_type), ((void*)0)))); |
| 36035 | creturn_type = (BalaDataType*) _tmp15_; |
| 36036 | } |
| 36037 | } |
| 36038 | } else { |
| 36039 | BalaDataType* _tmp16_; |
| 36040 | BalaDataType* _tmp17_; |
| 36041 | _tmp16_ = bala_callable_get_return_type (c); |
| 36042 | _tmp17_ = _tmp16_; |
| 36043 | if (bala_data_type_is_real_non_null_struct_type (_tmp17_)) { |
| 36044 | BalaVoidType* _tmp18_; |
| 36045 | _tmp18_ = bala_void_type_new (NULL((void*)0)); |
| 36046 | _bala_code_node_unref0 (creturn_type)((creturn_type == ((void*)0)) ? ((void*)0) : (creturn_type = ( bala_code_node_unref (creturn_type), ((void*)0)))); |
| 36047 | creturn_type = (BalaDataType*) _tmp18_; |
| 36048 | } |
| 36049 | } |
| 36050 | result = creturn_type; |
| 36051 | return result; |
| 36052 | } |
| 36053 | |
| 36054 | BalaCCodeExpression* |
| 36055 | bala_ccode_base_module_default_value_for_type (BalaCCodeBaseModule* self, |
| 36056 | BalaDataType* type, |
| 36057 | gboolean initializer_expression, |
| 36058 | gboolean on_error) |
| 36059 | { |
| 36060 | BalaStruct* st = NULL((void*)0); |
| 36061 | BalaTypeSymbol* _tmp0_; |
| 36062 | BalaTypeSymbol* _tmp1_; |
| 36063 | BalaArrayType* array_type = NULL((void*)0); |
| 36064 | BalaArrayType* _tmp2_; |
| 36065 | gboolean _tmp3_ = FALSE(0); |
| 36066 | gboolean _tmp4_ = FALSE(0); |
| 36067 | BalaTypeSymbol* _tmp5_; |
| 36068 | BalaTypeSymbol* _tmp6_; |
| 36069 | BalaCCodeExpression* result = NULL((void*)0); |
| 36070 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 36071 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 36072 | _tmp0_ = bala_data_type_get_type_symbol (type); |
| 36073 | _tmp1_ = _tmp0_; |
| 36074 | st = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp1_) : NULL((void*)0); |
| 36075 | _tmp2_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_array_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) type) : NULL((void*)0)); |
| 36076 | array_type = _tmp2_; |
| 36077 | _tmp5_ = bala_data_type_get_type_symbol (type); |
| 36078 | _tmp6_ = _tmp5_; |
| 36079 | if (_tmp6_ != NULL((void*)0)) { |
| 36080 | gboolean _tmp7_; |
| 36081 | gboolean _tmp8_; |
| 36082 | _tmp7_ = bala_data_type_get_nullable (type); |
| 36083 | _tmp8_ = _tmp7_; |
| 36084 | _tmp4_ = !_tmp8_; |
| 36085 | } else { |
| 36086 | _tmp4_ = FALSE(0); |
| 36087 | } |
| 36088 | if (_tmp4_) { |
| 36089 | gchar* _tmp9_ = NULL((void*)0); |
| 36090 | if (on_error) { |
| 36091 | BalaTypeSymbol* _tmp10_; |
| 36092 | BalaTypeSymbol* _tmp11_; |
| 36093 | gchar* _tmp12_; |
| 36094 | _tmp10_ = bala_data_type_get_type_symbol (type); |
| 36095 | _tmp11_ = _tmp10_; |
| 36096 | _tmp12_ = bala_get_ccode_default_value_on_error (_tmp11_); |
| 36097 | _g_free0 (_tmp9_)(_tmp9_ = (g_free (_tmp9_), ((void*)0))); |
| 36098 | _tmp9_ = _tmp12_; |
| 36099 | } else { |
| 36100 | BalaTypeSymbol* _tmp13_; |
| 36101 | BalaTypeSymbol* _tmp14_; |
| 36102 | gchar* _tmp15_; |
| 36103 | _tmp13_ = bala_data_type_get_type_symbol (type); |
| 36104 | _tmp14_ = _tmp13_; |
| 36105 | _tmp15_ = bala_get_ccode_default_value (_tmp14_); |
| 36106 | _g_free0 (_tmp9_)(_tmp9_ = (g_free (_tmp9_), ((void*)0))); |
| 36107 | _tmp9_ = _tmp15_; |
| 36108 | } |
| 36109 | _tmp3_ = g_strcmp0 (_tmp9_, "") != 0; |
| 36110 | _g_free0 (_tmp9_)(_tmp9_ = (g_free (_tmp9_), ((void*)0))); |
| 36111 | } else { |
| 36112 | _tmp3_ = FALSE(0); |
| 36113 | } |
| 36114 | if (_tmp3_) { |
| 36115 | gchar* _tmp16_ = NULL((void*)0); |
| 36116 | BalaCCodeConstant* _tmp23_; |
| 36117 | if (on_error) { |
| 36118 | BalaTypeSymbol* _tmp17_; |
| 36119 | BalaTypeSymbol* _tmp18_; |
| 36120 | gchar* _tmp19_; |
| 36121 | _tmp17_ = bala_data_type_get_type_symbol (type); |
| 36122 | _tmp18_ = _tmp17_; |
| 36123 | _tmp19_ = bala_get_ccode_default_value_on_error (_tmp18_); |
| 36124 | _g_free0 (_tmp16_)(_tmp16_ = (g_free (_tmp16_), ((void*)0))); |
| 36125 | _tmp16_ = _tmp19_; |
| 36126 | } else { |
| 36127 | BalaTypeSymbol* _tmp20_; |
| 36128 | BalaTypeSymbol* _tmp21_; |
| 36129 | gchar* _tmp22_; |
| 36130 | _tmp20_ = bala_data_type_get_type_symbol (type); |
| 36131 | _tmp21_ = _tmp20_; |
| 36132 | _tmp22_ = bala_get_ccode_default_value (_tmp21_); |
| 36133 | _g_free0 (_tmp16_)(_tmp16_ = (g_free (_tmp16_), ((void*)0))); |
| 36134 | _tmp16_ = _tmp22_; |
| 36135 | } |
| 36136 | _tmp23_ = bala_ccode_constant_new (_tmp16_); |
| 36137 | result = (BalaCCodeExpression*) _tmp23_; |
| 36138 | _g_free0 (_tmp16_)(_tmp16_ = (g_free (_tmp16_), ((void*)0))); |
| 36139 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36140 | return result; |
| 36141 | } else { |
| 36142 | gboolean _tmp24_ = FALSE(0); |
| 36143 | gboolean _tmp25_ = FALSE(0); |
| 36144 | if (initializer_expression) { |
| 36145 | gboolean _tmp26_; |
| 36146 | gboolean _tmp27_; |
| 36147 | _tmp26_ = bala_data_type_get_nullable (type); |
| 36148 | _tmp27_ = _tmp26_; |
| 36149 | _tmp25_ = !_tmp27_; |
| 36150 | } else { |
| 36151 | _tmp25_ = FALSE(0); |
| 36152 | } |
| 36153 | if (_tmp25_) { |
| 36154 | gboolean _tmp28_ = FALSE(0); |
| 36155 | BalaStruct* _tmp29_; |
| 36156 | _tmp29_ = st; |
| 36157 | if (_tmp29_ != NULL((void*)0)) { |
| 36158 | _tmp28_ = TRUE(!(0)); |
| 36159 | } else { |
| 36160 | gboolean _tmp30_ = FALSE(0); |
| 36161 | BalaArrayType* _tmp31_; |
| 36162 | _tmp31_ = array_type; |
| 36163 | if (_tmp31_ != NULL((void*)0)) { |
| 36164 | BalaArrayType* _tmp32_; |
| 36165 | gboolean _tmp33_; |
| 36166 | gboolean _tmp34_; |
| 36167 | _tmp32_ = array_type; |
| 36168 | _tmp33_ = bala_array_type_get_fixed_length (_tmp32_); |
| 36169 | _tmp34_ = _tmp33_; |
| 36170 | _tmp30_ = _tmp34_; |
| 36171 | } else { |
| 36172 | _tmp30_ = FALSE(0); |
| 36173 | } |
| 36174 | _tmp28_ = _tmp30_; |
| 36175 | } |
| 36176 | _tmp24_ = _tmp28_; |
| 36177 | } else { |
| 36178 | _tmp24_ = FALSE(0); |
| 36179 | } |
| 36180 | if (_tmp24_) { |
| 36181 | BalaCCodeInitializerList* clist = NULL((void*)0); |
| 36182 | BalaCCodeInitializerList* _tmp35_; |
| 36183 | BalaCCodeInitializerList* _tmp36_; |
| 36184 | BalaCCodeConstant* _tmp37_; |
| 36185 | BalaCCodeConstant* _tmp38_; |
| 36186 | _tmp35_ = bala_ccode_initializer_list_new (); |
| 36187 | clist = _tmp35_; |
| 36188 | _tmp36_ = clist; |
| 36189 | _tmp37_ = bala_ccode_constant_new ("0"); |
| 36190 | _tmp38_ = _tmp37_; |
| 36191 | bala_ccode_initializer_list_append (_tmp36_, (BalaCCodeExpression*) _tmp38_); |
| 36192 | _bala_ccode_node_unref0 (_tmp38_)((_tmp38_ == ((void*)0)) ? ((void*)0) : (_tmp38_ = (bala_ccode_node_unref (_tmp38_), ((void*)0)))); |
| 36193 | result = (BalaCCodeExpression*) clist; |
| 36194 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36195 | return result; |
| 36196 | } else { |
| 36197 | gboolean _tmp39_ = FALSE(0); |
| 36198 | gboolean _tmp40_ = FALSE(0); |
| 36199 | gboolean _tmp41_ = FALSE(0); |
| 36200 | gboolean _tmp42_ = FALSE(0); |
| 36201 | gboolean _tmp43_ = FALSE(0); |
| 36202 | BalaTypeSymbol* _tmp44_; |
| 36203 | BalaTypeSymbol* _tmp45_; |
| 36204 | _tmp44_ = bala_data_type_get_type_symbol (type); |
| 36205 | _tmp45_ = _tmp44_; |
| 36206 | if (_tmp45_ != NULL((void*)0)) { |
| 36207 | BalaTypeSymbol* _tmp46_; |
| 36208 | BalaTypeSymbol* _tmp47_; |
| 36209 | _tmp46_ = bala_data_type_get_type_symbol (type); |
| 36210 | _tmp47_ = _tmp46_; |
| 36211 | _tmp43_ = bala_typesymbol_is_reference_type (_tmp47_); |
| 36212 | } else { |
| 36213 | _tmp43_ = FALSE(0); |
| 36214 | } |
| 36215 | if (_tmp43_) { |
| 36216 | _tmp42_ = TRUE(!(0)); |
| 36217 | } else { |
| 36218 | gboolean _tmp48_; |
| 36219 | gboolean _tmp49_; |
| 36220 | _tmp48_ = bala_data_type_get_nullable (type); |
| 36221 | _tmp49_ = _tmp48_; |
| 36222 | _tmp42_ = _tmp49_; |
| 36223 | } |
| 36224 | if (_tmp42_) { |
| 36225 | _tmp41_ = TRUE(!(0)); |
| 36226 | } else { |
| 36227 | _tmp41_ = G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_POINTER_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_pointer_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 36228 | } |
| 36229 | if (_tmp41_) { |
| 36230 | _tmp40_ = TRUE(!(0)); |
| 36231 | } else { |
| 36232 | _tmp40_ = G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))); |
| 36233 | } |
| 36234 | if (_tmp40_) { |
| 36235 | _tmp39_ = TRUE(!(0)); |
| 36236 | } else { |
| 36237 | gboolean _tmp50_ = FALSE(0); |
| 36238 | BalaArrayType* _tmp51_; |
| 36239 | _tmp51_ = array_type; |
| 36240 | if (_tmp51_ != NULL((void*)0)) { |
| 36241 | BalaArrayType* _tmp52_; |
| 36242 | gboolean _tmp53_; |
| 36243 | gboolean _tmp54_; |
| 36244 | _tmp52_ = array_type; |
| 36245 | _tmp53_ = bala_array_type_get_fixed_length (_tmp52_); |
| 36246 | _tmp54_ = _tmp53_; |
| 36247 | _tmp50_ = !_tmp54_; |
| 36248 | } else { |
| 36249 | _tmp50_ = FALSE(0); |
| 36250 | } |
| 36251 | _tmp39_ = _tmp50_; |
| 36252 | } |
| 36253 | if (_tmp39_) { |
| 36254 | BalaCCodeConstant* _tmp55_; |
| 36255 | _tmp55_ = bala_ccode_constant_new ("NULL"); |
| 36256 | result = (BalaCCodeExpression*) _tmp55_; |
| 36257 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36258 | return result; |
| 36259 | } else { |
| 36260 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_GENERIC_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_generic_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 36261 | BalaCCodeConstant* _tmp56_; |
| 36262 | _tmp56_ = bala_ccode_constant_new ("NULL"); |
| 36263 | result = (BalaCCodeExpression*) _tmp56_; |
| 36264 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36265 | return result; |
| 36266 | } else { |
| 36267 | if (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ERROR_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_error_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 36268 | BalaCCodeConstant* _tmp57_; |
| 36269 | _tmp57_ = bala_ccode_constant_new ("NULL"); |
| 36270 | result = (BalaCCodeExpression*) _tmp57_; |
| 36271 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36272 | return result; |
| 36273 | } else { |
| 36274 | if (BALA_IS_CTYPE (type)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( (type)); GType __t = ((bala_ctype_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))) { |
| 36275 | const gchar* _tmp58_; |
| 36276 | const gchar* _tmp59_; |
| 36277 | BalaCCodeConstant* _tmp60_; |
| 36278 | _tmp58_ = bala_ctype_get_cdefault_value (G_TYPE_CHECK_INSTANCE_CAST (type, BALA_TYPE_CTYPE, BalaCType)(((BalaCType*) g_type_check_instance_cast ((GTypeInstance*) ( type), ((bala_ctype_get_type ())))))); |
| 36279 | _tmp59_ = _tmp58_; |
| 36280 | _tmp60_ = bala_ccode_constant_new (_tmp59_); |
| 36281 | result = (BalaCCodeExpression*) _tmp60_; |
| 36282 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36283 | return result; |
| 36284 | } |
| 36285 | } |
| 36286 | } |
| 36287 | } |
| 36288 | } |
| 36289 | } |
| 36290 | result = NULL((void*)0); |
| 36291 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36292 | return result; |
| 36293 | } |
| 36294 | |
| 36295 | static void |
| 36296 | bala_ccode_base_module_create_property_type_check_statement (BalaCCodeBaseModule* self, |
| 36297 | BalaProperty* prop, |
| 36298 | gboolean check_return_type, |
| 36299 | BalaTypeSymbol* t, |
| 36300 | gboolean non_null, |
| 36301 | const gchar* var_name) |
| 36302 | { |
| 36303 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 36304 | g_return_if_fail (prop != NULL)do { if ((prop != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "prop != NULL" ); return; } } while (0); |
| 36305 | g_return_if_fail (t != NULL)do { if ((t != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "t != NULL"); return ; } } while (0); |
| 36306 | g_return_if_fail (var_name != NULL)do { if ((var_name != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "var_name != NULL" ); return; } } while (0); |
| 36307 | if (check_return_type) { |
| 36308 | BalaDataType* _tmp0_; |
| 36309 | BalaDataType* _tmp1_; |
| 36310 | _tmp0_ = bala_property_get_property_type (prop); |
| 36311 | _tmp1_ = _tmp0_; |
| 36312 | bala_ccode_base_module_create_type_check_statement (self, (BalaCodeNode*) prop, _tmp1_, t, non_null, var_name); |
| 36313 | } else { |
| 36314 | BalaVoidType* _tmp2_; |
| 36315 | BalaVoidType* _tmp3_; |
| 36316 | _tmp2_ = bala_void_type_new (NULL((void*)0)); |
| 36317 | _tmp3_ = _tmp2_; |
| 36318 | bala_ccode_base_module_create_type_check_statement (self, (BalaCodeNode*) prop, (BalaDataType*) _tmp3_, t, non_null, var_name); |
| 36319 | _bala_code_node_unref0 (_tmp3_)((_tmp3_ == ((void*)0)) ? ((void*)0) : (_tmp3_ = (bala_code_node_unref (_tmp3_), ((void*)0)))); |
| 36320 | } |
| 36321 | } |
| 36322 | |
| 36323 | static void |
| 36324 | bala_ccode_base_module_real_create_type_check_statement (BalaCCodeBaseModule* self, |
| 36325 | BalaCodeNode* method_node, |
| 36326 | BalaDataType* ret_type, |
| 36327 | BalaTypeSymbol* t, |
| 36328 | gboolean non_null, |
| 36329 | const gchar* var_name) |
| 36330 | { |
| 36331 | g_return_if_fail (method_node != NULL)do { if ((method_node != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "method_node != NULL" ); return; } } while (0); |
| 36332 | g_return_if_fail (ret_type != NULL)do { if ((ret_type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "ret_type != NULL" ); return; } } while (0); |
| 36333 | g_return_if_fail (t != NULL)do { if ((t != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "t != NULL"); return ; } } while (0); |
| 36334 | g_return_if_fail (var_name != NULL)do { if ((var_name != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "var_name != NULL" ); return; } } while (0); |
| 36335 | } |
| 36336 | |
| 36337 | void |
| 36338 | bala_ccode_base_module_create_type_check_statement (BalaCCodeBaseModule* self, |
| 36339 | BalaCodeNode* method_node, |
| 36340 | BalaDataType* ret_type, |
| 36341 | BalaTypeSymbol* t, |
| 36342 | gboolean non_null, |
| 36343 | const gchar* var_name) |
| 36344 | { |
| 36345 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 36346 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->create_type_check_statement (self, method_node, ret_type, t, non_null, var_name); |
| 36347 | } |
| 36348 | |
| 36349 | gint |
| 36350 | bala_ccode_base_module_get_param_pos (BalaCCodeBaseModule* self, |
| 36351 | gdouble param_pos, |
| 36352 | gboolean ellipsis) |
| 36353 | { |
| 36354 | gint result = 0; |
| 36355 | g_return_val_if_fail (self != NULL, 0)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (0); } } while (0); |
| 36356 | if (!ellipsis) { |
| 36357 | if (param_pos >= ((gdouble) 0)) { |
| 36358 | result = (gint) (param_pos * 1000); |
| 36359 | return result; |
| 36360 | } else { |
| 36361 | result = (gint) ((100 + param_pos) * 1000); |
| 36362 | return result; |
| 36363 | } |
| 36364 | } else { |
| 36365 | if (param_pos >= ((gdouble) 0)) { |
| 36366 | result = (gint) ((100 + param_pos) * 1000); |
| 36367 | return result; |
| 36368 | } else { |
| 36369 | result = (gint) ((200 + param_pos) * 1000); |
| 36370 | return result; |
| 36371 | } |
| 36372 | } |
| 36373 | } |
| 36374 | |
| 36375 | BalaCCodeExpression* |
| 36376 | bala_ccode_base_module_get_ccodenode (BalaCCodeBaseModule* self, |
| 36377 | BalaExpression* node) |
| 36378 | { |
| 36379 | BalaCCodeExpression* _tmp0_; |
| 36380 | BalaCCodeExpression* _tmp1_; |
| 36381 | BalaCCodeExpression* _tmp2_; |
| 36382 | BalaCCodeExpression* result = NULL((void*)0); |
| 36383 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 36384 | g_return_val_if_fail (node != NULL, NULL)do { if ((node != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "node != NULL" ); return (((void*)0)); } } while (0); |
| 36385 | _tmp0_ = bala_get_cvalue (node); |
| 36386 | if (_tmp0_ == NULL((void*)0)) { |
| 36387 | bala_code_node_emit ((BalaCodeNode*) node, (BalaCodeGenerator*) self); |
| 36388 | } |
| 36389 | _tmp1_ = bala_get_cvalue (node); |
| 36390 | _tmp2_ = _bala_ccode_node_ref0 (_tmp1_); |
| 36391 | result = _tmp2_; |
| 36392 | return result; |
| 36393 | } |
| 36394 | |
| 36395 | gboolean |
| 36396 | bala_ccode_base_module_is_lvalue_access_allowed (BalaCCodeBaseModule* self, |
| 36397 | BalaDataType* type) |
| 36398 | { |
| 36399 | BalaArrayType* array_type = NULL((void*)0); |
| 36400 | BalaArrayType* _tmp0_; |
| 36401 | gboolean _tmp1_ = FALSE(0); |
| 36402 | BalaArrayType* _tmp2_; |
| 36403 | BalaTypeSymbol* _tmp6_; |
| 36404 | BalaTypeSymbol* _tmp7_; |
| 36405 | gboolean result = FALSE(0); |
| 36406 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 36407 | g_return_val_if_fail (type != NULL, FALSE)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return ((0)); } } while (0); |
| 36408 | _tmp0_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_array_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) type) : NULL((void*)0)); |
| 36409 | array_type = _tmp0_; |
| 36410 | _tmp2_ = array_type; |
| 36411 | if (_tmp2_ != NULL((void*)0)) { |
| 36412 | BalaArrayType* _tmp3_; |
| 36413 | gboolean _tmp4_; |
| 36414 | gboolean _tmp5_; |
| 36415 | _tmp3_ = array_type; |
| 36416 | _tmp4_ = bala_array_type_get_inline_allocated (_tmp3_); |
| 36417 | _tmp5_ = _tmp4_; |
| 36418 | _tmp1_ = _tmp5_; |
| 36419 | } else { |
| 36420 | _tmp1_ = FALSE(0); |
| 36421 | } |
| 36422 | if (_tmp1_) { |
| 36423 | result = FALSE(0); |
| 36424 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36425 | return result; |
| 36426 | } |
| 36427 | _tmp6_ = bala_data_type_get_type_symbol (type); |
| 36428 | _tmp7_ = _tmp6_; |
| 36429 | if (_tmp7_ != NULL((void*)0)) { |
| 36430 | BalaTypeSymbol* _tmp8_; |
| 36431 | BalaTypeSymbol* _tmp9_; |
| 36432 | _tmp8_ = bala_data_type_get_type_symbol (type); |
| 36433 | _tmp9_ = _tmp8_; |
| 36434 | result = bala_code_node_get_attribute_bool ((BalaCodeNode*) _tmp9_, "CCode", "lvalue_access", TRUE(!(0))); |
| 36435 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36436 | return result; |
| 36437 | } |
| 36438 | result = TRUE(!(0)); |
| 36439 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36440 | return result; |
| 36441 | } |
| 36442 | |
| 36443 | gboolean |
| 36444 | bala_ccode_base_module_requires_memset_init (BalaCCodeBaseModule* self, |
| 36445 | BalaVariable* variable, |
| 36446 | BalaCCodeExpression* * size) |
| 36447 | { |
| 36448 | BalaCCodeExpression* _bala_size = NULL((void*)0); |
| 36449 | BalaArrayType* array_type = NULL((void*)0); |
| 36450 | BalaDataType* _tmp0_; |
| 36451 | BalaDataType* _tmp1_; |
| 36452 | gboolean _tmp2_ = FALSE(0); |
| 36453 | BalaArrayType* _tmp3_; |
| 36454 | gboolean result = FALSE(0); |
| 36455 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 36456 | g_return_val_if_fail (variable != NULL, FALSE)do { if ((variable != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "variable != NULL" ); return ((0)); } } while (0); |
| 36457 | _tmp0_ = bala_variable_get_variable_type (variable); |
| 36458 | _tmp1_ = _tmp0_; |
| 36459 | array_type = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1_); GType __t = ((bala_array_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) _tmp1_) : NULL((void*)0); |
| 36460 | _tmp3_ = array_type; |
| 36461 | if (_tmp3_ != NULL((void*)0)) { |
| 36462 | BalaArrayType* _tmp4_; |
| 36463 | gboolean _tmp5_; |
| 36464 | gboolean _tmp6_; |
| 36465 | _tmp4_ = array_type; |
| 36466 | _tmp5_ = bala_array_type_get_fixed_length (_tmp4_); |
| 36467 | _tmp6_ = _tmp5_; |
| 36468 | _tmp2_ = _tmp6_; |
| 36469 | } else { |
| 36470 | _tmp2_ = FALSE(0); |
| 36471 | } |
| 36472 | if (_tmp2_) { |
| 36473 | BalaCCodeFunctionCall* sizeof_call = NULL((void*)0); |
| 36474 | BalaCCodeIdentifier* _tmp7_; |
| 36475 | BalaCCodeIdentifier* _tmp8_; |
| 36476 | BalaCCodeFunctionCall* _tmp9_; |
| 36477 | BalaCCodeFunctionCall* _tmp10_; |
| 36478 | BalaCCodeFunctionCall* _tmp11_; |
| 36479 | BalaArrayType* _tmp12_; |
| 36480 | BalaDataType* _tmp13_; |
| 36481 | BalaDataType* _tmp14_; |
| 36482 | gchar* _tmp15_; |
| 36483 | gchar* _tmp16_; |
| 36484 | BalaCCodeIdentifier* _tmp17_; |
| 36485 | BalaCCodeIdentifier* _tmp18_; |
| 36486 | BalaArrayType* _tmp19_; |
| 36487 | BalaExpression* _tmp20_; |
| 36488 | BalaExpression* _tmp21_; |
| 36489 | BalaCCodeExpression* _tmp22_; |
| 36490 | BalaCCodeExpression* _tmp23_; |
| 36491 | BalaCCodeFunctionCall* _tmp24_; |
| 36492 | BalaCCodeBinaryExpression* _tmp25_; |
| 36493 | BalaArrayType* _tmp26_; |
| 36494 | BalaExpression* _tmp27_; |
| 36495 | BalaExpression* _tmp28_; |
| 36496 | _tmp7_ = bala_ccode_identifier_new ("sizeof"); |
| 36497 | _tmp8_ = _tmp7_; |
| 36498 | _tmp9_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp8_); |
| 36499 | _tmp10_ = _tmp9_; |
| 36500 | _bala_ccode_node_unref0 (_tmp8_)((_tmp8_ == ((void*)0)) ? ((void*)0) : (_tmp8_ = (bala_ccode_node_unref (_tmp8_), ((void*)0)))); |
| 36501 | sizeof_call = _tmp10_; |
| 36502 | _tmp11_ = sizeof_call; |
| 36503 | _tmp12_ = array_type; |
| 36504 | _tmp13_ = bala_array_type_get_element_type (_tmp12_); |
| 36505 | _tmp14_ = _tmp13_; |
| 36506 | _tmp15_ = bala_get_ccode_name ((BalaCodeNode*) _tmp14_); |
| 36507 | _tmp16_ = _tmp15_; |
| 36508 | _tmp17_ = bala_ccode_identifier_new (_tmp16_); |
| 36509 | _tmp18_ = _tmp17_; |
| 36510 | bala_ccode_function_call_add_argument (_tmp11_, (BalaCCodeExpression*) _tmp18_); |
| 36511 | _bala_ccode_node_unref0 (_tmp18_)((_tmp18_ == ((void*)0)) ? ((void*)0) : (_tmp18_ = (bala_ccode_node_unref (_tmp18_), ((void*)0)))); |
| 36512 | _g_free0 (_tmp16_)(_tmp16_ = (g_free (_tmp16_), ((void*)0))); |
| 36513 | _tmp19_ = array_type; |
| 36514 | _tmp20_ = bala_array_type_get_length (_tmp19_); |
| 36515 | _tmp21_ = _tmp20_; |
| 36516 | _tmp22_ = bala_ccode_base_module_get_ccodenode (self, _tmp21_); |
| 36517 | _tmp23_ = _tmp22_; |
| 36518 | _tmp24_ = sizeof_call; |
| 36519 | _tmp25_ = bala_ccode_binary_expression_new (BALA_CCODE_BINARY_OPERATOR_MUL, _tmp23_, (BalaCCodeExpression*) _tmp24_); |
| 36520 | _bala_ccode_node_unref0 (_bala_size)((_bala_size == ((void*)0)) ? ((void*)0) : (_bala_size = (bala_ccode_node_unref (_bala_size), ((void*)0)))); |
| 36521 | _bala_size = (BalaCCodeExpression*) _tmp25_; |
| 36522 | _bala_ccode_node_unref0 (_tmp23_)((_tmp23_ == ((void*)0)) ? ((void*)0) : (_tmp23_ = (bala_ccode_node_unref (_tmp23_), ((void*)0)))); |
| 36523 | _tmp26_ = array_type; |
| 36524 | _tmp27_ = bala_array_type_get_length (_tmp26_); |
| 36525 | _tmp28_ = _tmp27_; |
| 36526 | result = !bala_ccode_base_module_is_constant_ccode ((BalaCodeNode*) _tmp28_); |
| 36527 | _bala_ccode_node_unref0 (sizeof_call)((sizeof_call == ((void*)0)) ? ((void*)0) : (sizeof_call = (bala_ccode_node_unref (sizeof_call), ((void*)0)))); |
| 36528 | if (size) { |
| 36529 | *size = _bala_size; |
| 36530 | } else { |
| 36531 | _bala_ccode_node_unref0 (_bala_size)((_bala_size == ((void*)0)) ? ((void*)0) : (_bala_size = (bala_ccode_node_unref (_bala_size), ((void*)0)))); |
| 36532 | } |
| 36533 | return result; |
| 36534 | } |
| 36535 | _bala_ccode_node_unref0 (_bala_size)((_bala_size == ((void*)0)) ? ((void*)0) : (_bala_size = (bala_ccode_node_unref (_bala_size), ((void*)0)))); |
| 36536 | _bala_size = NULL((void*)0); |
| 36537 | result = FALSE(0); |
| 36538 | if (size) { |
| 36539 | *size = _bala_size; |
| 36540 | } else { |
| 36541 | _bala_ccode_node_unref0 (_bala_size)((_bala_size == ((void*)0)) ? ((void*)0) : (_bala_size = (bala_ccode_node_unref (_bala_size), ((void*)0)))); |
| 36542 | } |
| 36543 | return result; |
| 36544 | } |
| 36545 | |
| 36546 | BalaCCodeDeclaratorSuffix* |
| 36547 | bala_ccode_base_module_get_ccode_declarator_suffix (BalaCCodeBaseModule* self, |
| 36548 | BalaDataType* type) |
| 36549 | { |
| 36550 | BalaArrayType* array_type = NULL((void*)0); |
| 36551 | BalaArrayType* _tmp0_; |
| 36552 | BalaArrayType* _tmp1_; |
| 36553 | BalaCCodeDeclaratorSuffix* result = NULL((void*)0); |
| 36554 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 36555 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 36556 | _tmp0_ = _bala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (type, BALA_TYPE_ARRAY_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( type); GType __t = ((bala_array_type_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaArrayType*) type) : NULL((void*)0)); |
| 36557 | array_type = _tmp0_; |
| 36558 | _tmp1_ = array_type; |
| 36559 | if (_tmp1_ != NULL((void*)0)) { |
| 36560 | BalaArrayType* _tmp2_; |
| 36561 | gboolean _tmp3_; |
| 36562 | gboolean _tmp4_; |
| 36563 | _tmp2_ = array_type; |
| 36564 | _tmp3_ = bala_array_type_get_fixed_length (_tmp2_); |
| 36565 | _tmp4_ = _tmp3_; |
| 36566 | if (_tmp4_) { |
| 36567 | BalaArrayType* _tmp5_; |
| 36568 | BalaExpression* _tmp6_; |
| 36569 | BalaExpression* _tmp7_; |
| 36570 | BalaCCodeExpression* _tmp8_; |
| 36571 | BalaCCodeExpression* _tmp9_; |
| 36572 | BalaCCodeDeclaratorSuffix* _tmp10_; |
| 36573 | BalaCCodeDeclaratorSuffix* _tmp11_; |
| 36574 | _tmp5_ = array_type; |
| 36575 | _tmp6_ = bala_array_type_get_length (_tmp5_); |
| 36576 | _tmp7_ = _tmp6_; |
| 36577 | _tmp8_ = bala_ccode_base_module_get_ccodenode (self, _tmp7_); |
| 36578 | _tmp9_ = _tmp8_; |
| 36579 | _tmp10_ = bala_ccode_declarator_suffix_new_with_array (_tmp9_); |
| 36580 | _tmp11_ = _tmp10_; |
| 36581 | _bala_ccode_node_unref0 (_tmp9_)((_tmp9_ == ((void*)0)) ? ((void*)0) : (_tmp9_ = (bala_ccode_node_unref (_tmp9_), ((void*)0)))); |
| 36582 | result = _tmp11_; |
| 36583 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36584 | return result; |
| 36585 | } else { |
| 36586 | BalaArrayType* _tmp12_; |
| 36587 | gboolean _tmp13_; |
| 36588 | gboolean _tmp14_; |
| 36589 | _tmp12_ = array_type; |
| 36590 | _tmp13_ = bala_array_type_get_inline_allocated (_tmp12_); |
| 36591 | _tmp14_ = _tmp13_; |
| 36592 | if (_tmp14_) { |
| 36593 | BalaCCodeDeclaratorSuffix* _tmp15_; |
| 36594 | _tmp15_ = bala_ccode_declarator_suffix_new_with_array (NULL((void*)0)); |
| 36595 | result = _tmp15_; |
| 36596 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36597 | return result; |
| 36598 | } |
| 36599 | } |
| 36600 | } |
| 36601 | result = NULL((void*)0); |
| 36602 | _bala_code_node_unref0 (array_type)((array_type == ((void*)0)) ? ((void*)0) : (array_type = (bala_code_node_unref (array_type), ((void*)0)))); |
| 36603 | return result; |
| 36604 | } |
| 36605 | |
| 36606 | BalaCCodeConstant* |
| 36607 | bala_ccode_base_module_get_signal_canonical_constant (BalaCCodeBaseModule* self, |
| 36608 | BalaSignal* sig, |
| 36609 | const gchar* detail) |
| 36610 | { |
| 36611 | gchar* _tmp0_ = NULL((void*)0); |
| 36612 | gchar* _tmp3_; |
| 36613 | gchar* _tmp4_; |
| 36614 | gchar* _tmp5_; |
| 36615 | gchar* _tmp6_; |
| 36616 | BalaCCodeConstant* _tmp7_; |
| 36617 | BalaCCodeConstant* _tmp8_; |
| 36618 | BalaCCodeConstant* result = NULL((void*)0); |
| 36619 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 36620 | g_return_val_if_fail (sig != NULL, NULL)do { if ((sig != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "sig != NULL") ; return (((void*)0)); } } while (0); |
| 36621 | if (detail != NULL((void*)0)) { |
| 36622 | gchar* _tmp1_; |
| 36623 | _tmp1_ = g_strdup_printf ("::%s", detail); |
| 36624 | _g_free0 (_tmp0_)(_tmp0_ = (g_free (_tmp0_), ((void*)0))); |
| 36625 | _tmp0_ = _tmp1_; |
| 36626 | } else { |
| 36627 | gchar* _tmp2_; |
| 36628 | _tmp2_ = g_strdup (""); |
| 36629 | _g_free0 (_tmp0_)(_tmp0_ = (g_free (_tmp0_), ((void*)0))); |
| 36630 | _tmp0_ = _tmp2_; |
| 36631 | } |
| 36632 | _tmp3_ = bala_get_ccode_name ((BalaCodeNode*) sig); |
| 36633 | _tmp4_ = _tmp3_; |
| 36634 | _tmp5_ = g_strdup_printf ("\"%s%s\"", _tmp4_, _tmp0_); |
| 36635 | _tmp6_ = _tmp5_; |
| 36636 | _tmp7_ = bala_ccode_constant_new (_tmp6_); |
| 36637 | _tmp8_ = _tmp7_; |
| 36638 | _g_free0 (_tmp6_)(_tmp6_ = (g_free (_tmp6_), ((void*)0))); |
| 36639 | _g_free0 (_tmp4_)(_tmp4_ = (g_free (_tmp4_), ((void*)0))); |
| 36640 | result = _tmp8_; |
| 36641 | _g_free0 (_tmp0_)(_tmp0_ = (g_free (_tmp0_), ((void*)0))); |
| 36642 | return result; |
| 36643 | } |
| 36644 | |
| 36645 | BalaCCodeConstant* |
| 36646 | bala_ccode_base_module_get_property_canonical_cconstant (BalaCCodeBaseModule* self, |
| 36647 | BalaProperty* prop) |
| 36648 | { |
| 36649 | gchar* _tmp0_; |
| 36650 | gchar* _tmp1_; |
| 36651 | gchar* _tmp2_; |
| 36652 | gchar* _tmp3_; |
| 36653 | BalaCCodeConstant* _tmp4_; |
| 36654 | BalaCCodeConstant* _tmp5_; |
| 36655 | BalaCCodeConstant* result = NULL((void*)0); |
| 36656 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 36657 | g_return_val_if_fail (prop != NULL, NULL)do { if ((prop != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "prop != NULL" ); return (((void*)0)); } } while (0); |
| 36658 | _tmp0_ = bala_get_ccode_name ((BalaCodeNode*) prop); |
| 36659 | _tmp1_ = _tmp0_; |
| 36660 | _tmp2_ = g_strdup_printf ("\"%s\"", _tmp1_); |
| 36661 | _tmp3_ = _tmp2_; |
| 36662 | _tmp4_ = bala_ccode_constant_new (_tmp3_); |
| 36663 | _tmp5_ = _tmp4_; |
| 36664 | _g_free0 (_tmp3_)(_tmp3_ = (g_free (_tmp3_), ((void*)0))); |
| 36665 | _g_free0 (_tmp1_)(_tmp1_ = (g_free (_tmp1_), ((void*)0))); |
| 36666 | result = _tmp5_; |
| 36667 | return result; |
| 36668 | } |
| 36669 | |
| 36670 | static void |
| 36671 | bala_ccode_base_module_real_visit_class (BalaCodeVisitor* base, |
| 36672 | BalaClass* cl) |
| 36673 | { |
| 36674 | BalaCCodeBaseModule * self; |
| 36675 | self = (BalaCCodeBaseModule*) base; |
| 36676 | g_return_if_fail (cl != NULL)do { if ((cl != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "cl != NULL"); return; } } while (0); |
| 36677 | } |
| 36678 | |
| 36679 | void |
| 36680 | bala_ccode_base_module_create_postcondition_statement (BalaCCodeBaseModule* self, |
| 36681 | BalaExpression* postcondition) |
| 36682 | { |
| 36683 | BalaCCodeFunctionCall* cassert = NULL((void*)0); |
| 36684 | BalaCCodeIdentifier* _tmp0_; |
| 36685 | BalaCCodeIdentifier* _tmp1_; |
| 36686 | BalaCCodeFunctionCall* _tmp2_; |
| 36687 | BalaCCodeFunctionCall* _tmp3_; |
| 36688 | gchar* message = NULL((void*)0); |
| 36689 | BalaSourceReference* _tmp4_; |
| 36690 | BalaSourceReference* _tmp5_; |
| 36691 | BalaSourceLocation _tmp6_ = {0}; |
| 36692 | BalaSourceLocation _tmp7_; |
| 36693 | gchar* _tmp8_; |
| 36694 | BalaSourceReference* _tmp9_; |
| 36695 | BalaSourceReference* _tmp10_; |
| 36696 | BalaSourceLocation _tmp11_ = {0}; |
| 36697 | BalaSourceLocation _tmp12_; |
| 36698 | gchar* _tmp13_; |
| 36699 | BalaSourceReference* _tmp14_; |
| 36700 | BalaSourceReference* _tmp15_; |
| 36701 | BalaSourceLocation _tmp16_ = {0}; |
| 36702 | BalaSourceLocation _tmp17_; |
| 36703 | gchar* _tmp18_; |
| 36704 | gchar* _tmp19_; |
| 36705 | BalaCCodeFunctionCall* _tmp20_; |
| 36706 | BalaCCodeExpression* _tmp21_; |
| 36707 | BalaCCodeFunctionCall* _tmp22_; |
| 36708 | const gchar* _tmp23_; |
| 36709 | gchar* _tmp24_; |
| 36710 | gchar* _tmp25_; |
| 36711 | gchar* _tmp26_; |
| 36712 | gchar* _tmp27_; |
| 36713 | gchar* _tmp28_; |
| 36714 | gchar* _tmp29_; |
| 36715 | BalaCCodeConstant* _tmp30_; |
| 36716 | BalaCCodeConstant* _tmp31_; |
| 36717 | BalaCCodeFunction* _tmp32_; |
| 36718 | BalaCCodeFunction* _tmp33_; |
| 36719 | BalaCCodeFunctionCall* _tmp34_; |
| 36720 | BalaArrayList* _tmp50_; |
| 36721 | BalaArrayList* _tmp51_; |
| 36722 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 36723 | g_return_if_fail (postcondition != NULL)do { if ((postcondition != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "postcondition != NULL" ); return; } } while (0); |
| 36724 | _tmp0_ = bala_ccode_identifier_new ("_bala_warn_if_fail"); |
| 36725 | _tmp1_ = _tmp0_; |
| 36726 | _tmp2_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp1_); |
| 36727 | _tmp3_ = _tmp2_; |
| 36728 | _bala_ccode_node_unref0 (_tmp1_)((_tmp1_ == ((void*)0)) ? ((void*)0) : (_tmp1_ = (bala_ccode_node_unref (_tmp1_), ((void*)0)))); |
| 36729 | cassert = _tmp3_; |
| 36730 | bala_code_node_emit ((BalaCodeNode*) postcondition, (BalaCodeGenerator*) self); |
| 36731 | _tmp4_ = bala_code_node_get_source_reference ((BalaCodeNode*) postcondition); |
| 36732 | _tmp5_ = _tmp4_; |
| 36733 | bala_source_reference_get_begin (_tmp5_, &_tmp6_); |
| 36734 | _tmp7_ = _tmp6_; |
| 36735 | _tmp8_ = _tmp7_.pos; |
| 36736 | _tmp9_ = bala_code_node_get_source_reference ((BalaCodeNode*) postcondition); |
| 36737 | _tmp10_ = _tmp9_; |
| 36738 | bala_source_reference_get_end (_tmp10_, &_tmp11_); |
| 36739 | _tmp12_ = _tmp11_; |
| 36740 | _tmp13_ = _tmp12_.pos; |
| 36741 | _tmp14_ = bala_code_node_get_source_reference ((BalaCodeNode*) postcondition); |
| 36742 | _tmp15_ = _tmp14_; |
| 36743 | bala_source_reference_get_begin (_tmp15_, &_tmp16_); |
| 36744 | _tmp17_ = _tmp16_; |
| 36745 | _tmp18_ = _tmp17_.pos; |
| 36746 | _tmp19_ = string_substring ((const gchar*) _tmp8_, (glong) 0, (glong) ((gint) (_tmp13_ - _tmp18_))); |
| 36747 | message = _tmp19_; |
| 36748 | _tmp20_ = cassert; |
| 36749 | _tmp21_ = bala_get_cvalue (postcondition); |
| 36750 | bala_ccode_function_call_add_argument (_tmp20_, _tmp21_); |
| 36751 | _tmp22_ = cassert; |
| 36752 | _tmp23_ = message; |
| 36753 | _tmp24_ = string_replace (_tmp23_, "\n", " "); |
| 36754 | _tmp25_ = _tmp24_; |
| 36755 | _tmp26_ = g_strescape (_tmp25_, ""); |
| 36756 | _tmp27_ = _tmp26_; |
| 36757 | _tmp28_ = g_strdup_printf ("\"%s\"", _tmp27_); |
| 36758 | _tmp29_ = _tmp28_; |
| 36759 | _tmp30_ = bala_ccode_constant_new (_tmp29_); |
| 36760 | _tmp31_ = _tmp30_; |
| 36761 | bala_ccode_function_call_add_argument (_tmp22_, (BalaCCodeExpression*) _tmp31_); |
| 36762 | _bala_ccode_node_unref0 (_tmp31_)((_tmp31_ == ((void*)0)) ? ((void*)0) : (_tmp31_ = (bala_ccode_node_unref (_tmp31_), ((void*)0)))); |
| 36763 | _g_free0 (_tmp29_)(_tmp29_ = (g_free (_tmp29_), ((void*)0))); |
| 36764 | _g_free0 (_tmp27_)(_tmp27_ = (g_free (_tmp27_), ((void*)0))); |
| 36765 | _g_free0 (_tmp25_)(_tmp25_ = (g_free (_tmp25_), ((void*)0))); |
| 36766 | self->requires_assert = TRUE(!(0)); |
| 36767 | _tmp32_ = bala_ccode_base_module_get_ccode (self); |
| 36768 | _tmp33_ = _tmp32_; |
| 36769 | _tmp34_ = cassert; |
| 36770 | bala_ccode_function_add_expression (_tmp33_, (BalaCCodeExpression*) _tmp34_); |
| 36771 | { |
| 36772 | BalaArrayList* _value_list = NULL((void*)0); |
| 36773 | BalaArrayList* _tmp35_; |
| 36774 | BalaArrayList* _tmp36_; |
| 36775 | BalaArrayList* _tmp37_; |
| 36776 | gint _value_size = 0; |
| 36777 | BalaArrayList* _tmp38_; |
| 36778 | gint _tmp39_; |
| 36779 | gint _tmp40_; |
| 36780 | gint _value_index = 0; |
| 36781 | _tmp35_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 36782 | _tmp36_ = _tmp35_; |
| 36783 | _tmp37_ = _bala_iterable_ref0 (_tmp36_); |
| 36784 | _value_list = _tmp37_; |
| 36785 | _tmp38_ = _value_list; |
| 36786 | _tmp39_ = bala_collection_get_size ((BalaCollection*) _tmp38_); |
| 36787 | _tmp40_ = _tmp39_; |
| 36788 | _value_size = _tmp40_; |
| 36789 | _value_index = -1; |
| 36790 | while (TRUE(!(0))) { |
| 36791 | gint _tmp41_; |
| 36792 | gint _tmp42_; |
| 36793 | BalaTargetValue* value = NULL((void*)0); |
| 36794 | BalaArrayList* _tmp43_; |
| 36795 | gpointer _tmp44_; |
| 36796 | BalaCCodeFunction* _tmp45_; |
| 36797 | BalaCCodeFunction* _tmp46_; |
| 36798 | BalaTargetValue* _tmp47_; |
| 36799 | BalaCCodeExpression* _tmp48_; |
| 36800 | BalaCCodeExpression* _tmp49_; |
| 36801 | _value_index = _value_index + 1; |
| 36802 | _tmp41_ = _value_index; |
| 36803 | _tmp42_ = _value_size; |
| 36804 | if (!(_tmp41_ < _tmp42_)) { |
| 36805 | break; |
| 36806 | } |
| 36807 | _tmp43_ = _value_list; |
| 36808 | _tmp44_ = bala_list_get ((BalaList*) _tmp43_, _value_index); |
| 36809 | value = (BalaTargetValue*) _tmp44_; |
| 36810 | _tmp45_ = bala_ccode_base_module_get_ccode (self); |
| 36811 | _tmp46_ = _tmp45_; |
| 36812 | _tmp47_ = value; |
| 36813 | _tmp48_ = bala_ccode_base_module_destroy_value (self, _tmp47_, FALSE(0)); |
| 36814 | _tmp49_ = _tmp48_; |
| 36815 | bala_ccode_function_add_expression (_tmp46_, _tmp49_); |
| 36816 | _bala_ccode_node_unref0 (_tmp49_)((_tmp49_ == ((void*)0)) ? ((void*)0) : (_tmp49_ = (bala_ccode_node_unref (_tmp49_), ((void*)0)))); |
| 36817 | _bala_target_value_unref0 (value)((value == ((void*)0)) ? ((void*)0) : (value = (bala_target_value_unref (value), ((void*)0)))); |
| 36818 | } |
| 36819 | _bala_iterable_unref0 (_value_list)((_value_list == ((void*)0)) ? ((void*)0) : (_value_list = (bala_iterable_unref (_value_list), ((void*)0)))); |
| 36820 | } |
| 36821 | _tmp50_ = bala_ccode_base_module_get_temp_ref_values (self); |
| 36822 | _tmp51_ = _tmp50_; |
| 36823 | bala_collection_clear ((BalaCollection*) _tmp51_); |
| 36824 | _g_free0 (message)(message = (g_free (message), ((void*)0))); |
| 36825 | _bala_ccode_node_unref0 (cassert)((cassert == ((void*)0)) ? ((void*)0) : (cassert = (bala_ccode_node_unref (cassert), ((void*)0)))); |
| 36826 | } |
| 36827 | |
| 36828 | BalaDataType* |
| 36829 | bala_ccode_base_module_get_this_type (BalaCCodeBaseModule* self) |
| 36830 | { |
| 36831 | gboolean _tmp0_ = FALSE(0); |
| 36832 | BalaMethod* _tmp1_; |
| 36833 | BalaMethod* _tmp2_; |
| 36834 | BalaDataType* result = NULL((void*)0); |
| 36835 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 36836 | _tmp1_ = bala_ccode_base_module_get_current_method (self); |
| 36837 | _tmp2_ = _tmp1_; |
| 36838 | if (_tmp2_ != NULL((void*)0)) { |
| 36839 | BalaMethod* _tmp3_; |
| 36840 | BalaMethod* _tmp4_; |
| 36841 | BalaMemberBinding _tmp5_; |
| 36842 | BalaMemberBinding _tmp6_; |
| 36843 | _tmp3_ = bala_ccode_base_module_get_current_method (self); |
| 36844 | _tmp4_ = _tmp3_; |
| 36845 | _tmp5_ = bala_method_get_binding (_tmp4_); |
| 36846 | _tmp6_ = _tmp5_; |
| 36847 | _tmp0_ = _tmp6_ == BALA_MEMBER_BINDING_INSTANCE; |
| 36848 | } else { |
| 36849 | _tmp0_ = FALSE(0); |
| 36850 | } |
| 36851 | if (_tmp0_) { |
| 36852 | BalaMethod* _tmp7_; |
| 36853 | BalaMethod* _tmp8_; |
| 36854 | BalaParameter* _tmp9_; |
| 36855 | BalaParameter* _tmp10_; |
| 36856 | BalaDataType* _tmp11_; |
| 36857 | BalaDataType* _tmp12_; |
| 36858 | _tmp7_ = bala_ccode_base_module_get_current_method (self); |
| 36859 | _tmp8_ = _tmp7_; |
| 36860 | _tmp9_ = bala_method_get_this_parameter (_tmp8_); |
| 36861 | _tmp10_ = _tmp9_; |
| 36862 | _tmp11_ = bala_variable_get_variable_type ((BalaVariable*) _tmp10_); |
| 36863 | _tmp12_ = _tmp11_; |
| 36864 | result = _tmp12_; |
| 36865 | return result; |
| 36866 | } else { |
| 36867 | gboolean _tmp13_ = FALSE(0); |
| 36868 | BalaPropertyAccessor* _tmp14_; |
| 36869 | BalaPropertyAccessor* _tmp15_; |
| 36870 | _tmp14_ = bala_ccode_base_module_get_current_property_accessor (self); |
| 36871 | _tmp15_ = _tmp14_; |
| 36872 | if (_tmp15_ != NULL((void*)0)) { |
| 36873 | BalaPropertyAccessor* _tmp16_; |
| 36874 | BalaPropertyAccessor* _tmp17_; |
| 36875 | BalaProperty* _tmp18_; |
| 36876 | BalaProperty* _tmp19_; |
| 36877 | BalaMemberBinding _tmp20_; |
| 36878 | BalaMemberBinding _tmp21_; |
| 36879 | _tmp16_ = bala_ccode_base_module_get_current_property_accessor (self); |
| 36880 | _tmp17_ = _tmp16_; |
| 36881 | _tmp18_ = bala_property_accessor_get_prop (_tmp17_); |
| 36882 | _tmp19_ = _tmp18_; |
| 36883 | _tmp20_ = bala_property_get_binding (_tmp19_); |
| 36884 | _tmp21_ = _tmp20_; |
| 36885 | _tmp13_ = _tmp21_ == BALA_MEMBER_BINDING_INSTANCE; |
| 36886 | } else { |
| 36887 | _tmp13_ = FALSE(0); |
| 36888 | } |
| 36889 | if (_tmp13_) { |
| 36890 | BalaPropertyAccessor* _tmp22_; |
| 36891 | BalaPropertyAccessor* _tmp23_; |
| 36892 | BalaProperty* _tmp24_; |
| 36893 | BalaProperty* _tmp25_; |
| 36894 | BalaParameter* _tmp26_; |
| 36895 | BalaParameter* _tmp27_; |
| 36896 | BalaDataType* _tmp28_; |
| 36897 | BalaDataType* _tmp29_; |
| 36898 | _tmp22_ = bala_ccode_base_module_get_current_property_accessor (self); |
| 36899 | _tmp23_ = _tmp22_; |
| 36900 | _tmp24_ = bala_property_accessor_get_prop (_tmp23_); |
| 36901 | _tmp25_ = _tmp24_; |
| 36902 | _tmp26_ = bala_property_get_this_parameter (_tmp25_); |
| 36903 | _tmp27_ = _tmp26_; |
| 36904 | _tmp28_ = bala_variable_get_variable_type ((BalaVariable*) _tmp27_); |
| 36905 | _tmp29_ = _tmp28_; |
| 36906 | result = _tmp29_; |
| 36907 | return result; |
| 36908 | } else { |
| 36909 | gboolean _tmp30_ = FALSE(0); |
| 36910 | BalaConstructor* _tmp31_; |
| 36911 | BalaConstructor* _tmp32_; |
| 36912 | _tmp31_ = bala_ccode_base_module_get_current_constructor (self); |
| 36913 | _tmp32_ = _tmp31_; |
| 36914 | if (_tmp32_ != NULL((void*)0)) { |
| 36915 | BalaConstructor* _tmp33_; |
| 36916 | BalaConstructor* _tmp34_; |
| 36917 | BalaMemberBinding _tmp35_; |
| 36918 | BalaMemberBinding _tmp36_; |
| 36919 | _tmp33_ = bala_ccode_base_module_get_current_constructor (self); |
| 36920 | _tmp34_ = _tmp33_; |
| 36921 | _tmp35_ = bala_constructor_get_binding (_tmp34_); |
| 36922 | _tmp36_ = _tmp35_; |
| 36923 | _tmp30_ = _tmp36_ == BALA_MEMBER_BINDING_INSTANCE; |
| 36924 | } else { |
| 36925 | _tmp30_ = FALSE(0); |
| 36926 | } |
| 36927 | if (_tmp30_) { |
| 36928 | BalaConstructor* _tmp37_; |
| 36929 | BalaConstructor* _tmp38_; |
| 36930 | BalaParameter* _tmp39_; |
| 36931 | BalaParameter* _tmp40_; |
| 36932 | BalaDataType* _tmp41_; |
| 36933 | BalaDataType* _tmp42_; |
| 36934 | _tmp37_ = bala_ccode_base_module_get_current_constructor (self); |
| 36935 | _tmp38_ = _tmp37_; |
| 36936 | _tmp39_ = bala_constructor_get_this_parameter (_tmp38_); |
| 36937 | _tmp40_ = _tmp39_; |
| 36938 | _tmp41_ = bala_variable_get_variable_type ((BalaVariable*) _tmp40_); |
| 36939 | _tmp42_ = _tmp41_; |
| 36940 | result = _tmp42_; |
| 36941 | return result; |
| 36942 | } else { |
| 36943 | gboolean _tmp43_ = FALSE(0); |
| 36944 | BalaDestructor* _tmp44_; |
| 36945 | BalaDestructor* _tmp45_; |
| 36946 | _tmp44_ = bala_ccode_base_module_get_current_destructor (self); |
| 36947 | _tmp45_ = _tmp44_; |
| 36948 | if (_tmp45_ != NULL((void*)0)) { |
| 36949 | BalaDestructor* _tmp46_; |
| 36950 | BalaDestructor* _tmp47_; |
| 36951 | BalaMemberBinding _tmp48_; |
| 36952 | BalaMemberBinding _tmp49_; |
| 36953 | _tmp46_ = bala_ccode_base_module_get_current_destructor (self); |
| 36954 | _tmp47_ = _tmp46_; |
| 36955 | _tmp48_ = bala_destructor_get_binding (_tmp47_); |
| 36956 | _tmp49_ = _tmp48_; |
| 36957 | _tmp43_ = _tmp49_ == BALA_MEMBER_BINDING_INSTANCE; |
| 36958 | } else { |
| 36959 | _tmp43_ = FALSE(0); |
| 36960 | } |
| 36961 | if (_tmp43_) { |
| 36962 | BalaDestructor* _tmp50_; |
| 36963 | BalaDestructor* _tmp51_; |
| 36964 | BalaParameter* _tmp52_; |
| 36965 | BalaParameter* _tmp53_; |
| 36966 | BalaDataType* _tmp54_; |
| 36967 | BalaDataType* _tmp55_; |
| 36968 | _tmp50_ = bala_ccode_base_module_get_current_destructor (self); |
| 36969 | _tmp51_ = _tmp50_; |
| 36970 | _tmp52_ = bala_destructor_get_this_parameter (_tmp51_); |
| 36971 | _tmp53_ = _tmp52_; |
| 36972 | _tmp54_ = bala_variable_get_variable_type ((BalaVariable*) _tmp53_); |
| 36973 | _tmp55_ = _tmp54_; |
| 36974 | result = _tmp55_; |
| 36975 | return result; |
| 36976 | } |
| 36977 | } |
| 36978 | } |
| 36979 | } |
| 36980 | result = NULL((void*)0); |
| 36981 | return result; |
| 36982 | } |
| 36983 | |
| 36984 | BalaCCodeFunctionCall* |
| 36985 | bala_ccode_base_module_generate_instance_cast (BalaCCodeBaseModule* self, |
| 36986 | BalaCCodeExpression* expr, |
| 36987 | BalaTypeSymbol* type) |
| 36988 | { |
| 36989 | BalaCCodeFunctionCall* _result_ = NULL((void*)0); |
| 36990 | BalaCCodeIdentifier* _tmp0_; |
| 36991 | BalaCCodeIdentifier* _tmp1_; |
| 36992 | BalaCCodeFunctionCall* _tmp2_; |
| 36993 | BalaCCodeFunctionCall* _tmp3_; |
| 36994 | gchar* _tmp4_; |
| 36995 | gchar* _tmp5_; |
| 36996 | BalaCCodeIdentifier* _tmp6_; |
| 36997 | BalaCCodeIdentifier* _tmp7_; |
| 36998 | gchar* _tmp8_; |
| 36999 | gchar* _tmp9_; |
| 37000 | BalaCCodeIdentifier* _tmp10_; |
| 37001 | BalaCCodeIdentifier* _tmp11_; |
| 37002 | BalaCCodeFunctionCall* result = NULL((void*)0); |
| 37003 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37004 | g_return_val_if_fail (expr != NULL, NULL)do { if ((expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "expr != NULL" ); return (((void*)0)); } } while (0); |
| 37005 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 37006 | _tmp0_ = bala_ccode_identifier_new ("G_TYPE_CHECK_INSTANCE_CAST"); |
| 37007 | _tmp1_ = _tmp0_; |
| 37008 | _tmp2_ = bala_ccode_function_call_new ((BalaCCodeExpression*) _tmp1_); |
| 37009 | _tmp3_ = _tmp2_; |
| 37010 | _bala_ccode_node_unref0 (_tmp1_)((_tmp1_ == ((void*)0)) ? ((void*)0) : (_tmp1_ = (bala_ccode_node_unref (_tmp1_), ((void*)0)))); |
| 37011 | _result_ = _tmp3_; |
| 37012 | bala_ccode_function_call_add_argument (_result_, expr); |
| 37013 | _tmp4_ = bala_get_ccode_type_id ((BalaCodeNode*) type); |
| 37014 | _tmp5_ = _tmp4_; |
| 37015 | _tmp6_ = bala_ccode_identifier_new (_tmp5_); |
| 37016 | _tmp7_ = _tmp6_; |
| 37017 | bala_ccode_function_call_add_argument (_result_, (BalaCCodeExpression*) _tmp7_); |
| 37018 | _bala_ccode_node_unref0 (_tmp7_)((_tmp7_ == ((void*)0)) ? ((void*)0) : (_tmp7_ = (bala_ccode_node_unref (_tmp7_), ((void*)0)))); |
| 37019 | _g_free0 (_tmp5_)(_tmp5_ = (g_free (_tmp5_), ((void*)0))); |
| 37020 | _tmp8_ = bala_get_ccode_name ((BalaCodeNode*) type); |
| 37021 | _tmp9_ = _tmp8_; |
| 37022 | _tmp10_ = bala_ccode_identifier_new (_tmp9_); |
| 37023 | _tmp11_ = _tmp10_; |
| 37024 | bala_ccode_function_call_add_argument (_result_, (BalaCCodeExpression*) _tmp11_); |
| 37025 | _bala_ccode_node_unref0 (_tmp11_)((_tmp11_ == ((void*)0)) ? ((void*)0) : (_tmp11_ = (bala_ccode_node_unref (_tmp11_), ((void*)0)))); |
| 37026 | _g_free0 (_tmp9_)(_tmp9_ = (g_free (_tmp9_), ((void*)0))); |
| 37027 | result = _result_; |
| 37028 | return result; |
| 37029 | } |
| 37030 | |
| 37031 | static void |
| 37032 | bala_ccode_base_module_generate_struct_destroy_function (BalaCCodeBaseModule* self, |
| 37033 | BalaStruct* st) |
| 37034 | { |
| 37035 | BalaCCodeFile* _tmp0_; |
| 37036 | gchar* _tmp1_; |
| 37037 | gchar* _tmp2_; |
| 37038 | gboolean _tmp3_; |
| 37039 | BalaCCodeFunction* function = NULL((void*)0); |
| 37040 | gchar* _tmp4_; |
| 37041 | gchar* _tmp5_; |
| 37042 | BalaCCodeFunction* _tmp6_; |
| 37043 | BalaCCodeFunction* _tmp7_; |
| 37044 | BalaCCodeFunction* _tmp8_; |
| 37045 | BalaCCodeFunction* _tmp9_; |
| 37046 | gchar* _tmp10_; |
| 37047 | gchar* _tmp11_; |
| 37048 | gchar* _tmp12_; |
| 37049 | gchar* _tmp13_; |
| 37050 | BalaCCodeParameter* _tmp14_; |
| 37051 | BalaCCodeParameter* _tmp15_; |
| 37052 | BalaCCodeBaseModuleEmitContext* _tmp16_; |
| 37053 | BalaCCodeBaseModuleEmitContext* _tmp17_; |
| 37054 | BalaCCodeFunction* _tmp18_; |
| 37055 | BalaTargetValue* this_value = NULL((void*)0); |
| 37056 | BalaTargetValue* _tmp19_; |
| 37057 | BalaCCodeFile* _tmp47_; |
| 37058 | BalaCCodeFunction* _tmp48_; |
| 37059 | BalaCCodeFile* _tmp49_; |
| 37060 | BalaCCodeFunction* _tmp50_; |
| 37061 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 37062 | g_return_if_fail (st != NULL)do { if ((st != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "st != NULL"); return; } } while (0); |
| 37063 | _tmp0_ = self->cfile; |
| 37064 | _tmp1_ = bala_get_ccode_destroy_function ((BalaTypeSymbol*) st); |
| 37065 | _tmp2_ = _tmp1_; |
| 37066 | _tmp3_ = bala_ccode_file_add_declaration (_tmp0_, _tmp2_); |
| 37067 | _g_free0 (_tmp2_)(_tmp2_ = (g_free (_tmp2_), ((void*)0))); |
| 37068 | if (_tmp3_) { |
| 37069 | return; |
| 37070 | } |
| 37071 | _tmp4_ = bala_get_ccode_destroy_function ((BalaTypeSymbol*) st); |
| 37072 | _tmp5_ = _tmp4_; |
| 37073 | _tmp6_ = bala_ccode_function_new (_tmp5_, "void"); |
| 37074 | _tmp7_ = _tmp6_; |
| 37075 | _g_free0 (_tmp5_)(_tmp5_ = (g_free (_tmp5_), ((void*)0))); |
| 37076 | function = _tmp7_; |
| 37077 | _tmp8_ = function; |
| 37078 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp8_, BALA_CCODE_MODIFIERS_STATIC); |
| 37079 | _tmp9_ = function; |
| 37080 | _tmp10_ = bala_get_ccode_name ((BalaCodeNode*) st); |
| 37081 | _tmp11_ = _tmp10_; |
| 37082 | _tmp12_ = g_strdup_printf ("%s *", _tmp11_); |
| 37083 | _tmp13_ = _tmp12_; |
| 37084 | _tmp14_ = bala_ccode_parameter_new ("self", _tmp13_); |
| 37085 | _tmp15_ = _tmp14_; |
| 37086 | bala_ccode_function_add_parameter (_tmp9_, _tmp15_); |
| 37087 | _bala_ccode_node_unref0 (_tmp15_)((_tmp15_ == ((void*)0)) ? ((void*)0) : (_tmp15_ = (bala_ccode_node_unref (_tmp15_), ((void*)0)))); |
| 37088 | _g_free0 (_tmp13_)(_tmp13_ = (g_free (_tmp13_), ((void*)0))); |
| 37089 | _g_free0 (_tmp11_)(_tmp11_ = (g_free (_tmp11_), ((void*)0))); |
| 37090 | _tmp16_ = bala_ccode_base_module_emit_context_new (NULL((void*)0)); |
| 37091 | _tmp17_ = _tmp16_; |
| 37092 | bala_ccode_base_module_push_context (self, _tmp17_); |
| 37093 | _bala_ccode_base_module_emit_context_unref0 (_tmp17_)((_tmp17_ == ((void*)0)) ? ((void*)0) : (_tmp17_ = (bala_ccode_base_module_emit_context_unref (_tmp17_), ((void*)0)))); |
| 37094 | _tmp18_ = function; |
| 37095 | bala_ccode_base_module_push_function (self, _tmp18_); |
| 37096 | _tmp19_ = bala_ccode_base_module_load_this_parameter (self, (BalaTypeSymbol*) st); |
| 37097 | this_value = _tmp19_; |
| 37098 | { |
| 37099 | BalaList* _f_list = NULL((void*)0); |
| 37100 | BalaList* _tmp20_; |
| 37101 | BalaList* _tmp21_; |
| 37102 | gint _f_size = 0; |
| 37103 | BalaList* _tmp22_; |
| 37104 | gint _tmp23_; |
| 37105 | gint _tmp24_; |
| 37106 | gint _f_index = 0; |
| 37107 | _tmp20_ = bala_struct_get_fields (st); |
| 37108 | _tmp21_ = _bala_iterable_ref0 (_tmp20_); |
| 37109 | _f_list = _tmp21_; |
| 37110 | _tmp22_ = _f_list; |
| 37111 | _tmp23_ = bala_collection_get_size ((BalaCollection*) _tmp22_); |
| 37112 | _tmp24_ = _tmp23_; |
| 37113 | _f_size = _tmp24_; |
| 37114 | _f_index = -1; |
| 37115 | while (TRUE(!(0))) { |
| 37116 | gint _tmp25_; |
| 37117 | gint _tmp26_; |
| 37118 | BalaField* f = NULL((void*)0); |
| 37119 | BalaList* _tmp27_; |
| 37120 | gpointer _tmp28_; |
| 37121 | BalaField* _tmp29_; |
| 37122 | BalaMemberBinding _tmp30_; |
| 37123 | BalaMemberBinding _tmp31_; |
| 37124 | _f_index = _f_index + 1; |
| 37125 | _tmp25_ = _f_index; |
| 37126 | _tmp26_ = _f_size; |
| 37127 | if (!(_tmp25_ < _tmp26_)) { |
| 37128 | break; |
| 37129 | } |
| 37130 | _tmp27_ = _f_list; |
| 37131 | _tmp28_ = bala_list_get (_tmp27_, _f_index); |
| 37132 | f = (BalaField*) _tmp28_; |
| 37133 | _tmp29_ = f; |
| 37134 | _tmp30_ = bala_field_get_binding (_tmp29_); |
| 37135 | _tmp31_ = _tmp30_; |
| 37136 | if (_tmp31_ == BALA_MEMBER_BINDING_INSTANCE) { |
| 37137 | gboolean _tmp32_ = FALSE(0); |
| 37138 | gboolean _tmp33_ = FALSE(0); |
| 37139 | BalaField* _tmp34_; |
| 37140 | BalaDataType* _tmp35_; |
| 37141 | BalaDataType* _tmp36_; |
| 37142 | _tmp34_ = f; |
| 37143 | _tmp35_ = bala_variable_get_variable_type ((BalaVariable*) _tmp34_); |
| 37144 | _tmp36_ = _tmp35_; |
| 37145 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp36_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp36_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 37146 | _tmp33_ = TRUE(!(0)); |
| 37147 | } else { |
| 37148 | BalaField* _tmp37_; |
| 37149 | _tmp37_ = f; |
| 37150 | _tmp33_ = bala_get_ccode_delegate_target ((BalaCodeNode*) _tmp37_); |
| 37151 | } |
| 37152 | if (_tmp33_) { |
| 37153 | BalaField* _tmp38_; |
| 37154 | BalaDataType* _tmp39_; |
| 37155 | BalaDataType* _tmp40_; |
| 37156 | _tmp38_ = f; |
| 37157 | _tmp39_ = bala_variable_get_variable_type ((BalaVariable*) _tmp38_); |
| 37158 | _tmp40_ = _tmp39_; |
| 37159 | _tmp32_ = bala_ccode_base_module_requires_destroy (_tmp40_); |
| 37160 | } else { |
| 37161 | _tmp32_ = FALSE(0); |
| 37162 | } |
| 37163 | if (_tmp32_) { |
| 37164 | BalaCCodeFunction* _tmp41_; |
| 37165 | BalaCCodeFunction* _tmp42_; |
| 37166 | BalaField* _tmp43_; |
| 37167 | BalaTargetValue* _tmp44_; |
| 37168 | BalaCCodeExpression* _tmp45_; |
| 37169 | BalaCCodeExpression* _tmp46_; |
| 37170 | _tmp41_ = bala_ccode_base_module_get_ccode (self); |
| 37171 | _tmp42_ = _tmp41_; |
| 37172 | _tmp43_ = f; |
| 37173 | _tmp44_ = this_value; |
| 37174 | _tmp45_ = bala_ccode_base_module_destroy_field (self, _tmp43_, _tmp44_); |
| 37175 | _tmp46_ = _tmp45_; |
| 37176 | bala_ccode_function_add_expression (_tmp42_, _tmp46_); |
| 37177 | _bala_ccode_node_unref0 (_tmp46_)((_tmp46_ == ((void*)0)) ? ((void*)0) : (_tmp46_ = (bala_ccode_node_unref (_tmp46_), ((void*)0)))); |
| 37178 | } |
| 37179 | } |
| 37180 | _bala_code_node_unref0 (f)((f == ((void*)0)) ? ((void*)0) : (f = (bala_code_node_unref ( f), ((void*)0)))); |
| 37181 | } |
| 37182 | _bala_iterable_unref0 (_f_list)((_f_list == ((void*)0)) ? ((void*)0) : (_f_list = (bala_iterable_unref (_f_list), ((void*)0)))); |
| 37183 | } |
| 37184 | bala_ccode_base_module_pop_function (self); |
| 37185 | bala_ccode_base_module_pop_context (self); |
| 37186 | _tmp47_ = self->cfile; |
| 37187 | _tmp48_ = function; |
| 37188 | bala_ccode_file_add_function_declaration (_tmp47_, _tmp48_); |
| 37189 | _tmp49_ = self->cfile; |
| 37190 | _tmp50_ = function; |
| 37191 | bala_ccode_file_add_function (_tmp49_, _tmp50_); |
| 37192 | _bala_target_value_unref0 (this_value)((this_value == ((void*)0)) ? ((void*)0) : (this_value = (bala_target_value_unref (this_value), ((void*)0)))); |
| 37193 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 37194 | } |
| 37195 | |
| 37196 | static void |
| 37197 | bala_ccode_base_module_generate_struct_copy_function (BalaCCodeBaseModule* self, |
| 37198 | BalaStruct* st) |
| 37199 | { |
| 37200 | BalaCCodeFile* _tmp0_; |
| 37201 | gchar* _tmp1_; |
| 37202 | gchar* _tmp2_; |
| 37203 | gboolean _tmp3_; |
| 37204 | BalaCCodeFunction* function = NULL((void*)0); |
| 37205 | gchar* _tmp4_; |
| 37206 | gchar* _tmp5_; |
| 37207 | BalaCCodeFunction* _tmp6_; |
| 37208 | BalaCCodeFunction* _tmp7_; |
| 37209 | BalaCCodeFunction* _tmp8_; |
| 37210 | BalaCCodeFunction* _tmp9_; |
| 37211 | gchar* _tmp10_; |
| 37212 | gchar* _tmp11_; |
| 37213 | gchar* _tmp12_; |
| 37214 | gchar* _tmp13_; |
| 37215 | BalaCCodeParameter* _tmp14_; |
| 37216 | BalaCCodeParameter* _tmp15_; |
| 37217 | BalaCCodeFunction* _tmp16_; |
| 37218 | gchar* _tmp17_; |
| 37219 | gchar* _tmp18_; |
| 37220 | gchar* _tmp19_; |
| 37221 | gchar* _tmp20_; |
| 37222 | BalaCCodeParameter* _tmp21_; |
| 37223 | BalaCCodeParameter* _tmp22_; |
| 37224 | BalaCCodeBaseModuleEmitContext* _tmp23_; |
| 37225 | BalaCCodeBaseModuleEmitContext* _tmp24_; |
| 37226 | BalaCCodeFunction* _tmp25_; |
| 37227 | BalaGLibValue* dest_struct = NULL((void*)0); |
| 37228 | BalaDataType* _tmp26_; |
| 37229 | BalaDataType* _tmp27_; |
| 37230 | BalaCCodeIdentifier* _tmp28_; |
| 37231 | BalaCCodeIdentifier* _tmp29_; |
| 37232 | BalaGLibValue* _tmp30_; |
| 37233 | BalaGLibValue* _tmp31_; |
| 37234 | BalaCCodeFile* _tmp65_; |
| 37235 | BalaCCodeFunction* _tmp66_; |
| 37236 | BalaCCodeFile* _tmp67_; |
| 37237 | BalaCCodeFunction* _tmp68_; |
| 37238 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 37239 | g_return_if_fail (st != NULL)do { if ((st != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "st != NULL"); return; } } while (0); |
| 37240 | _tmp0_ = self->cfile; |
| 37241 | _tmp1_ = bala_get_ccode_copy_function ((BalaTypeSymbol*) st); |
| 37242 | _tmp2_ = _tmp1_; |
| 37243 | _tmp3_ = bala_ccode_file_add_declaration (_tmp0_, _tmp2_); |
| 37244 | _g_free0 (_tmp2_)(_tmp2_ = (g_free (_tmp2_), ((void*)0))); |
| 37245 | if (_tmp3_) { |
| 37246 | return; |
| 37247 | } |
| 37248 | _tmp4_ = bala_get_ccode_copy_function ((BalaTypeSymbol*) st); |
| 37249 | _tmp5_ = _tmp4_; |
| 37250 | _tmp6_ = bala_ccode_function_new (_tmp5_, "void"); |
| 37251 | _tmp7_ = _tmp6_; |
| 37252 | _g_free0 (_tmp5_)(_tmp5_ = (g_free (_tmp5_), ((void*)0))); |
| 37253 | function = _tmp7_; |
| 37254 | _tmp8_ = function; |
| 37255 | bala_ccode_node_set_modifiers ((BalaCCodeNode*) _tmp8_, BALA_CCODE_MODIFIERS_STATIC); |
| 37256 | _tmp9_ = function; |
| 37257 | _tmp10_ = bala_get_ccode_name ((BalaCodeNode*) st); |
| 37258 | _tmp11_ = _tmp10_; |
| 37259 | _tmp12_ = g_strdup_printf ("const %s *", _tmp11_); |
| 37260 | _tmp13_ = _tmp12_; |
| 37261 | _tmp14_ = bala_ccode_parameter_new ("self", _tmp13_); |
| 37262 | _tmp15_ = _tmp14_; |
| 37263 | bala_ccode_function_add_parameter (_tmp9_, _tmp15_); |
| 37264 | _bala_ccode_node_unref0 (_tmp15_)((_tmp15_ == ((void*)0)) ? ((void*)0) : (_tmp15_ = (bala_ccode_node_unref (_tmp15_), ((void*)0)))); |
| 37265 | _g_free0 (_tmp13_)(_tmp13_ = (g_free (_tmp13_), ((void*)0))); |
| 37266 | _g_free0 (_tmp11_)(_tmp11_ = (g_free (_tmp11_), ((void*)0))); |
| 37267 | _tmp16_ = function; |
| 37268 | _tmp17_ = bala_get_ccode_name ((BalaCodeNode*) st); |
| 37269 | _tmp18_ = _tmp17_; |
| 37270 | _tmp19_ = g_strdup_printf ("%s *", _tmp18_); |
| 37271 | _tmp20_ = _tmp19_; |
| 37272 | _tmp21_ = bala_ccode_parameter_new ("dest", _tmp20_); |
| 37273 | _tmp22_ = _tmp21_; |
| 37274 | bala_ccode_function_add_parameter (_tmp16_, _tmp22_); |
| 37275 | _bala_ccode_node_unref0 (_tmp22_)((_tmp22_ == ((void*)0)) ? ((void*)0) : (_tmp22_ = (bala_ccode_node_unref (_tmp22_), ((void*)0)))); |
| 37276 | _g_free0 (_tmp20_)(_tmp20_ = (g_free (_tmp20_), ((void*)0))); |
| 37277 | _g_free0 (_tmp18_)(_tmp18_ = (g_free (_tmp18_), ((void*)0))); |
| 37278 | _tmp23_ = bala_ccode_base_module_emit_context_new (NULL((void*)0)); |
| 37279 | _tmp24_ = _tmp23_; |
| 37280 | bala_ccode_base_module_push_context (self, _tmp24_); |
| 37281 | _bala_ccode_base_module_emit_context_unref0 (_tmp24_)((_tmp24_ == ((void*)0)) ? ((void*)0) : (_tmp24_ = (bala_ccode_base_module_emit_context_unref (_tmp24_), ((void*)0)))); |
| 37282 | _tmp25_ = function; |
| 37283 | bala_ccode_base_module_push_function (self, _tmp25_); |
| 37284 | _tmp26_ = bala_semantic_analyzer_get_data_type_for_symbol ((BalaSymbol*) st); |
| 37285 | _tmp27_ = _tmp26_; |
| 37286 | _tmp28_ = bala_ccode_identifier_new ("(*dest)"); |
| 37287 | _tmp29_ = _tmp28_; |
| 37288 | _tmp30_ = bala_glib_value_new (_tmp27_, (BalaCCodeExpression*) _tmp29_, TRUE(!(0))); |
| 37289 | _tmp31_ = _tmp30_; |
| 37290 | _bala_ccode_node_unref0 (_tmp29_)((_tmp29_ == ((void*)0)) ? ((void*)0) : (_tmp29_ = (bala_ccode_node_unref (_tmp29_), ((void*)0)))); |
| 37291 | _bala_code_node_unref0 (_tmp27_)((_tmp27_ == ((void*)0)) ? ((void*)0) : (_tmp27_ = (bala_code_node_unref (_tmp27_), ((void*)0)))); |
| 37292 | dest_struct = _tmp31_; |
| 37293 | { |
| 37294 | BalaList* _f_list = NULL((void*)0); |
| 37295 | BalaList* _tmp32_; |
| 37296 | BalaList* _tmp33_; |
| 37297 | gint _f_size = 0; |
| 37298 | BalaList* _tmp34_; |
| 37299 | gint _tmp35_; |
| 37300 | gint _tmp36_; |
| 37301 | gint _f_index = 0; |
| 37302 | _tmp32_ = bala_struct_get_fields (st); |
| 37303 | _tmp33_ = _bala_iterable_ref0 (_tmp32_); |
| 37304 | _f_list = _tmp33_; |
| 37305 | _tmp34_ = _f_list; |
| 37306 | _tmp35_ = bala_collection_get_size ((BalaCollection*) _tmp34_); |
| 37307 | _tmp36_ = _tmp35_; |
| 37308 | _f_size = _tmp36_; |
| 37309 | _f_index = -1; |
| 37310 | while (TRUE(!(0))) { |
| 37311 | gint _tmp37_; |
| 37312 | gint _tmp38_; |
| 37313 | BalaField* f = NULL((void*)0); |
| 37314 | BalaList* _tmp39_; |
| 37315 | gpointer _tmp40_; |
| 37316 | BalaField* _tmp41_; |
| 37317 | BalaMemberBinding _tmp42_; |
| 37318 | BalaMemberBinding _tmp43_; |
| 37319 | _f_index = _f_index + 1; |
| 37320 | _tmp37_ = _f_index; |
| 37321 | _tmp38_ = _f_size; |
| 37322 | if (!(_tmp37_ < _tmp38_)) { |
| 37323 | break; |
| 37324 | } |
| 37325 | _tmp39_ = _f_list; |
| 37326 | _tmp40_ = bala_list_get (_tmp39_, _f_index); |
| 37327 | f = (BalaField*) _tmp40_; |
| 37328 | _tmp41_ = f; |
| 37329 | _tmp42_ = bala_field_get_binding (_tmp41_); |
| 37330 | _tmp43_ = _tmp42_; |
| 37331 | if (_tmp43_ == BALA_MEMBER_BINDING_INSTANCE) { |
| 37332 | BalaTargetValue* value = NULL((void*)0); |
| 37333 | BalaField* _tmp44_; |
| 37334 | BalaTargetValue* _tmp45_; |
| 37335 | BalaTargetValue* _tmp46_; |
| 37336 | BalaTargetValue* _tmp47_; |
| 37337 | BalaTargetValue* _tmp48_; |
| 37338 | gboolean _tmp49_ = FALSE(0); |
| 37339 | gboolean _tmp50_ = FALSE(0); |
| 37340 | BalaField* _tmp51_; |
| 37341 | BalaDataType* _tmp52_; |
| 37342 | BalaDataType* _tmp53_; |
| 37343 | BalaField* _tmp62_; |
| 37344 | BalaGLibValue* _tmp63_; |
| 37345 | BalaTargetValue* _tmp64_; |
| 37346 | _tmp44_ = f; |
| 37347 | _tmp45_ = bala_ccode_base_module_load_this_parameter (self, G_TYPE_CHECK_INSTANCE_CAST (st, BALA_TYPE_TYPESYMBOL, BalaTypeSymbol)(((BalaTypeSymbol*) g_type_check_instance_cast ((GTypeInstance *) (st), ((bala_typesymbol_get_type ())))))); |
| 37348 | _tmp46_ = _tmp45_; |
| 37349 | _tmp47_ = bala_code_generator_load_field ((BalaCodeGenerator*) self, _tmp44_, _tmp46_, NULL((void*)0)); |
| 37350 | _tmp48_ = _tmp47_; |
| 37351 | _bala_target_value_unref0 (_tmp46_)((_tmp46_ == ((void*)0)) ? ((void*)0) : (_tmp46_ = (bala_target_value_unref (_tmp46_), ((void*)0)))); |
| 37352 | value = _tmp48_; |
| 37353 | _tmp51_ = f; |
| 37354 | _tmp52_ = bala_variable_get_variable_type ((BalaVariable*) _tmp51_); |
| 37355 | _tmp53_ = _tmp52_; |
| 37356 | if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp53_, BALA_TYPE_DELEGATE_TYPE)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp53_); GType __t = ((bala_delegate_type_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) { |
| 37357 | _tmp50_ = TRUE(!(0)); |
| 37358 | } else { |
| 37359 | BalaField* _tmp54_; |
| 37360 | _tmp54_ = f; |
| 37361 | _tmp50_ = bala_get_ccode_delegate_target ((BalaCodeNode*) _tmp54_); |
| 37362 | } |
| 37363 | if (_tmp50_) { |
| 37364 | BalaField* _tmp55_; |
| 37365 | BalaDataType* _tmp56_; |
| 37366 | BalaDataType* _tmp57_; |
| 37367 | _tmp55_ = f; |
| 37368 | _tmp56_ = bala_variable_get_variable_type ((BalaVariable*) _tmp55_); |
| 37369 | _tmp57_ = _tmp56_; |
| 37370 | _tmp49_ = bala_ccode_base_module_requires_copy (_tmp57_); |
| 37371 | } else { |
| 37372 | _tmp49_ = FALSE(0); |
| 37373 | } |
| 37374 | if (_tmp49_) { |
| 37375 | BalaTargetValue* _tmp58_; |
| 37376 | BalaField* _tmp59_; |
| 37377 | BalaTargetValue* _tmp60_; |
| 37378 | BalaTargetValue* _tmp61_; |
| 37379 | _tmp58_ = value; |
| 37380 | _tmp59_ = f; |
| 37381 | _tmp60_ = bala_ccode_base_module_copy_value (self, _tmp58_, (BalaCodeNode*) _tmp59_); |
| 37382 | _bala_target_value_unref0 (value)((value == ((void*)0)) ? ((void*)0) : (value = (bala_target_value_unref (value), ((void*)0)))); |
| 37383 | value = _tmp60_; |
| 37384 | _tmp61_ = value; |
| 37385 | if (_tmp61_ == NULL((void*)0)) { |
| 37386 | _bala_target_value_unref0 (value)((value == ((void*)0)) ? ((void*)0) : (value = (bala_target_value_unref (value), ((void*)0)))); |
| 37387 | _bala_code_node_unref0 (f)((f == ((void*)0)) ? ((void*)0) : (f = (bala_code_node_unref ( f), ((void*)0)))); |
| 37388 | continue; |
| 37389 | } |
| 37390 | } |
| 37391 | _tmp62_ = f; |
| 37392 | _tmp63_ = dest_struct; |
| 37393 | _tmp64_ = value; |
| 37394 | bala_code_generator_store_field ((BalaCodeGenerator*) self, _tmp62_, (BalaTargetValue*) _tmp63_, _tmp64_, NULL((void*)0)); |
| 37395 | _bala_target_value_unref0 (value)((value == ((void*)0)) ? ((void*)0) : (value = (bala_target_value_unref (value), ((void*)0)))); |
| 37396 | } |
| 37397 | _bala_code_node_unref0 (f)((f == ((void*)0)) ? ((void*)0) : (f = (bala_code_node_unref ( f), ((void*)0)))); |
| 37398 | } |
| 37399 | _bala_iterable_unref0 (_f_list)((_f_list == ((void*)0)) ? ((void*)0) : (_f_list = (bala_iterable_unref (_f_list), ((void*)0)))); |
| 37400 | } |
| 37401 | bala_ccode_base_module_pop_function (self); |
| 37402 | bala_ccode_base_module_pop_context (self); |
| 37403 | _tmp65_ = self->cfile; |
| 37404 | _tmp66_ = function; |
| 37405 | bala_ccode_file_add_function_declaration (_tmp65_, _tmp66_); |
| 37406 | _tmp67_ = self->cfile; |
| 37407 | _tmp68_ = function; |
| 37408 | bala_ccode_file_add_function (_tmp67_, _tmp68_); |
| 37409 | _bala_target_value_unref0 (dest_struct)((dest_struct == ((void*)0)) ? ((void*)0) : (dest_struct = (bala_target_value_unref (dest_struct), ((void*)0)))); |
| 37410 | _bala_ccode_node_unref0 (function)((function == ((void*)0)) ? ((void*)0) : (function = (bala_ccode_node_unref (function), ((void*)0)))); |
| 37411 | } |
| 37412 | |
| 37413 | void |
| 37414 | bala_ccode_base_module_return_default_value (BalaCCodeBaseModule* self, |
| 37415 | BalaDataType* return_type, |
| 37416 | gboolean on_error) |
| 37417 | { |
| 37418 | BalaStruct* st = NULL((void*)0); |
| 37419 | BalaTypeSymbol* _tmp0_; |
| 37420 | BalaTypeSymbol* _tmp1_; |
| 37421 | gboolean _tmp2_ = FALSE(0); |
| 37422 | gboolean _tmp3_ = FALSE(0); |
| 37423 | BalaStruct* _tmp4_; |
| 37424 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 37425 | g_return_if_fail (return_type != NULL)do { if ((return_type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "return_type != NULL" ); return; } } while (0); |
| 37426 | _tmp0_ = bala_data_type_get_type_symbol (return_type); |
| 37427 | _tmp1_ = _tmp0_; |
| 37428 | st = G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BALA_TYPE_STRUCT)((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( _tmp1_); GType __t = ((bala_struct_get_type ())); gboolean __r ; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))) ? ((BalaStruct*) _tmp1_) : NULL((void*)0); |
| 37429 | _tmp4_ = st; |
| 37430 | if (_tmp4_ != NULL((void*)0)) { |
| 37431 | BalaStruct* _tmp5_; |
| 37432 | _tmp5_ = st; |
| 37433 | _tmp3_ = bala_struct_is_simple_type (_tmp5_); |
| 37434 | } else { |
| 37435 | _tmp3_ = FALSE(0); |
| 37436 | } |
| 37437 | if (_tmp3_) { |
| 37438 | gboolean _tmp6_; |
| 37439 | gboolean _tmp7_; |
| 37440 | _tmp6_ = bala_data_type_get_nullable (return_type); |
| 37441 | _tmp7_ = _tmp6_; |
| 37442 | _tmp2_ = !_tmp7_; |
| 37443 | } else { |
| 37444 | _tmp2_ = FALSE(0); |
| 37445 | } |
| 37446 | if (_tmp2_) { |
| 37447 | BalaLocalVariable* ret_temp_var = NULL((void*)0); |
| 37448 | BalaLocalVariable* _tmp8_; |
| 37449 | BalaLocalVariable* _tmp9_; |
| 37450 | BalaCCodeFunction* _tmp10_; |
| 37451 | BalaCCodeFunction* _tmp11_; |
| 37452 | BalaLocalVariable* _tmp12_; |
| 37453 | const gchar* _tmp13_; |
| 37454 | const gchar* _tmp14_; |
| 37455 | BalaCCodeIdentifier* _tmp15_; |
| 37456 | BalaCCodeIdentifier* _tmp16_; |
| 37457 | _tmp8_ = bala_ccode_base_module_get_temp_variable (self, return_type, TRUE(!(0)), NULL((void*)0), TRUE(!(0))); |
| 37458 | ret_temp_var = _tmp8_; |
| 37459 | _tmp9_ = ret_temp_var; |
| 37460 | bala_ccode_base_module_emit_temp_var (self, _tmp9_, on_error); |
| 37461 | _tmp10_ = bala_ccode_base_module_get_ccode (self); |
| 37462 | _tmp11_ = _tmp10_; |
| 37463 | _tmp12_ = ret_temp_var; |
| 37464 | _tmp13_ = bala_symbol_get_name ((BalaSymbol*) _tmp12_); |
| 37465 | _tmp14_ = _tmp13_; |
| 37466 | _tmp15_ = bala_ccode_identifier_new (_tmp14_); |
| 37467 | _tmp16_ = _tmp15_; |
| 37468 | bala_ccode_function_add_return (_tmp11_, (BalaCCodeExpression*) _tmp16_); |
| 37469 | _bala_ccode_node_unref0 (_tmp16_)((_tmp16_ == ((void*)0)) ? ((void*)0) : (_tmp16_ = (bala_ccode_node_unref (_tmp16_), ((void*)0)))); |
| 37470 | _bala_code_node_unref0 (ret_temp_var)((ret_temp_var == ((void*)0)) ? ((void*)0) : (ret_temp_var = ( bala_code_node_unref (ret_temp_var), ((void*)0)))); |
| 37471 | } else { |
| 37472 | BalaCCodeFunction* _tmp17_; |
| 37473 | BalaCCodeFunction* _tmp18_; |
| 37474 | BalaCCodeExpression* _tmp19_; |
| 37475 | BalaCCodeExpression* _tmp20_; |
| 37476 | _tmp17_ = bala_ccode_base_module_get_ccode (self); |
| 37477 | _tmp18_ = _tmp17_; |
| 37478 | _tmp19_ = bala_ccode_base_module_default_value_for_type (self, return_type, FALSE(0), on_error); |
| 37479 | _tmp20_ = _tmp19_; |
| 37480 | bala_ccode_function_add_return (_tmp18_, _tmp20_); |
| 37481 | _bala_ccode_node_unref0 (_tmp20_)((_tmp20_ == ((void*)0)) ? ((void*)0) : (_tmp20_ = (bala_ccode_node_unref (_tmp20_), ((void*)0)))); |
| 37482 | } |
| 37483 | } |
| 37484 | |
| 37485 | static void |
| 37486 | bala_ccode_base_module_real_generate_dynamic_method_wrapper (BalaCCodeBaseModule* self, |
| 37487 | BalaDynamicMethod* method) |
| 37488 | { |
| 37489 | g_return_if_fail (method != NULL)do { if ((method != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "method != NULL" ); return; } } while (0); |
| 37490 | } |
| 37491 | |
| 37492 | void |
| 37493 | bala_ccode_base_module_generate_dynamic_method_wrapper (BalaCCodeBaseModule* self, |
| 37494 | BalaDynamicMethod* method) |
| 37495 | { |
| 37496 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 37497 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->generate_dynamic_method_wrapper (self, method); |
| 37498 | } |
| 37499 | |
| 37500 | static gboolean |
| 37501 | bala_ccode_base_module_real_method_has_wrapper (BalaCCodeBaseModule* self, |
| 37502 | BalaMethod* method) |
| 37503 | { |
| 37504 | gboolean result = FALSE(0); |
| 37505 | g_return_val_if_fail (method != NULL, FALSE)do { if ((method != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "method != NULL" ); return ((0)); } } while (0); |
| 37506 | result = FALSE(0); |
| 37507 | return result; |
| 37508 | } |
| 37509 | |
| 37510 | gboolean |
| 37511 | bala_ccode_base_module_method_has_wrapper (BalaCCodeBaseModule* self, |
| 37512 | BalaMethod* method) |
| 37513 | { |
| 37514 | g_return_val_if_fail (self != NULL, FALSE)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return ((0)); } } while (0); |
| 37515 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->method_has_wrapper (self, method); |
| 37516 | } |
| 37517 | |
| 37518 | static BalaCCodeExpression* |
| 37519 | bala_ccode_base_module_real_get_param_spec_cexpression (BalaCCodeBaseModule* self, |
| 37520 | BalaProperty* prop) |
| 37521 | { |
| 37522 | BalaCCodeInvalidExpression* _tmp0_; |
| 37523 | BalaCCodeExpression* result = NULL((void*)0); |
| 37524 | g_return_val_if_fail (prop != NULL, NULL)do { if ((prop != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "prop != NULL" ); return (((void*)0)); } } while (0); |
| 37525 | _tmp0_ = bala_ccode_invalid_expression_new (); |
| 37526 | result = (BalaCCodeExpression*) _tmp0_; |
| 37527 | return result; |
| 37528 | } |
| 37529 | |
| 37530 | BalaCCodeExpression* |
| 37531 | bala_ccode_base_module_get_param_spec_cexpression (BalaCCodeBaseModule* self, |
| 37532 | BalaProperty* prop) |
| 37533 | { |
| 37534 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37535 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_param_spec_cexpression (self, prop); |
| 37536 | } |
| 37537 | |
| 37538 | static BalaCCodeExpression* |
| 37539 | bala_ccode_base_module_real_get_param_spec (BalaCCodeBaseModule* self, |
| 37540 | BalaProperty* prop) |
| 37541 | { |
| 37542 | BalaCCodeInvalidExpression* _tmp0_; |
| 37543 | BalaCCodeExpression* result = NULL((void*)0); |
| 37544 | g_return_val_if_fail (prop != NULL, NULL)do { if ((prop != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "prop != NULL" ); return (((void*)0)); } } while (0); |
| 37545 | _tmp0_ = bala_ccode_invalid_expression_new (); |
| 37546 | result = (BalaCCodeExpression*) _tmp0_; |
| 37547 | return result; |
| 37548 | } |
| 37549 | |
| 37550 | BalaCCodeExpression* |
| 37551 | bala_ccode_base_module_get_param_spec (BalaCCodeBaseModule* self, |
| 37552 | BalaProperty* prop) |
| 37553 | { |
| 37554 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37555 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_param_spec (self, prop); |
| 37556 | } |
| 37557 | |
| 37558 | static BalaCCodeExpression* |
| 37559 | bala_ccode_base_module_real_get_signal_creation (BalaCCodeBaseModule* self, |
| 37560 | BalaSignal* sig, |
| 37561 | BalaObjectTypeSymbol* type) |
| 37562 | { |
| 37563 | BalaCCodeInvalidExpression* _tmp0_; |
| 37564 | BalaCCodeExpression* result = NULL((void*)0); |
| 37565 | g_return_val_if_fail (sig != NULL, NULL)do { if ((sig != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "sig != NULL") ; return (((void*)0)); } } while (0); |
| 37566 | g_return_val_if_fail (type != NULL, NULL)do { if ((type != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type != NULL" ); return (((void*)0)); } } while (0); |
| 37567 | _tmp0_ = bala_ccode_invalid_expression_new (); |
| 37568 | result = (BalaCCodeExpression*) _tmp0_; |
| 37569 | return result; |
| 37570 | } |
| 37571 | |
| 37572 | BalaCCodeExpression* |
| 37573 | bala_ccode_base_module_get_signal_creation (BalaCCodeBaseModule* self, |
| 37574 | BalaSignal* sig, |
| 37575 | BalaObjectTypeSymbol* type) |
| 37576 | { |
| 37577 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37578 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_signal_creation (self, sig, type); |
| 37579 | } |
| 37580 | |
| 37581 | static BalaCCodeExpression* |
| 37582 | bala_ccode_base_module_real_get_value_getter_function (BalaCCodeBaseModule* self, |
| 37583 | BalaDataType* type_reference) |
| 37584 | { |
| 37585 | BalaCCodeInvalidExpression* _tmp0_; |
| 37586 | BalaCCodeExpression* result = NULL((void*)0); |
| 37587 | g_return_val_if_fail (type_reference != NULL, NULL)do { if ((type_reference != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type_reference != NULL" ); return (((void*)0)); } } while (0); |
| 37588 | _tmp0_ = bala_ccode_invalid_expression_new (); |
| 37589 | result = (BalaCCodeExpression*) _tmp0_; |
| 37590 | return result; |
| 37591 | } |
| 37592 | |
| 37593 | BalaCCodeExpression* |
| 37594 | bala_ccode_base_module_get_value_getter_function (BalaCCodeBaseModule* self, |
| 37595 | BalaDataType* type_reference) |
| 37596 | { |
| 37597 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37598 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_value_getter_function (self, type_reference); |
| 37599 | } |
| 37600 | |
| 37601 | static BalaCCodeExpression* |
| 37602 | bala_ccode_base_module_real_get_value_setter_function (BalaCCodeBaseModule* self, |
| 37603 | BalaDataType* type_reference) |
| 37604 | { |
| 37605 | BalaCCodeInvalidExpression* _tmp0_; |
| 37606 | BalaCCodeExpression* result = NULL((void*)0); |
| 37607 | g_return_val_if_fail (type_reference != NULL, NULL)do { if ((type_reference != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type_reference != NULL" ); return (((void*)0)); } } while (0); |
| 37608 | _tmp0_ = bala_ccode_invalid_expression_new (); |
| 37609 | result = (BalaCCodeExpression*) _tmp0_; |
| 37610 | return result; |
| 37611 | } |
| 37612 | |
| 37613 | BalaCCodeExpression* |
| 37614 | bala_ccode_base_module_get_value_setter_function (BalaCCodeBaseModule* self, |
| 37615 | BalaDataType* type_reference) |
| 37616 | { |
| 37617 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37618 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_value_setter_function (self, type_reference); |
| 37619 | } |
| 37620 | |
| 37621 | static BalaCCodeExpression* |
| 37622 | bala_ccode_base_module_real_get_value_taker_function (BalaCCodeBaseModule* self, |
| 37623 | BalaDataType* type_reference) |
| 37624 | { |
| 37625 | BalaCCodeInvalidExpression* _tmp0_; |
| 37626 | BalaCCodeExpression* result = NULL((void*)0); |
| 37627 | g_return_val_if_fail (type_reference != NULL, NULL)do { if ((type_reference != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "type_reference != NULL" ); return (((void*)0)); } } while (0); |
| 37628 | _tmp0_ = bala_ccode_invalid_expression_new (); |
| 37629 | result = (BalaCCodeExpression*) _tmp0_; |
| 37630 | return result; |
| 37631 | } |
| 37632 | |
| 37633 | BalaCCodeExpression* |
| 37634 | bala_ccode_base_module_get_value_taker_function (BalaCCodeBaseModule* self, |
| 37635 | BalaDataType* type_reference) |
| 37636 | { |
| 37637 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37638 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_value_taker_function (self, type_reference); |
| 37639 | } |
| 37640 | |
| 37641 | static void |
| 37642 | bala_ccode_base_module_real_register_dbus_info (BalaCCodeBaseModule* self, |
| 37643 | BalaCCodeBlock* block, |
| 37644 | BalaObjectTypeSymbol* bindable) |
| 37645 | { |
| 37646 | g_return_if_fail (block != NULL)do { if ((block != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "block != NULL" ); return; } } while (0); |
| 37647 | g_return_if_fail (bindable != NULL)do { if ((bindable != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "bindable != NULL" ); return; } } while (0); |
| 37648 | } |
| 37649 | |
| 37650 | void |
| 37651 | bala_ccode_base_module_register_dbus_info (BalaCCodeBaseModule* self, |
| 37652 | BalaCCodeBlock* block, |
| 37653 | BalaObjectTypeSymbol* bindable) |
| 37654 | { |
| 37655 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 37656 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->register_dbus_info (self, block, bindable); |
| 37657 | } |
| 37658 | |
| 37659 | static gchar* |
| 37660 | bala_ccode_base_module_real_get_dynamic_property_getter_cname (BalaCCodeBaseModule* self, |
| 37661 | BalaDynamicProperty* node) |
| 37662 | { |
| 37663 | BalaSourceReference* _tmp0_; |
| 37664 | BalaSourceReference* _tmp1_; |
| 37665 | BalaDataType* _tmp2_; |
| 37666 | BalaDataType* _tmp3_; |
| 37667 | gchar* _tmp4_; |
| 37668 | gchar* _tmp5_; |
| 37669 | gchar* _tmp6_; |
| 37670 | gchar* _tmp7_; |
| 37671 | gchar* _tmp8_; |
| 37672 | gchar* result = NULL((void*)0); |
| 37673 | g_return_val_if_fail (node != NULL, NULL)do { if ((node != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "node != NULL" ); return (((void*)0)); } } while (0); |
| 37674 | _tmp0_ = bala_code_node_get_source_reference ((BalaCodeNode*) node); |
| 37675 | _tmp1_ = _tmp0_; |
| 37676 | _tmp2_ = bala_dynamic_property_get_dynamic_type (node); |
| 37677 | _tmp3_ = _tmp2_; |
| 37678 | _tmp4_ = bala_code_node_to_string ((BalaCodeNode*) _tmp3_); |
| 37679 | _tmp5_ = _tmp4_; |
| 37680 | _tmp6_ = g_strdup_printf ("dynamic properties are not supported for %s", _tmp5_); |
| 37681 | _tmp7_ = _tmp6_; |
| 37682 | bala_report_error (_tmp1_, _tmp7_); |
| 37683 | _g_free0 (_tmp7_)(_tmp7_ = (g_free (_tmp7_), ((void*)0))); |
| 37684 | _g_free0 (_tmp5_)(_tmp5_ = (g_free (_tmp5_), ((void*)0))); |
| 37685 | _tmp8_ = g_strdup (""); |
| 37686 | result = _tmp8_; |
| 37687 | return result; |
| 37688 | } |
| 37689 | |
| 37690 | gchar* |
| 37691 | bala_ccode_base_module_get_dynamic_property_getter_cname (BalaCCodeBaseModule* self, |
| 37692 | BalaDynamicProperty* node) |
| 37693 | { |
| 37694 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37695 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_dynamic_property_getter_cname (self, node); |
| 37696 | } |
| 37697 | |
| 37698 | static gchar* |
| 37699 | bala_ccode_base_module_real_get_dynamic_property_setter_cname (BalaCCodeBaseModule* self, |
| 37700 | BalaDynamicProperty* node) |
| 37701 | { |
| 37702 | BalaSourceReference* _tmp0_; |
| 37703 | BalaSourceReference* _tmp1_; |
| 37704 | BalaDataType* _tmp2_; |
| 37705 | BalaDataType* _tmp3_; |
| 37706 | gchar* _tmp4_; |
| 37707 | gchar* _tmp5_; |
| 37708 | gchar* _tmp6_; |
| 37709 | gchar* _tmp7_; |
| 37710 | gchar* _tmp8_; |
| 37711 | gchar* result = NULL((void*)0); |
| 37712 | g_return_val_if_fail (node != NULL, NULL)do { if ((node != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "node != NULL" ); return (((void*)0)); } } while (0); |
| 37713 | _tmp0_ = bala_code_node_get_source_reference ((BalaCodeNode*) node); |
| 37714 | _tmp1_ = _tmp0_; |
| 37715 | _tmp2_ = bala_dynamic_property_get_dynamic_type (node); |
| 37716 | _tmp3_ = _tmp2_; |
| 37717 | _tmp4_ = bala_code_node_to_string ((BalaCodeNode*) _tmp3_); |
| 37718 | _tmp5_ = _tmp4_; |
| 37719 | _tmp6_ = g_strdup_printf ("dynamic properties are not supported for %s", _tmp5_); |
| 37720 | _tmp7_ = _tmp6_; |
| 37721 | bala_report_error (_tmp1_, _tmp7_); |
| 37722 | _g_free0 (_tmp7_)(_tmp7_ = (g_free (_tmp7_), ((void*)0))); |
| 37723 | _g_free0 (_tmp5_)(_tmp5_ = (g_free (_tmp5_), ((void*)0))); |
| 37724 | _tmp8_ = g_strdup (""); |
| 37725 | result = _tmp8_; |
| 37726 | return result; |
| 37727 | } |
| 37728 | |
| 37729 | gchar* |
| 37730 | bala_ccode_base_module_get_dynamic_property_setter_cname (BalaCCodeBaseModule* self, |
| 37731 | BalaDynamicProperty* node) |
| 37732 | { |
| 37733 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37734 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_dynamic_property_setter_cname (self, node); |
| 37735 | } |
| 37736 | |
| 37737 | static gchar* |
| 37738 | bala_ccode_base_module_real_get_dynamic_signal_cname (BalaCCodeBaseModule* self, |
| 37739 | BalaDynamicSignal* node) |
| 37740 | { |
| 37741 | gchar* _tmp0_; |
| 37742 | gchar* result = NULL((void*)0); |
| 37743 | g_return_val_if_fail (node != NULL, NULL)do { if ((node != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "node != NULL" ); return (((void*)0)); } } while (0); |
| 37744 | _tmp0_ = g_strdup (""); |
| 37745 | result = _tmp0_; |
| 37746 | return result; |
| 37747 | } |
| 37748 | |
| 37749 | gchar* |
| 37750 | bala_ccode_base_module_get_dynamic_signal_cname (BalaCCodeBaseModule* self, |
| 37751 | BalaDynamicSignal* node) |
| 37752 | { |
| 37753 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37754 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_dynamic_signal_cname (self, node); |
| 37755 | } |
| 37756 | |
| 37757 | static gchar* |
| 37758 | bala_ccode_base_module_real_get_dynamic_signal_connect_wrapper_name (BalaCCodeBaseModule* self, |
| 37759 | BalaDynamicSignal* node) |
| 37760 | { |
| 37761 | gchar* _tmp0_; |
| 37762 | gchar* result = NULL((void*)0); |
| 37763 | g_return_val_if_fail (node != NULL, NULL)do { if ((node != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "node != NULL" ); return (((void*)0)); } } while (0); |
| 37764 | _tmp0_ = g_strdup (""); |
| 37765 | result = _tmp0_; |
| 37766 | return result; |
| 37767 | } |
| 37768 | |
| 37769 | gchar* |
| 37770 | bala_ccode_base_module_get_dynamic_signal_connect_wrapper_name (BalaCCodeBaseModule* self, |
| 37771 | BalaDynamicSignal* node) |
| 37772 | { |
| 37773 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37774 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_dynamic_signal_connect_wrapper_name (self, node); |
| 37775 | } |
| 37776 | |
| 37777 | static gchar* |
| 37778 | bala_ccode_base_module_real_get_dynamic_signal_connect_after_wrapper_name (BalaCCodeBaseModule* self, |
| 37779 | BalaDynamicSignal* node) |
| 37780 | { |
| 37781 | gchar* _tmp0_; |
| 37782 | gchar* result = NULL((void*)0); |
| 37783 | g_return_val_if_fail (node != NULL, NULL)do { if ((node != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "node != NULL" ); return (((void*)0)); } } while (0); |
| 37784 | _tmp0_ = g_strdup (""); |
| 37785 | result = _tmp0_; |
| 37786 | return result; |
| 37787 | } |
| 37788 | |
| 37789 | gchar* |
| 37790 | bala_ccode_base_module_get_dynamic_signal_connect_after_wrapper_name (BalaCCodeBaseModule* self, |
| 37791 | BalaDynamicSignal* node) |
| 37792 | { |
| 37793 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37794 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_dynamic_signal_connect_after_wrapper_name (self, node); |
| 37795 | } |
| 37796 | |
| 37797 | static gchar* |
| 37798 | bala_ccode_base_module_real_get_dynamic_signal_disconnect_wrapper_name (BalaCCodeBaseModule* self, |
| 37799 | BalaDynamicSignal* node) |
| 37800 | { |
| 37801 | gchar* _tmp0_; |
| 37802 | gchar* result = NULL((void*)0); |
| 37803 | g_return_val_if_fail (node != NULL, NULL)do { if ((node != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "node != NULL" ); return (((void*)0)); } } while (0); |
| 37804 | _tmp0_ = g_strdup (""); |
| 37805 | result = _tmp0_; |
| 37806 | return result; |
| 37807 | } |
| 37808 | |
| 37809 | gchar* |
| 37810 | bala_ccode_base_module_get_dynamic_signal_disconnect_wrapper_name (BalaCCodeBaseModule* self, |
| 37811 | BalaDynamicSignal* node) |
| 37812 | { |
| 37813 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37814 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_dynamic_signal_disconnect_wrapper_name (self, node); |
| 37815 | } |
| 37816 | |
| 37817 | static gchar* |
| 37818 | bala_ccode_base_module_real_get_array_length_cname (BalaCCodeBaseModule* self, |
| 37819 | const gchar* array_cname, |
| 37820 | gint dim) |
| 37821 | { |
| 37822 | gchar* _tmp0_; |
| 37823 | gchar* result = NULL((void*)0); |
| 37824 | g_return_val_if_fail (array_cname != NULL, NULL)do { if ((array_cname != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "array_cname != NULL" ); return (((void*)0)); } } while (0); |
| 37825 | _tmp0_ = g_strdup (""); |
| 37826 | result = _tmp0_; |
| 37827 | return result; |
| 37828 | } |
| 37829 | |
| 37830 | gchar* |
| 37831 | bala_ccode_base_module_get_array_length_cname (BalaCCodeBaseModule* self, |
| 37832 | const gchar* array_cname, |
| 37833 | gint dim) |
| 37834 | { |
| 37835 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37836 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_array_length_cname (self, array_cname, dim); |
| 37837 | } |
| 37838 | |
| 37839 | static gchar* |
| 37840 | bala_ccode_base_module_real_get_variable_array_length_cname (BalaCCodeBaseModule* self, |
| 37841 | BalaVariable* variable, |
| 37842 | gint dim) |
| 37843 | { |
| 37844 | gchar* _tmp0_; |
| 37845 | gchar* result = NULL((void*)0); |
| 37846 | g_return_val_if_fail (variable != NULL, NULL)do { if ((variable != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "variable != NULL" ); return (((void*)0)); } } while (0); |
| 37847 | _tmp0_ = g_strdup (""); |
| 37848 | result = _tmp0_; |
| 37849 | return result; |
| 37850 | } |
| 37851 | |
| 37852 | gchar* |
| 37853 | bala_ccode_base_module_get_variable_array_length_cname (BalaCCodeBaseModule* self, |
| 37854 | BalaVariable* variable, |
| 37855 | gint dim) |
| 37856 | { |
| 37857 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37858 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_variable_array_length_cname (self, variable, dim); |
| 37859 | } |
| 37860 | |
| 37861 | static BalaCCodeExpression* |
| 37862 | bala_ccode_base_module_real_get_array_length_cexpression (BalaCCodeBaseModule* self, |
| 37863 | BalaExpression* array_expr, |
| 37864 | gint dim) |
| 37865 | { |
| 37866 | BalaCCodeInvalidExpression* _tmp0_; |
| 37867 | BalaCCodeExpression* result = NULL((void*)0); |
| 37868 | g_return_val_if_fail (array_expr != NULL, NULL)do { if ((array_expr != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "array_expr != NULL" ); return (((void*)0)); } } while (0); |
| 37869 | _tmp0_ = bala_ccode_invalid_expression_new (); |
| 37870 | result = (BalaCCodeExpression*) _tmp0_; |
| 37871 | return result; |
| 37872 | } |
| 37873 | |
| 37874 | BalaCCodeExpression* |
| 37875 | bala_ccode_base_module_get_array_length_cexpression (BalaCCodeBaseModule* self, |
| 37876 | BalaExpression* array_expr, |
| 37877 | gint dim) |
| 37878 | { |
| 37879 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37880 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_array_length_cexpression (self, array_expr, dim); |
| 37881 | } |
| 37882 | |
| 37883 | static BalaCCodeExpression* |
| 37884 | bala_ccode_base_module_real_get_array_length_cvalue (BalaCCodeBaseModule* self, |
| 37885 | BalaTargetValue* value, |
| 37886 | gint dim) |
| 37887 | { |
| 37888 | BalaCCodeInvalidExpression* _tmp0_; |
| 37889 | BalaCCodeExpression* result = NULL((void*)0); |
| 37890 | g_return_val_if_fail (value != NULL, NULL)do { if ((value != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "value != NULL" ); return (((void*)0)); } } while (0); |
| 37891 | _tmp0_ = bala_ccode_invalid_expression_new (); |
| 37892 | result = (BalaCCodeExpression*) _tmp0_; |
| 37893 | return result; |
| 37894 | } |
| 37895 | |
| 37896 | BalaCCodeExpression* |
| 37897 | bala_ccode_base_module_get_array_length_cvalue (BalaCCodeBaseModule* self, |
| 37898 | BalaTargetValue* value, |
| 37899 | gint dim) |
| 37900 | { |
| 37901 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37902 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_array_length_cvalue (self, value, dim); |
| 37903 | } |
| 37904 | |
| 37905 | static gchar* |
| 37906 | bala_ccode_base_module_real_get_array_size_cname (BalaCCodeBaseModule* self, |
| 37907 | const gchar* array_cname) |
| 37908 | { |
| 37909 | gchar* _tmp0_; |
| 37910 | gchar* result = NULL((void*)0); |
| 37911 | g_return_val_if_fail (array_cname != NULL, NULL)do { if ((array_cname != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "array_cname != NULL" ); return (((void*)0)); } } while (0); |
| 37912 | _tmp0_ = g_strdup (""); |
| 37913 | result = _tmp0_; |
| 37914 | return result; |
| 37915 | } |
| 37916 | |
| 37917 | gchar* |
| 37918 | bala_ccode_base_module_get_array_size_cname (BalaCCodeBaseModule* self, |
| 37919 | const gchar* array_cname) |
| 37920 | { |
| 37921 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37922 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->get_array_size_cname (self, array_cname); |
| 37923 | } |
| 37924 | |
| 37925 | static void |
| 37926 | bala_ccode_base_module_real_add_simple_check (BalaCCodeBaseModule* self, |
| 37927 | BalaCodeNode* node, |
| 37928 | gboolean always_fails) |
| 37929 | { |
| 37930 | g_return_if_fail (node != NULL)do { if ((node != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "node != NULL" ); return; } } while (0); |
| 37931 | } |
| 37932 | |
| 37933 | void |
| 37934 | bala_ccode_base_module_add_simple_check (BalaCCodeBaseModule* self, |
| 37935 | BalaCodeNode* node, |
| 37936 | gboolean always_fails) |
| 37937 | { |
| 37938 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 37939 | BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->add_simple_check (self, node, always_fails); |
| 37940 | } |
| 37941 | |
| 37942 | static gchar* |
| 37943 | bala_ccode_base_module_real_generate_ready_function (BalaCCodeBaseModule* self, |
| 37944 | BalaMethod* m) |
| 37945 | { |
| 37946 | gchar* _tmp0_; |
| 37947 | gchar* result = NULL((void*)0); |
| 37948 | g_return_val_if_fail (m != NULL, NULL)do { if ((m != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "m != NULL"); return (((void*)0)); } } while (0); |
| 37949 | _tmp0_ = g_strdup (""); |
| 37950 | result = _tmp0_; |
| 37951 | return result; |
| 37952 | } |
| 37953 | |
| 37954 | gchar* |
| 37955 | bala_ccode_base_module_generate_ready_function (BalaCCodeBaseModule* self, |
| 37956 | BalaMethod* m) |
| 37957 | { |
| 37958 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37959 | return BALA_CCODE_BASE_MODULE_GET_CLASS (self)((((BalaCCodeBaseModuleClass*) (((GTypeInstance*) ((self)))-> g_class))))->generate_ready_function (self, m); |
| 37960 | } |
| 37961 | |
| 37962 | BalaCCodeExpression* |
| 37963 | bala_ccode_base_module_get_boolean_cconstant (BalaCCodeBaseModule* self, |
| 37964 | gboolean b) |
| 37965 | { |
| 37966 | BalaCodeContext* _tmp0_; |
| 37967 | BalaProfile _tmp1_; |
| 37968 | BalaProfile _tmp2_; |
| 37969 | BalaCCodeExpression* result = NULL((void*)0); |
| 37970 | g_return_val_if_fail (self != NULL, NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return (((void*)0)); } } while (0); |
| 37971 | _tmp0_ = self->priv->_context; |
| 37972 | _tmp1_ = bala_code_context_get_profile (_tmp0_); |
| 37973 | _tmp2_ = _tmp1_; |
| 37974 | if (_tmp2_ == BALA_PROFILE_GOBJECT) { |
| 37975 | const gchar* _tmp3_ = NULL((void*)0); |
| 37976 | BalaCCodeConstant* _tmp4_; |
| 37977 | if (b) { |
| 37978 | _tmp3_ = "TRUE"; |
| 37979 | } else { |
| 37980 | _tmp3_ = "FALSE"; |
| 37981 | } |
| 37982 | _tmp4_ = bala_ccode_constant_new (_tmp3_); |
| 37983 | result = (BalaCCodeExpression*) _tmp4_; |
| 37984 | return result; |
| 37985 | } else { |
| 37986 | BalaCCodeFile* _tmp5_; |
| 37987 | const gchar* _tmp6_ = NULL((void*)0); |
| 37988 | BalaCCodeConstant* _tmp7_; |
| 37989 | _tmp5_ = self->cfile; |
| 37990 | bala_ccode_file_add_include (_tmp5_, "stdbool.h", FALSE(0)); |
| 37991 | if (b) { |
| 37992 | _tmp6_ = "true"; |
| 37993 | } else { |
| 37994 | _tmp6_ = "false"; |
| 37995 | } |
| 37996 | _tmp7_ = bala_ccode_constant_new (_tmp6_); |
| 37997 | result = (BalaCCodeExpression*) _tmp7_; |
| 37998 | return result; |
| 37999 | } |
| 38000 | } |
| 38001 | |
| 38002 | BalaCCodeBaseModuleEmitContext* |
| 38003 | bala_ccode_base_module_emit_context_construct (GType object_type, |
| 38004 | BalaSymbol* symbol) |
| 38005 | { |
| 38006 | BalaCCodeBaseModuleEmitContext* self = NULL((void*)0); |
| 38007 | BalaSymbol* _tmp0_; |
| 38008 | self = (BalaCCodeBaseModuleEmitContext*) g_type_create_instance (object_type); |
| 38009 | _tmp0_ = _bala_code_node_ref0 (symbol); |
| 38010 | _bala_code_node_unref0 (self->current_symbol)((self->current_symbol == ((void*)0)) ? ((void*)0) : (self ->current_symbol = (bala_code_node_unref (self->current_symbol ), ((void*)0)))); |
| 38011 | self->current_symbol = _tmp0_; |
| 38012 | return self; |
| 38013 | } |
| 38014 | |
| 38015 | BalaCCodeBaseModuleEmitContext* |
| 38016 | bala_ccode_base_module_emit_context_new (BalaSymbol* symbol) |
| 38017 | { |
| 38018 | return bala_ccode_base_module_emit_context_construct (BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT(bala_ccode_base_module_emit_context_get_type ()), symbol); |
| 38019 | } |
| 38020 | |
| 38021 | void |
| 38022 | bala_ccode_base_module_emit_context_push_symbol (BalaCCodeBaseModuleEmitContext* self, |
| 38023 | BalaSymbol* symbol) |
| 38024 | { |
| 38025 | BalaArrayList* _tmp0_; |
| 38026 | BalaSymbol* _tmp1_; |
| 38027 | BalaSymbol* _tmp2_; |
| 38028 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 38029 | g_return_if_fail (symbol != NULL)do { if ((symbol != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "symbol != NULL" ); return; } } while (0); |
| 38030 | _tmp0_ = self->symbol_stack; |
| 38031 | _tmp1_ = self->current_symbol; |
| 38032 | bala_collection_add ((BalaCollection*) _tmp0_, _tmp1_); |
| 38033 | _tmp2_ = _bala_code_node_ref0 (symbol); |
| 38034 | _bala_code_node_unref0 (self->current_symbol)((self->current_symbol == ((void*)0)) ? ((void*)0) : (self ->current_symbol = (bala_code_node_unref (self->current_symbol ), ((void*)0)))); |
| 38035 | self->current_symbol = _tmp2_; |
| 38036 | } |
| 38037 | |
| 38038 | void |
| 38039 | bala_ccode_base_module_emit_context_pop_symbol (BalaCCodeBaseModuleEmitContext* self) |
| 38040 | { |
| 38041 | BalaArrayList* _tmp0_; |
| 38042 | BalaArrayList* _tmp1_; |
| 38043 | gint _tmp2_; |
| 38044 | gint _tmp3_; |
| 38045 | gpointer _tmp4_; |
| 38046 | g_return_if_fail (self != NULL)do { if ((self != ((void*)0))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "self != NULL" ); return; } } while (0); |
| 38047 | _tmp0_ = self->symbol_stack; |
| 38048 | _tmp1_ = self->symbol_stack; |
| 38049 | _tmp2_ = bala_collection_get_size ((BalaCollection*) _tmp1_); |
| 38050 | _tmp3_ = _tmp2_; |
| 38051 | _tmp4_ = bala_list_remove_at ((BalaList*) _tmp0_, _tmp3_ - 1); |
| 38052 | _bala_code_node_unref0 (self->current_symbol)((self->current_symbol == ((void*)0)) ? ((void*)0) : (self ->current_symbol = (bala_code_node_unref (self->current_symbol ), ((void*)0)))); |
| 38053 | self->current_symbol = (BalaSymbol*) _tmp4_; |
| 38054 | } |
| 38055 | |
| 38056 | static void |
| 38057 | bala_ccode_base_module_value_emit_context_init (GValue* value) |
| 38058 | { |
| 38059 | value->data[0].v_pointer = NULL((void*)0); |
| 38060 | } |
| 38061 | |
| 38062 | static void |
| 38063 | bala_ccode_base_module_value_emit_context_free_value (GValue* value) |
| 38064 | { |
| 38065 | if (value->data[0].v_pointer) { |
| 38066 | bala_ccode_base_module_emit_context_unref (value->data[0].v_pointer); |
| 38067 | } |
| 38068 | } |
| 38069 | |
| 38070 | static void |
| 38071 | bala_ccode_base_module_value_emit_context_copy_value (const GValue* src_value, |
| 38072 | GValue* dest_value) |
| 38073 | { |
| 38074 | if (src_value->data[0].v_pointer) { |
| 38075 | dest_value->data[0].v_pointer = bala_ccode_base_module_emit_context_ref (src_value->data[0].v_pointer); |
| 38076 | } else { |
| 38077 | dest_value->data[0].v_pointer = NULL((void*)0); |
| 38078 | } |
| 38079 | } |
| 38080 | |
| 38081 | static gpointer |
| 38082 | bala_ccode_base_module_value_emit_context_peek_pointer (const GValue* value) |
| 38083 | { |
| 38084 | return value->data[0].v_pointer; |
| 38085 | } |
| 38086 | |
| 38087 | static gchar* |
| 38088 | bala_ccode_base_module_value_emit_context_collect_value (GValue* value, |
| 38089 | guint n_collect_values, |
| 38090 | GTypeCValue* collect_values, |
| 38091 | guint collect_flags) |
| 38092 | { |
| 38093 | if (collect_values[0].v_pointer) { |
| 38094 | BalaCCodeBaseModuleEmitContext * object; |
| 38095 | object = collect_values[0].v_pointer; |
| 38096 | if (object->parent_instance.g_class == NULL((void*)0)) { |
| 38097 | return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value)(g_type_name ((((GValue*) (value))->g_type))), "'", NULL((void*)0)); |
| 38098 | } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object)((((GTypeClass*) (((GTypeInstance*) (object))->g_class))-> g_type)), G_VALUE_TYPE (value)(((GValue*) (value))->g_type))) { |
| 38099 | return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)((((GTypeClass*) (((GTypeInstance*) (object))->g_class))-> g_type))), "' for value type `", G_VALUE_TYPE_NAME (value)(g_type_name ((((GValue*) (value))->g_type))), "'", NULL((void*)0)); |
| 38100 | } |
| 38101 | value->data[0].v_pointer = bala_ccode_base_module_emit_context_ref (object); |
| 38102 | } else { |
| 38103 | value->data[0].v_pointer = NULL((void*)0); |
| 38104 | } |
| 38105 | return NULL((void*)0); |
| 38106 | } |
| 38107 | |
| 38108 | static gchar* |
| 38109 | bala_ccode_base_module_value_emit_context_lcopy_value (const GValue* value, |
| 38110 | guint n_collect_values, |
| 38111 | GTypeCValue* collect_values, |
| 38112 | guint collect_flags) |
| 38113 | { |
| 38114 | BalaCCodeBaseModuleEmitContext ** object_p; |
| 38115 | object_p = collect_values[0].v_pointer; |
| 38116 | if (!object_p) { |
| 38117 | return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)(g_type_name ((((GValue*) (value))->g_type)))); |
| 38118 | } |
| 38119 | if (!value->data[0].v_pointer) { |
| 38120 | *object_p = NULL((void*)0); |
| 38121 | } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS(1 << 27)) { |
| 38122 | *object_p = value->data[0].v_pointer; |
| 38123 | } else { |
| 38124 | *object_p = bala_ccode_base_module_emit_context_ref (value->data[0].v_pointer); |
| 38125 | } |
| 38126 | return NULL((void*)0); |
| 38127 | } |
| 38128 | |
| 38129 | GParamSpec* |
| 38130 | bala_ccode_base_module_param_spec_emit_context (const gchar* name, |
| 38131 | const gchar* nick, |
| 38132 | const gchar* blurb, |
| 38133 | GType object_type, |
| 38134 | GParamFlags flags) |
| 38135 | { |
| 38136 | BalaCCodeBaseModuleParamSpecEmitContext* spec; |
| 38137 | g_return_val_if_fail (g_type_is_a (object_type, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT), NULL)do { if ((g_type_is_a (object_type, (bala_ccode_base_module_emit_context_get_type ())))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "g_type_is_a (object_type, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT)" ); return (((void*)0)); } } while (0); |
| 38138 | spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT(g_param_spec_types[19]), name, nick, blurb, flags); |
| 38139 | G_PARAM_SPEC (spec)((((GParamSpec*) g_type_check_instance_cast ((GTypeInstance*) ((spec)), (((GType) ((19) << (2))))))))->value_type = object_type; |
| 38140 | return G_PARAM_SPEC (spec)((((GParamSpec*) g_type_check_instance_cast ((GTypeInstance*) ((spec)), (((GType) ((19) << (2)))))))); |
| 38141 | } |
| 38142 | |
| 38143 | gpointer |
| 38144 | bala_ccode_base_module_value_get_emit_context (const GValue* value) |
| 38145 | { |
| 38146 | g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT), NULL)do { if ((((__extension__ ({ const GValue *__val = (const GValue *) (value); GType __t = ((bala_ccode_base_module_emit_context_get_type ())); gboolean __r; if (!__val) __r = (0); else if (__val-> g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r; }))))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "G_TYPE_CHECK_VALUE_TYPE (value, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT)" ); return (((void*)0)); } } while (0); |
| 38147 | return value->data[0].v_pointer; |
| 38148 | } |
| 38149 | |
| 38150 | void |
| 38151 | bala_ccode_base_module_value_set_emit_context (GValue* value, |
| 38152 | gpointer v_object) |
| 38153 | { |
| 38154 | BalaCCodeBaseModuleEmitContext * old; |
| 38155 | g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT))do { if ((((__extension__ ({ const GValue *__val = (const GValue *) (value); GType __t = ((bala_ccode_base_module_emit_context_get_type ())); gboolean __r; if (!__val) __r = (0); else if (__val-> g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r; }))))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "G_TYPE_CHECK_VALUE_TYPE (value, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT)" ); return; } } while (0); |
| 38156 | old = value->data[0].v_pointer; |
| 38157 | if (v_object) { |
| 38158 | g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT))do { if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) (v_object); GType __t = ((bala_ccode_base_module_emit_context_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))) { } else { g_return_if_fail_warning ("bala-ccodegen" , ((const char*) (__func__)), "G_TYPE_CHECK_INSTANCE_TYPE (v_object, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT)" ); return; } } while (0); |
| 38159 | g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)))do { if ((g_value_type_compatible (((((GTypeClass*) (((GTypeInstance *) (v_object))->g_class))->g_type)), (((GValue*) (value ))->g_type)))) { } else { g_return_if_fail_warning ("bala-ccodegen" , ((const char*) (__func__)), "g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))" ); return; } } while (0); |
| 38160 | value->data[0].v_pointer = v_object; |
| 38161 | bala_ccode_base_module_emit_context_ref (value->data[0].v_pointer); |
| 38162 | } else { |
| 38163 | value->data[0].v_pointer = NULL((void*)0); |
| 38164 | } |
| 38165 | if (old) { |
| 38166 | bala_ccode_base_module_emit_context_unref (old); |
| 38167 | } |
| 38168 | } |
| 38169 | |
| 38170 | void |
| 38171 | bala_ccode_base_module_value_take_emit_context (GValue* value, |
| 38172 | gpointer v_object) |
| 38173 | { |
| 38174 | BalaCCodeBaseModuleEmitContext * old; |
| 38175 | g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT))do { if ((((__extension__ ({ const GValue *__val = (const GValue *) (value); GType __t = ((bala_ccode_base_module_emit_context_get_type ())); gboolean __r; if (!__val) __r = (0); else if (__val-> g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r; }))))) { } else { g_return_if_fail_warning ("bala-ccodegen", ((const char*) (__func__)), "G_TYPE_CHECK_VALUE_TYPE (value, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT)" ); return; } } while (0); |
| 38176 | old = value->data[0].v_pointer; |
| 38177 | if (v_object) { |
| 38178 | g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT))do { if ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) (v_object); GType __t = ((bala_ccode_base_module_emit_context_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst-> g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))) { } else { g_return_if_fail_warning ("bala-ccodegen" , ((const char*) (__func__)), "G_TYPE_CHECK_INSTANCE_TYPE (v_object, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT)" ); return; } } while (0); |
| 38179 | g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)))do { if ((g_value_type_compatible (((((GTypeClass*) (((GTypeInstance *) (v_object))->g_class))->g_type)), (((GValue*) (value ))->g_type)))) { } else { g_return_if_fail_warning ("bala-ccodegen" , ((const char*) (__func__)), "g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))" ); return; } } while (0); |
| 38180 | value->data[0].v_pointer = v_object; |
| 38181 | } else { |
| 38182 | value->data[0].v_pointer = NULL((void*)0); |
| 38183 | } |
| 38184 | if (old) { |
| 38185 | bala_ccode_base_module_emit_context_unref (old); |
| 38186 | } |
| 38187 | } |
| 38188 | |
| 38189 | static void |
| 38190 | bala_ccode_base_module_emit_context_class_init (BalaCCodeBaseModuleEmitContextClass * klass, |
| 38191 | gpointer klass_data) |
| 38192 | { |
| 38193 | bala_ccode_base_module_emit_context_parent_class = g_type_class_peek_parent (klass); |
| 38194 | ((BalaCCodeBaseModuleEmitContextClass *) klass)->finalize = bala_ccode_base_module_emit_context_finalize; |
| 38195 | } |
| 38196 | |
| 38197 | static void |
| 38198 | bala_ccode_base_module_emit_context_instance_init (BalaCCodeBaseModuleEmitContext * self, |
| 38199 | gpointer klass) |
| 38200 | { |
| 38201 | GEqualFunc _tmp0_; |
| 38202 | BalaArrayList* _tmp1_; |
| 38203 | GEqualFunc _tmp2_; |
| 38204 | BalaArrayList* _tmp3_; |
| 38205 | GEqualFunc _tmp4_; |
| 38206 | BalaArrayList* _tmp5_; |
| 38207 | GHashFunc _tmp6_; |
| 38208 | GEqualFunc _tmp7_; |
| 38209 | GEqualFunc _tmp8_; |
| 38210 | BalaHashMap* _tmp9_; |
| 38211 | GHashFunc _tmp10_; |
| 38212 | GEqualFunc _tmp11_; |
| 38213 | GEqualFunc _tmp12_; |
| 38214 | BalaHashMap* _tmp13_; |
| 38215 | GHashFunc _tmp14_; |
| 38216 | GEqualFunc _tmp15_; |
| 38217 | GEqualFunc _tmp16_; |
| 38218 | BalaHashMap* _tmp17_; |
| 38219 | _tmp0_ = g_direct_equal; |
| 38220 | _tmp1_ = bala_array_list_new (BALA_TYPE_SYMBOL(bala_symbol_get_type ()), (GBoxedCopyFunc) bala_code_node_ref, (GDestroyNotify) bala_code_node_unref, _tmp0_); |
| 38221 | self->symbol_stack = _tmp1_; |
| 38222 | _tmp2_ = g_direct_equal; |
| 38223 | _tmp3_ = bala_array_list_new (BALA_TYPE_CCODE_FUNCTION(bala_ccode_function_get_type ()), (GBoxedCopyFunc) bala_ccode_node_ref, (GDestroyNotify) bala_ccode_node_unref, _tmp2_); |
| 38224 | self->ccode_stack = _tmp3_; |
| 38225 | _tmp4_ = g_direct_equal; |
| 38226 | _tmp5_ = bala_array_list_new (BALA_TYPE_TARGET_VALUE(bala_target_value_get_type ()), (GBoxedCopyFunc) bala_target_value_ref, (GDestroyNotify) bala_target_value_unref, _tmp4_); |
| 38227 | self->temp_ref_values = _tmp5_; |
| 38228 | self->next_coroutine_state = 1; |
| 38229 | _tmp6_ = g_str_hash; |
| 38230 | _tmp7_ = g_str_equal; |
| 38231 | _tmp8_ = g_direct_equal; |
| 38232 | _tmp9_ = bala_hash_map_new (G_TYPE_STRING((GType) ((16) << (2))), (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING((GType) ((16) << (2))), (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp6_, _tmp7_, _tmp8_); |
| 38233 | self->variable_name_map = (BalaMap*) _tmp9_; |
| 38234 | _tmp10_ = g_str_hash; |
| 38235 | _tmp11_ = g_str_equal; |
| 38236 | _tmp12_ = g_direct_equal; |
| 38237 | _tmp13_ = bala_hash_map_new (G_TYPE_STRING((GType) ((16) << (2))), (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_INT((GType) ((6) << (2))), NULL((void*)0), NULL((void*)0), _tmp10_, _tmp11_, _tmp12_); |
| 38238 | self->closure_variable_count_map = (BalaMap*) _tmp13_; |
| 38239 | _tmp14_ = g_direct_hash; |
| 38240 | _tmp15_ = g_direct_equal; |
| 38241 | _tmp16_ = g_direct_equal; |
| 38242 | _tmp17_ = bala_hash_map_new (BALA_TYPE_LOCAL_VARIABLE(bala_local_variable_get_type ()), (GBoxedCopyFunc) bala_code_node_ref, (GDestroyNotify) bala_code_node_unref, G_TYPE_INT((GType) ((6) << (2))), NULL((void*)0), NULL((void*)0), _tmp14_, _tmp15_, _tmp16_); |
| 38243 | self->closure_variable_clash_map = (BalaMap*) _tmp17_; |
| 38244 | self->ref_count = 1; |
| 38245 | } |
| 38246 | |
| 38247 | static void |
| 38248 | bala_ccode_base_module_emit_context_finalize (BalaCCodeBaseModuleEmitContext * obj) |
| 38249 | { |
| 38250 | BalaCCodeBaseModuleEmitContext * self; |
| 38251 | self = G_TYPE_CHECK_INSTANCE_CAST (obj, BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT, BalaCCodeBaseModuleEmitContext)(((BalaCCodeBaseModuleEmitContext*) g_type_check_instance_cast ((GTypeInstance*) (obj), ((bala_ccode_base_module_emit_context_get_type ()))))); |
| 38252 | g_signal_handlers_destroy (self); |
| 38253 | _bala_code_node_unref0 (self->current_symbol)((self->current_symbol == ((void*)0)) ? ((void*)0) : (self ->current_symbol = (bala_code_node_unref (self->current_symbol ), ((void*)0)))); |
| 38254 | _bala_iterable_unref0 (self->symbol_stack)((self->symbol_stack == ((void*)0)) ? ((void*)0) : (self-> symbol_stack = (bala_iterable_unref (self->symbol_stack), ( (void*)0)))); |
| 38255 | _bala_code_node_unref0 (self->current_try)((self->current_try == ((void*)0)) ? ((void*)0) : (self-> current_try = (bala_code_node_unref (self->current_try), ( (void*)0)))); |
| 38256 | _bala_code_node_unref0 (self->current_catch)((self->current_catch == ((void*)0)) ? ((void*)0) : (self-> current_catch = (bala_code_node_unref (self->current_catch ), ((void*)0)))); |
| 38257 | _bala_ccode_node_unref0 (self->ccode)((self->ccode == ((void*)0)) ? ((void*)0) : (self->ccode = (bala_ccode_node_unref (self->ccode), ((void*)0)))); |
| 38258 | _bala_iterable_unref0 (self->ccode_stack)((self->ccode_stack == ((void*)0)) ? ((void*)0) : (self-> ccode_stack = (bala_iterable_unref (self->ccode_stack), (( void*)0)))); |
| 38259 | _bala_iterable_unref0 (self->temp_ref_values)((self->temp_ref_values == ((void*)0)) ? ((void*)0) : (self ->temp_ref_values = (bala_iterable_unref (self->temp_ref_values ), ((void*)0)))); |
| 38260 | _bala_map_unref0 (self->variable_name_map)((self->variable_name_map == ((void*)0)) ? ((void*)0) : (self ->variable_name_map = (bala_map_unref (self->variable_name_map ), ((void*)0)))); |
| 38261 | _bala_map_unref0 (self->closure_variable_count_map)((self->closure_variable_count_map == ((void*)0)) ? ((void *)0) : (self->closure_variable_count_map = (bala_map_unref (self->closure_variable_count_map), ((void*)0)))); |
| 38262 | _bala_map_unref0 (self->closure_variable_clash_map)((self->closure_variable_clash_map == ((void*)0)) ? ((void *)0) : (self->closure_variable_clash_map = (bala_map_unref (self->closure_variable_clash_map), ((void*)0)))); |
| 38263 | } |
| 38264 | |
| 38265 | static GType |
| 38266 | bala_ccode_base_module_emit_context_get_type_once (void) |
| 38267 | { |
| 38268 | static const GTypeValueTable g_define_type_value_table = { bala_ccode_base_module_value_emit_context_init, bala_ccode_base_module_value_emit_context_free_value, bala_ccode_base_module_value_emit_context_copy_value, bala_ccode_base_module_value_emit_context_peek_pointer, "p", bala_ccode_base_module_value_emit_context_collect_value, "p", bala_ccode_base_module_value_emit_context_lcopy_value }; |
| 38269 | static const GTypeInfo g_define_type_info = { sizeof (BalaCCodeBaseModuleEmitContextClass), (GBaseInitFunc) NULL((void*)0), (GBaseFinalizeFunc) NULL((void*)0), (GClassInitFunc) bala_ccode_base_module_emit_context_class_init, (GClassFinalizeFunc) NULL((void*)0), NULL((void*)0), sizeof (BalaCCodeBaseModuleEmitContext), 0, (GInstanceInitFunc) bala_ccode_base_module_emit_context_instance_init, &g_define_type_value_table }; |
| 38270 | static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; |
| 38271 | GType bala_ccode_base_module_emit_context_type_id; |
| 38272 | bala_ccode_base_module_emit_context_type_id = g_type_register_fundamental (g_type_fundamental_next (), "BalaCCodeBaseModuleEmitContext", &g_define_type_info, &g_define_type_fundamental_info, 0); |
| 38273 | return bala_ccode_base_module_emit_context_type_id; |
| 38274 | } |
| 38275 | |
| 38276 | GType |
| 38277 | bala_ccode_base_module_emit_context_get_type (void) |
| 38278 | { |
| 38279 | static volatile gsize bala_ccode_base_module_emit_context_type_id__volatile = 0; |
| 38280 | if (g_once_init_enter (&bala_ccode_base_module_emit_context_type_id__volatile)(__extension__ ({ _Static_assert (sizeof *(&bala_ccode_base_module_emit_context_type_id__volatile ) == sizeof (gpointer), "Expression evaluates to false"); (void ) (0 ? (gpointer) *(&bala_ccode_base_module_emit_context_type_id__volatile ) : ((void*)0)); (!(__extension__ ({ _Static_assert (sizeof * (&bala_ccode_base_module_emit_context_type_id__volatile) == sizeof (gpointer), "Expression evaluates to false"); gpointer gapg_temp_newval; gpointer *gapg_temp_atomic = (gpointer *)( &bala_ccode_base_module_emit_context_type_id__volatile); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5); gapg_temp_newval ; })) && g_once_init_enter (&bala_ccode_base_module_emit_context_type_id__volatile )); }))) { |
| 38281 | GType bala_ccode_base_module_emit_context_type_id; |
| 38282 | bala_ccode_base_module_emit_context_type_id = bala_ccode_base_module_emit_context_get_type_once (); |
| 38283 | g_once_init_leave (&bala_ccode_base_module_emit_context_type_id__volatile, bala_ccode_base_module_emit_context_type_id)(__extension__ ({ _Static_assert (sizeof *(&bala_ccode_base_module_emit_context_type_id__volatile ) == sizeof (gpointer), "Expression evaluates to false"); 0 ? (void) (*(&bala_ccode_base_module_emit_context_type_id__volatile ) = (bala_ccode_base_module_emit_context_type_id)) : (void) 0 ; g_once_init_leave ((&bala_ccode_base_module_emit_context_type_id__volatile ), (gsize) (bala_ccode_base_module_emit_context_type_id)); }) ); |
| 38284 | } |
| 38285 | return bala_ccode_base_module_emit_context_type_id__volatile; |
| 38286 | } |
| 38287 | |
| 38288 | gpointer |
| 38289 | bala_ccode_base_module_emit_context_ref (gpointer instance) |
| 38290 | { |
| 38291 | BalaCCodeBaseModuleEmitContext * self; |
| 38292 | self = instance; |
| 38293 | g_atomic_int_inc (&self->ref_count)(__extension__ ({ _Static_assert (sizeof *(&self->ref_count ) == sizeof (gint), "Expression evaluates to false"); (void) ( 0 ? *(&self->ref_count) ^ *(&self->ref_count) : 1); (void) __atomic_fetch_add ((&self->ref_count), 1, 5); })); |
| 38294 | return instance; |
| 38295 | } |
| 38296 | |
| 38297 | void |
| 38298 | bala_ccode_base_module_emit_context_unref (gpointer instance) |
| 38299 | { |
| 38300 | BalaCCodeBaseModuleEmitContext * self; |
| 38301 | self = instance; |
| 38302 | if (g_atomic_int_dec_and_test (&self->ref_count)(__extension__ ({ _Static_assert (sizeof *(&self->ref_count ) == sizeof (gint), "Expression evaluates to false"); (void) ( 0 ? *(&self->ref_count) ^ *(&self->ref_count) : 1); __atomic_fetch_sub ((&self->ref_count), 1, 5) == 1 ; }))) { |
| 38303 | BALA_CCODE_BASE_MODULE_EMIT_CONTEXT_GET_CLASS (self)((((BalaCCodeBaseModuleEmitContextClass*) (((GTypeInstance*) ( (self)))->g_class))))->finalize (self); |
| 38304 | g_type_free_instance ((GTypeInstance *) self); |
| 38305 | } |
| 38306 | } |
| 38307 | |
| 38308 | static void |
| 38309 | bala_ccode_base_module_class_init (BalaCCodeBaseModuleClass * klass, |
| 38310 | gpointer klass_data) |
| 38311 | { |
| 38312 | bala_ccode_base_module_parent_class = g_type_class_peek_parent (klass); |
| 38313 | ((BalaCodeVisitorClass *) klass)->finalize = bala_ccode_base_module_finalize; |
| 38314 | g_type_class_adjust_private_offset (klass, &BalaCCodeBaseModule_private_offset); |
| 38315 | ((BalaCodeGeneratorClass *) klass)->emit = (void (*) (BalaCodeGenerator*, BalaCodeContext*)) bala_ccode_base_module_real_emit; |
| 38316 | ((BalaCCodeBaseModuleClass *) klass)->append_bala_array_free = (void (*) (BalaCCodeBaseModule*)) bala_ccode_base_module_real_append_bala_array_free; |
| 38317 | ((BalaCCodeBaseModuleClass *) klass)->append_bala_array_move = (void (*) (BalaCCodeBaseModule*)) bala_ccode_base_module_real_append_bala_array_move; |
| 38318 | ((BalaCCodeBaseModuleClass *) klass)->append_bala_array_length = (void (*) (BalaCCodeBaseModule*)) bala_ccode_base_module_real_append_bala_array_length; |
| 38319 | ((BalaCCodeBaseModuleClass *) klass)->append_params_array = (void (*) (BalaCCodeBaseModule*, BalaMethod*)) bala_ccode_base_module_real_append_params_array; |
| 38320 | ((BalaCodeVisitorClass *) klass)->visit_source_file = (void (*) (BalaCodeVisitor*, BalaSourceFile*)) bala_ccode_base_module_real_visit_source_file; |
| 38321 | ((BalaCCodeBaseModuleClass *) klass)->generate_enum_declaration = (gboolean (*) (BalaCCodeBaseModule*, BalaEnum*, BalaCCodeFile*)) bala_ccode_base_module_real_generate_enum_declaration; |
| 38322 | ((BalaCodeVisitorClass *) klass)->visit_enum = (void (*) (BalaCodeVisitor*, BalaEnum*)) bala_ccode_base_module_real_visit_enum; |
| 38323 | ((BalaCodeVisitorClass *) klass)->visit_constant = (void (*) (BalaCodeVisitor*, BalaConstant*)) bala_ccode_base_module_real_visit_constant; |
| 38324 | ((BalaCodeVisitorClass *) klass)->visit_field = (void (*) (BalaCodeVisitor*, BalaField*)) bala_ccode_base_module_real_visit_field; |
| 38325 | ((BalaCodeVisitorClass *) klass)->visit_property = (void (*) (BalaCodeVisitor*, BalaProperty*)) bala_ccode_base_module_real_visit_property; |
| 38326 | ((BalaCCodeBaseModuleClass *) klass)->generate_class_struct_declaration = (void (*) (BalaCCodeBaseModule*, BalaClass*, BalaCCodeFile*)) bala_ccode_base_module_real_generate_class_struct_declaration; |
| 38327 | ((BalaCCodeBaseModuleClass *) klass)->generate_struct_declaration = (void (*) (BalaCCodeBaseModule*, BalaStruct*, BalaCCodeFile*)) bala_ccode_base_module_real_generate_struct_declaration; |
| 38328 | ((BalaCCodeBaseModuleClass *) klass)->generate_delegate_declaration = (void (*) (BalaCCodeBaseModule*, BalaDelegate*, BalaCCodeFile*)) bala_ccode_base_module_real_generate_delegate_declaration; |
| 38329 | ((BalaCCodeBaseModuleClass *) klass)->generate_cparameters = (void (*) (BalaCCodeBaseModule*, BalaMethod*, BalaCCodeFile*, BalaMap*, BalaCCodeFunction*, BalaCCodeFunctionDeclarator*, BalaMap*, BalaCCodeFunctionCall*, gint)) bala_ccode_base_module_real_generate_cparameters; |
| 38330 | ((BalaCodeVisitorClass *) klass)->visit_property_accessor = (void (*) (BalaCodeVisitor*, BalaPropertyAccessor*)) bala_ccode_base_module_real_visit_property_accessor; |
| 38331 | ((BalaCodeVisitorClass *) klass)->visit_destructor = (void (*) (BalaCodeVisitor*, BalaDestructor*)) bala_ccode_base_module_real_visit_destructor; |
| 38332 | ((BalaCodeVisitorClass *) klass)->visit_block = (void (*) (BalaCodeVisitor*, BalaBlock*)) bala_ccode_base_module_real_visit_block; |
| 38333 | ((BalaCodeVisitorClass *) klass)->visit_declaration_statement = (void (*) (BalaCodeVisitor*, BalaDeclarationStatement*)) bala_ccode_base_module_real_visit_declaration_statement; |
| 38334 | ((BalaCodeVisitorClass *) klass)->visit_local_variable = (void (*) (BalaCodeVisitor*, BalaLocalVariable*)) bala_ccode_base_module_real_visit_local_variable; |
| 38335 | ((BalaCodeVisitorClass *) klass)->visit_initializer_list = (void (*) (BalaCodeVisitor*, BalaInitializerList*)) bala_ccode_base_module_real_visit_initializer_list; |
| 38336 | ((BalaCCodeBaseModuleClass *) klass)->get_dup_func_expression = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaDataType*, BalaSourceReference*, gboolean)) bala_ccode_base_module_real_get_dup_func_expression; |
| 38337 | ((BalaCCodeBaseModuleClass *) klass)->append_struct_array_destroy = (gchar* (*) (BalaCCodeBaseModule*, BalaStruct*)) bala_ccode_base_module_real_append_struct_array_destroy; |
| 38338 | ((BalaCCodeBaseModuleClass *) klass)->append_struct_array_free = (gchar* (*) (BalaCCodeBaseModule*, BalaStruct*)) bala_ccode_base_module_real_append_struct_array_free; |
| 38339 | ((BalaCCodeBaseModuleClass *) klass)->destroy_value = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaTargetValue*, gboolean)) bala_ccode_base_module_real_destroy_value; |
| 38340 | ((BalaCodeVisitorClass *) klass)->visit_end_full_expression = (void (*) (BalaCodeVisitor*, BalaExpression*)) bala_ccode_base_module_real_visit_end_full_expression; |
| 38341 | ((BalaCodeVisitorClass *) klass)->visit_expression_statement = (void (*) (BalaCodeVisitor*, BalaExpressionStatement*)) bala_ccode_base_module_real_visit_expression_statement; |
| 38342 | ((BalaCCodeBaseModuleClass *) klass)->append_scope_free = (void (*) (BalaCCodeBaseModule*, BalaSymbol*, BalaCodeNode*)) bala_ccode_base_module_real_append_scope_free; |
| 38343 | ((BalaCodeVisitorClass *) klass)->visit_return_statement = (void (*) (BalaCodeVisitor*, BalaReturnStatement*)) bala_ccode_base_module_real_visit_return_statement; |
| 38344 | ((BalaCodeVisitorClass *) klass)->visit_lock_statement = (void (*) (BalaCodeVisitor*, BalaLockStatement*)) bala_ccode_base_module_real_visit_lock_statement; |
| 38345 | ((BalaCodeVisitorClass *) klass)->visit_unlock_statement = (void (*) (BalaCodeVisitor*, BalaUnlockStatement*)) bala_ccode_base_module_real_visit_unlock_statement; |
| 38346 | ((BalaCodeVisitorClass *) klass)->visit_delete_statement = (void (*) (BalaCodeVisitor*, BalaDeleteStatement*)) bala_ccode_base_module_real_visit_delete_statement; |
| 38347 | ((BalaCodeVisitorClass *) klass)->visit_expression = (void (*) (BalaCodeVisitor*, BalaExpression*)) bala_ccode_base_module_real_visit_expression; |
| 38348 | ((BalaCodeVisitorClass *) klass)->visit_boolean_literal = (void (*) (BalaCodeVisitor*, BalaBooleanLiteral*)) bala_ccode_base_module_real_visit_boolean_literal; |
| 38349 | ((BalaCodeVisitorClass *) klass)->visit_character_literal = (void (*) (BalaCodeVisitor*, BalaCharacterLiteral*)) bala_ccode_base_module_real_visit_character_literal; |
| 38350 | ((BalaCodeVisitorClass *) klass)->visit_integer_literal = (void (*) (BalaCodeVisitor*, BalaIntegerLiteral*)) bala_ccode_base_module_real_visit_integer_literal; |
| 38351 | ((BalaCodeVisitorClass *) klass)->visit_real_literal = (void (*) (BalaCodeVisitor*, BalaRealLiteral*)) bala_ccode_base_module_real_visit_real_literal; |
| 38352 | ((BalaCodeVisitorClass *) klass)->visit_string_literal = (void (*) (BalaCodeVisitor*, BalaStringLiteral*)) bala_ccode_base_module_real_visit_string_literal; |
| 38353 | ((BalaCodeVisitorClass *) klass)->visit_regex_literal = (void (*) (BalaCodeVisitor*, BalaRegexLiteral*)) bala_ccode_base_module_real_visit_regex_literal; |
| 38354 | ((BalaCodeVisitorClass *) klass)->visit_null_literal = (void (*) (BalaCodeVisitor*, BalaNullLiteral*)) bala_ccode_base_module_real_visit_null_literal; |
| 38355 | ((BalaCCodeBaseModuleClass *) klass)->get_local_cvalue = (BalaTargetValue* (*) (BalaCCodeBaseModule*, BalaLocalVariable*)) bala_ccode_base_module_real_get_local_cvalue; |
| 38356 | ((BalaCCodeBaseModuleClass *) klass)->get_parameter_cvalue = (BalaTargetValue* (*) (BalaCCodeBaseModule*, BalaParameter*)) bala_ccode_base_module_real_get_parameter_cvalue; |
| 38357 | ((BalaCCodeBaseModuleClass *) klass)->get_field_cvalue = (BalaTargetValue* (*) (BalaCCodeBaseModule*, BalaField*, BalaTargetValue*)) bala_ccode_base_module_real_get_field_cvalue; |
| 38358 | ((BalaCCodeBaseModuleClass *) klass)->load_variable = (BalaTargetValue* (*) (BalaCCodeBaseModule*, BalaVariable*, BalaTargetValue*, BalaExpression*)) bala_ccode_base_module_real_load_variable; |
| 38359 | ((BalaCCodeBaseModuleClass *) klass)->load_this_parameter = (BalaTargetValue* (*) (BalaCCodeBaseModule*, BalaTypeSymbol*)) bala_ccode_base_module_real_load_this_parameter; |
| 38360 | ((BalaCCodeBaseModuleClass *) klass)->store_value = (void (*) (BalaCCodeBaseModule*, BalaTargetValue*, BalaTargetValue*, BalaSourceReference*)) bala_ccode_base_module_real_store_value; |
| 38361 | ((BalaCCodeBaseModuleClass *) klass)->get_delegate_target_cname = (gchar* (*) (BalaCCodeBaseModule*, const gchar*)) bala_ccode_base_module_real_get_delegate_target_cname; |
| 38362 | ((BalaCCodeBaseModuleClass *) klass)->get_delegate_target_cexpression = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaExpression*, BalaCCodeExpression* *)) bala_ccode_base_module_real_get_delegate_target_cexpression; |
| 38363 | ((BalaCCodeBaseModuleClass *) klass)->get_delegate_target_cvalue = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaTargetValue*)) bala_ccode_base_module_real_get_delegate_target_cvalue; |
| 38364 | ((BalaCCodeBaseModuleClass *) klass)->get_delegate_target_destroy_notify_cvalue = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaTargetValue*)) bala_ccode_base_module_real_get_delegate_target_destroy_notify_cvalue; |
| 38365 | ((BalaCCodeBaseModuleClass *) klass)->get_delegate_target_destroy_notify_cname = (gchar* (*) (BalaCCodeBaseModule*, const gchar*)) bala_ccode_base_module_real_get_delegate_target_destroy_notify_cname; |
| 38366 | ((BalaCodeVisitorClass *) klass)->visit_base_access = (void (*) (BalaCodeVisitor*, BalaBaseAccess*)) bala_ccode_base_module_real_visit_base_access; |
| 38367 | ((BalaCodeVisitorClass *) klass)->visit_postfix_expression = (void (*) (BalaCodeVisitor*, BalaPostfixExpression*)) bala_ccode_base_module_real_visit_postfix_expression; |
| 38368 | ((BalaCCodeBaseModuleClass *) klass)->copy_value = (BalaTargetValue* (*) (BalaCCodeBaseModule*, BalaTargetValue*, BalaCodeNode*)) bala_ccode_base_module_real_copy_value; |
| 38369 | ((BalaCCodeBaseModuleClass *) klass)->generate_class_declaration = (void (*) (BalaCCodeBaseModule*, BalaClass*, BalaCCodeFile*)) bala_ccode_base_module_real_generate_class_declaration; |
| 38370 | ((BalaCCodeBaseModuleClass *) klass)->generate_interface_declaration = (void (*) (BalaCCodeBaseModule*, BalaInterface*, BalaCCodeFile*)) bala_ccode_base_module_real_generate_interface_declaration; |
| 38371 | ((BalaCCodeBaseModuleClass *) klass)->generate_method_declaration = (gboolean (*) (BalaCCodeBaseModule*, BalaMethod*, BalaCCodeFile*)) bala_ccode_base_module_real_generate_method_declaration; |
| 38372 | ((BalaCCodeBaseModuleClass *) klass)->generate_error_domain_declaration = (void (*) (BalaCCodeBaseModule*, BalaErrorDomain*, BalaCCodeFile*)) bala_ccode_base_module_real_generate_error_domain_declaration; |
| 38373 | ((BalaCodeVisitorClass *) klass)->visit_object_creation_expression = (void (*) (BalaCodeVisitor*, BalaObjectCreationExpression*)) bala_ccode_base_module_real_visit_object_creation_expression; |
| 38374 | ((BalaCodeVisitorClass *) klass)->visit_sizeof_expression = (void (*) (BalaCodeVisitor*, BalaSizeofExpression*)) bala_ccode_base_module_real_visit_sizeof_expression; |
| 38375 | ((BalaCodeVisitorClass *) klass)->visit_typeof_expression = (void (*) (BalaCodeVisitor*, BalaTypeofExpression*)) bala_ccode_base_module_real_visit_typeof_expression; |
| 38376 | ((BalaCodeVisitorClass *) klass)->visit_unary_expression = (void (*) (BalaCodeVisitor*, BalaUnaryExpression*)) bala_ccode_base_module_real_visit_unary_expression; |
| 38377 | ((BalaCCodeBaseModuleClass *) klass)->deserialize_expression = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaDataType*, BalaCCodeExpression*, BalaCCodeExpression*, BalaCCodeExpression*, gboolean*)) bala_ccode_base_module_real_deserialize_expression; |
| 38378 | ((BalaCCodeBaseModuleClass *) klass)->serialize_expression = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaDataType*, BalaCCodeExpression*)) bala_ccode_base_module_real_serialize_expression; |
| 38379 | ((BalaCodeVisitorClass *) klass)->visit_cast_expression = (void (*) (BalaCodeVisitor*, BalaCastExpression*)) bala_ccode_base_module_real_visit_cast_expression; |
| 38380 | ((BalaCodeVisitorClass *) klass)->visit_named_argument = (void (*) (BalaCodeVisitor*, BalaNamedArgument*)) bala_ccode_base_module_real_visit_named_argument; |
| 38381 | ((BalaCodeVisitorClass *) klass)->visit_pointer_indirection = (void (*) (BalaCodeVisitor*, BalaPointerIndirection*)) bala_ccode_base_module_real_visit_pointer_indirection; |
| 38382 | ((BalaCodeVisitorClass *) klass)->visit_addressof_expression = (void (*) (BalaCodeVisitor*, BalaAddressofExpression*)) bala_ccode_base_module_real_visit_addressof_expression; |
| 38383 | ((BalaCodeVisitorClass *) klass)->visit_reference_transfer_expression = (void (*) (BalaCodeVisitor*, BalaReferenceTransferExpression*)) bala_ccode_base_module_real_visit_reference_transfer_expression; |
| 38384 | ((BalaCodeVisitorClass *) klass)->visit_binary_expression = (void (*) (BalaCodeVisitor*, BalaBinaryExpression*)) bala_ccode_base_module_real_visit_binary_expression; |
| 38385 | ((BalaCodeVisitorClass *) klass)->visit_type_check = (void (*) (BalaCodeVisitor*, BalaTypeCheck*)) bala_ccode_base_module_real_visit_type_check; |
| 38386 | ((BalaCodeVisitorClass *) klass)->visit_lambda_expression = (void (*) (BalaCodeVisitor*, BalaLambdaExpression*)) bala_ccode_base_module_real_visit_lambda_expression; |
| 38387 | ((BalaCCodeBaseModuleClass *) klass)->get_implicit_cast_expression = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaCCodeExpression*, BalaDataType*, BalaDataType*, BalaCodeNode*)) bala_ccode_base_module_real_get_implicit_cast_expression; |
| 38388 | ((BalaCCodeBaseModuleClass *) klass)->create_type_check_statement = (void (*) (BalaCCodeBaseModule*, BalaCodeNode*, BalaDataType*, BalaTypeSymbol*, gboolean, const gchar*)) bala_ccode_base_module_real_create_type_check_statement; |
| 38389 | ((BalaCodeVisitorClass *) klass)->visit_class = (void (*) (BalaCodeVisitor*, BalaClass*)) bala_ccode_base_module_real_visit_class; |
| 38390 | ((BalaCCodeBaseModuleClass *) klass)->generate_dynamic_method_wrapper = (void (*) (BalaCCodeBaseModule*, BalaDynamicMethod*)) bala_ccode_base_module_real_generate_dynamic_method_wrapper; |
| 38391 | ((BalaCCodeBaseModuleClass *) klass)->method_has_wrapper = (gboolean (*) (BalaCCodeBaseModule*, BalaMethod*)) bala_ccode_base_module_real_method_has_wrapper; |
| 38392 | ((BalaCCodeBaseModuleClass *) klass)->get_param_spec_cexpression = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaProperty*)) bala_ccode_base_module_real_get_param_spec_cexpression; |
| 38393 | ((BalaCCodeBaseModuleClass *) klass)->get_param_spec = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaProperty*)) bala_ccode_base_module_real_get_param_spec; |
| 38394 | ((BalaCCodeBaseModuleClass *) klass)->get_signal_creation = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaSignal*, BalaObjectTypeSymbol*)) bala_ccode_base_module_real_get_signal_creation; |
| 38395 | ((BalaCCodeBaseModuleClass *) klass)->get_value_getter_function = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaDataType*)) bala_ccode_base_module_real_get_value_getter_function; |
| 38396 | ((BalaCCodeBaseModuleClass *) klass)->get_value_setter_function = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaDataType*)) bala_ccode_base_module_real_get_value_setter_function; |
| 38397 | ((BalaCCodeBaseModuleClass *) klass)->get_value_taker_function = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaDataType*)) bala_ccode_base_module_real_get_value_taker_function; |
| 38398 | ((BalaCCodeBaseModuleClass *) klass)->register_dbus_info = (void (*) (BalaCCodeBaseModule*, BalaCCodeBlock*, BalaObjectTypeSymbol*)) bala_ccode_base_module_real_register_dbus_info; |
| 38399 | ((BalaCCodeBaseModuleClass *) klass)->get_dynamic_property_getter_cname = (gchar* (*) (BalaCCodeBaseModule*, BalaDynamicProperty*)) bala_ccode_base_module_real_get_dynamic_property_getter_cname; |
| 38400 | ((BalaCCodeBaseModuleClass *) klass)->get_dynamic_property_setter_cname = (gchar* (*) (BalaCCodeBaseModule*, BalaDynamicProperty*)) bala_ccode_base_module_real_get_dynamic_property_setter_cname; |
| 38401 | ((BalaCCodeBaseModuleClass *) klass)->get_dynamic_signal_cname = (gchar* (*) (BalaCCodeBaseModule*, BalaDynamicSignal*)) bala_ccode_base_module_real_get_dynamic_signal_cname; |
| 38402 | ((BalaCCodeBaseModuleClass *) klass)->get_dynamic_signal_connect_wrapper_name = (gchar* (*) (BalaCCodeBaseModule*, BalaDynamicSignal*)) bala_ccode_base_module_real_get_dynamic_signal_connect_wrapper_name; |
| 38403 | ((BalaCCodeBaseModuleClass *) klass)->get_dynamic_signal_connect_after_wrapper_name = (gchar* (*) (BalaCCodeBaseModule*, BalaDynamicSignal*)) bala_ccode_base_module_real_get_dynamic_signal_connect_after_wrapper_name; |
| 38404 | ((BalaCCodeBaseModuleClass *) klass)->get_dynamic_signal_disconnect_wrapper_name = (gchar* (*) (BalaCCodeBaseModule*, BalaDynamicSignal*)) bala_ccode_base_module_real_get_dynamic_signal_disconnect_wrapper_name; |
| 38405 | ((BalaCCodeBaseModuleClass *) klass)->get_array_length_cname = (gchar* (*) (BalaCCodeBaseModule*, const gchar*, gint)) bala_ccode_base_module_real_get_array_length_cname; |
| 38406 | ((BalaCCodeBaseModuleClass *) klass)->get_variable_array_length_cname = (gchar* (*) (BalaCCodeBaseModule*, BalaVariable*, gint)) bala_ccode_base_module_real_get_variable_array_length_cname; |
| 38407 | ((BalaCCodeBaseModuleClass *) klass)->get_array_length_cexpression = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaExpression*, gint)) bala_ccode_base_module_real_get_array_length_cexpression; |
| 38408 | ((BalaCCodeBaseModuleClass *) klass)->get_array_length_cvalue = (BalaCCodeExpression* (*) (BalaCCodeBaseModule*, BalaTargetValue*, gint)) bala_ccode_base_module_real_get_array_length_cvalue; |
| 38409 | ((BalaCCodeBaseModuleClass *) klass)->get_array_size_cname = (gchar* (*) (BalaCCodeBaseModule*, const gchar*)) bala_ccode_base_module_real_get_array_size_cname; |
| 38410 | ((BalaCCodeBaseModuleClass *) klass)->add_simple_check = (void (*) (BalaCCodeBaseModule*, BalaCodeNode*, gboolean)) bala_ccode_base_module_real_add_simple_check; |
| 38411 | ((BalaCCodeBaseModuleClass *) klass)->generate_ready_function = (gchar* (*) (BalaCCodeBaseModule*, BalaMethod*)) bala_ccode_base_module_real_generate_ready_function; |
| 38412 | bala_ccode_base_module_ccode_attribute_cache_index = bala_code_node_get_attribute_cache_index (); |
| 38413 | } |
| 38414 | |
| 38415 | static void |
| 38416 | bala_ccode_base_module_instance_init (BalaCCodeBaseModule * self, |
| 38417 | gpointer klass) |
| 38418 | { |
| 38419 | BalaCCodeBaseModuleEmitContext* _tmp0_; |
| 38420 | GEqualFunc _tmp1_; |
| 38421 | BalaArrayList* _tmp2_; |
| 38422 | GEqualFunc _tmp3_; |
| 38423 | BalaArrayList* _tmp4_; |
| 38424 | GHashFunc _tmp5_; |
| 38425 | GEqualFunc _tmp6_; |
| 38426 | GEqualFunc _tmp7_; |
| 38427 | BalaHashMap* _tmp8_; |
| 38428 | GHashFunc _tmp9_; |
| 38429 | GEqualFunc _tmp10_; |
| 38430 | GEqualFunc _tmp11_; |
| 38431 | BalaHashMap* _tmp12_; |
| 38432 | BalaVoidType* _tmp13_; |
| 38433 | self->priv = bala_ccode_base_module_get_instance_private (self); |
| 38434 | _tmp0_ = bala_ccode_base_module_emit_context_new (NULL((void*)0)); |
| 38435 | self->emit_context = _tmp0_; |
| 38436 | _tmp1_ = g_direct_equal; |
| 38437 | _tmp2_ = bala_array_list_new (BALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT(bala_ccode_base_module_emit_context_get_type ()), (GBoxedCopyFunc) bala_ccode_base_module_emit_context_ref, (GDestroyNotify) bala_ccode_base_module_emit_context_unref, _tmp1_); |
| 38438 | self->priv->emit_context_stack = (BalaList*) _tmp2_; |
| 38439 | self->current_line = NULL((void*)0); |
| 38440 | _tmp3_ = g_direct_equal; |
| 38441 | _tmp4_ = bala_array_list_new (BALA_TYPE_CCODE_LINE_DIRECTIVE(bala_ccode_line_directive_get_type ()), (GBoxedCopyFunc) bala_ccode_node_ref, (GDestroyNotify) bala_ccode_node_unref, _tmp3_); |
| 38442 | self->priv->line_directive_stack = (BalaList*) _tmp4_; |
| 38443 | self->next_regex_id = 0; |
| 38444 | self->priv->next_block_id = 0; |
| 38445 | _tmp5_ = g_direct_hash; |
| 38446 | _tmp6_ = g_direct_equal; |
| 38447 | _tmp7_ = g_direct_equal; |
| 38448 | _tmp8_ = bala_hash_map_new (BALA_TYPE_BLOCK(bala_block_get_type ()), (GBoxedCopyFunc) bala_code_node_ref, (GDestroyNotify) bala_code_node_unref, G_TYPE_INT((GType) ((6) << (2))), NULL((void*)0), NULL((void*)0), _tmp5_, _tmp6_, _tmp7_); |
| 38449 | self->priv->block_map = (BalaMap*) _tmp8_; |
| 38450 | _tmp9_ = g_direct_hash; |
| 38451 | _tmp10_ = g_direct_equal; |
| 38452 | _tmp11_ = g_direct_equal; |
| 38453 | _tmp12_ = bala_hash_map_new (BALA_TYPE_METHOD(bala_method_get_type ()), NULL((void*)0), NULL((void*)0), G_TYPE_INT((GType) ((6) << (2))), NULL((void*)0), NULL((void*)0), _tmp9_, _tmp10_, _tmp11_); |
| 38454 | self->priv->method_inner_error_var_count = (BalaMap*) _tmp12_; |
| 38455 | _tmp13_ = bala_void_type_new (NULL((void*)0)); |
| 38456 | self->void_type = (BalaDataType*) _tmp13_; |
| 38457 | self->in_plugin = FALSE(0); |
| 38458 | self->priv->next_variant_function_id = 0; |
| 38459 | } |
| 38460 | |
| 38461 | static void |
| 38462 | bala_ccode_base_module_finalize (BalaCodeVisitor * obj) |
| 38463 | { |
| 38464 | BalaCCodeBaseModule * self; |
| 38465 | self = G_TYPE_CHECK_INSTANCE_CAST (obj, BALA_TYPE_CCODE_BASE_MODULE, BalaCCodeBaseModule)(((BalaCCodeBaseModule*) g_type_check_instance_cast ((GTypeInstance *) (obj), ((bala_ccode_base_module_get_type ()))))); |
| 38466 | _bala_code_context_unref0 (self->priv->_context)((self->priv->_context == ((void*)0)) ? ((void*)0) : (self ->priv->_context = (bala_code_context_unref (self->priv ->_context), ((void*)0)))); |
| 38467 | _bala_code_node_unref0 (self->root_symbol)((self->root_symbol == ((void*)0)) ? ((void*)0) : (self-> root_symbol = (bala_code_node_unref (self->root_symbol), ( (void*)0)))); |
| 38468 | _bala_ccode_base_module_emit_context_unref0 (self->emit_context)((self->emit_context == ((void*)0)) ? ((void*)0) : (self-> emit_context = (bala_ccode_base_module_emit_context_unref (self ->emit_context), ((void*)0)))); |
| 38469 | _bala_iterable_unref0 (self->priv->emit_context_stack)((self->priv->emit_context_stack == ((void*)0)) ? ((void *)0) : (self->priv->emit_context_stack = (bala_iterable_unref (self->priv->emit_context_stack), ((void*)0)))); |
| 38470 | _bala_ccode_node_unref0 (self->current_line)((self->current_line == ((void*)0)) ? ((void*)0) : (self-> current_line = (bala_ccode_node_unref (self->current_line) , ((void*)0)))); |
| 38471 | _bala_iterable_unref0 (self->priv->line_directive_stack)((self->priv->line_directive_stack == ((void*)0)) ? ((void *)0) : (self->priv->line_directive_stack = (bala_iterable_unref (self->priv->line_directive_stack), ((void*)0)))); |
| 38472 | _bala_ccode_file_unref0 (self->header_file)((self->header_file == ((void*)0)) ? ((void*)0) : (self-> header_file = (bala_ccode_file_unref (self->header_file), ( (void*)0)))); |
| 38473 | _bala_ccode_file_unref0 (self->internal_header_file)((self->internal_header_file == ((void*)0)) ? ((void*)0) : (self->internal_header_file = (bala_ccode_file_unref (self ->internal_header_file), ((void*)0)))); |
| 38474 | _bala_ccode_file_unref0 (self->cfile)((self->cfile == ((void*)0)) ? ((void*)0) : (self->cfile = (bala_ccode_file_unref (self->cfile), ((void*)0)))); |
| 38475 | _bala_ccode_base_module_emit_context_unref0 (self->class_init_context)((self->class_init_context == ((void*)0)) ? ((void*)0) : ( self->class_init_context = (bala_ccode_base_module_emit_context_unref (self->class_init_context), ((void*)0)))); |
| 38476 | _bala_ccode_base_module_emit_context_unref0 (self->base_init_context)((self->base_init_context == ((void*)0)) ? ((void*)0) : (self ->base_init_context = (bala_ccode_base_module_emit_context_unref (self->base_init_context), ((void*)0)))); |
| 38477 | _bala_ccode_base_module_emit_context_unref0 (self->class_finalize_context)((self->class_finalize_context == ((void*)0)) ? ((void*)0) : (self->class_finalize_context = (bala_ccode_base_module_emit_context_unref (self->class_finalize_context), ((void*)0)))); |
| 38478 | _bala_ccode_base_module_emit_context_unref0 (self->base_finalize_context)((self->base_finalize_context == ((void*)0)) ? ((void*)0) : (self->base_finalize_context = (bala_ccode_base_module_emit_context_unref (self->base_finalize_context), ((void*)0)))); |
| 38479 | _bala_ccode_base_module_emit_context_unref0 (self->instance_init_context)((self->instance_init_context == ((void*)0)) ? ((void*)0) : (self->instance_init_context = (bala_ccode_base_module_emit_context_unref (self->instance_init_context), ((void*)0)))); |
| 38480 | _bala_ccode_base_module_emit_context_unref0 (self->instance_finalize_context)((self->instance_finalize_context == ((void*)0)) ? ((void* )0) : (self->instance_finalize_context = (bala_ccode_base_module_emit_context_unref (self->instance_finalize_context), ((void*)0)))); |
| 38481 | _bala_ccode_node_unref0 (self->param_spec_struct)((self->param_spec_struct == ((void*)0)) ? ((void*)0) : (self ->param_spec_struct = (bala_ccode_node_unref (self->param_spec_struct ), ((void*)0)))); |
| 38482 | _bala_ccode_node_unref0 (self->closure_struct)((self->closure_struct == ((void*)0)) ? ((void*)0) : (self ->closure_struct = (bala_ccode_node_unref (self->closure_struct ), ((void*)0)))); |
| 38483 | _bala_ccode_node_unref0 (self->prop_enum)((self->prop_enum == ((void*)0)) ? ((void*)0) : (self-> prop_enum = (bala_ccode_node_unref (self->prop_enum), ((void *)0)))); |
| 38484 | _bala_ccode_node_unref0 (self->signal_enum)((self->signal_enum == ((void*)0)) ? ((void*)0) : (self-> signal_enum = (bala_ccode_node_unref (self->signal_enum), ( (void*)0)))); |
| 38485 | _bala_iterable_unref0 (self->user_marshal_set)((self->user_marshal_set == ((void*)0)) ? ((void*)0) : (self ->user_marshal_set = (bala_iterable_unref (self->user_marshal_set ), ((void*)0)))); |
| 38486 | _bala_iterable_unref0 (self->predefined_marshal_set)((self->predefined_marshal_set == ((void*)0)) ? ((void*)0) : (self->predefined_marshal_set = (bala_iterable_unref (self ->predefined_marshal_set), ((void*)0)))); |
| 38487 | _bala_map_unref0 (self->priv->block_map)((self->priv->block_map == ((void*)0)) ? ((void*)0) : ( self->priv->block_map = (bala_map_unref (self->priv-> block_map), ((void*)0)))); |
| 38488 | _bala_map_unref0 (self->priv->method_inner_error_var_count)((self->priv->method_inner_error_var_count == ((void*)0 )) ? ((void*)0) : (self->priv->method_inner_error_var_count = (bala_map_unref (self->priv->method_inner_error_var_count ), ((void*)0)))); |
| 38489 | _bala_code_node_unref0 (self->void_type)((self->void_type == ((void*)0)) ? ((void*)0) : (self-> void_type = (bala_code_node_unref (self->void_type), ((void *)0)))); |
| 38490 | _bala_code_node_unref0 (self->bool_type)((self->bool_type == ((void*)0)) ? ((void*)0) : (self-> bool_type = (bala_code_node_unref (self->bool_type), ((void *)0)))); |
| 38491 | _bala_code_node_unref0 (self->char_type)((self->char_type == ((void*)0)) ? ((void*)0) : (self-> char_type = (bala_code_node_unref (self->char_type), ((void *)0)))); |
| 38492 | _bala_code_node_unref0 (self->uchar_type)((self->uchar_type == ((void*)0)) ? ((void*)0) : (self-> uchar_type = (bala_code_node_unref (self->uchar_type), ((void *)0)))); |
| 38493 | _bala_code_node_unref0 (self->unichar_type)((self->unichar_type == ((void*)0)) ? ((void*)0) : (self-> unichar_type = (bala_code_node_unref (self->unichar_type), ((void*)0)))); |
| 38494 | _bala_code_node_unref0 (self->short_type)((self->short_type == ((void*)0)) ? ((void*)0) : (self-> short_type = (bala_code_node_unref (self->short_type), ((void *)0)))); |
| 38495 | _bala_code_node_unref0 (self->ushort_type)((self->ushort_type == ((void*)0)) ? ((void*)0) : (self-> ushort_type = (bala_code_node_unref (self->ushort_type), ( (void*)0)))); |
| 38496 | _bala_code_node_unref0 (self->int_type)((self->int_type == ((void*)0)) ? ((void*)0) : (self->int_type = (bala_code_node_unref (self->int_type), ((void*)0)))); |
| 38497 | _bala_code_node_unref0 (self->uint_type)((self->uint_type == ((void*)0)) ? ((void*)0) : (self-> uint_type = (bala_code_node_unref (self->uint_type), ((void *)0)))); |
| 38498 | _bala_code_node_unref0 (self->long_type)((self->long_type == ((void*)0)) ? ((void*)0) : (self-> long_type = (bala_code_node_unref (self->long_type), ((void *)0)))); |
| 38499 | _bala_code_node_unref0 (self->ulong_type)((self->ulong_type == ((void*)0)) ? ((void*)0) : (self-> ulong_type = (bala_code_node_unref (self->ulong_type), ((void *)0)))); |
| 38500 | _bala_code_node_unref0 (self->int8_type)((self->int8_type == ((void*)0)) ? ((void*)0) : (self-> int8_type = (bala_code_node_unref (self->int8_type), ((void *)0)))); |
| 38501 | _bala_code_node_unref0 (self->uint8_type)((self->uint8_type == ((void*)0)) ? ((void*)0) : (self-> uint8_type = (bala_code_node_unref (self->uint8_type), ((void *)0)))); |
| 38502 | _bala_code_node_unref0 (self->int16_type)((self->int16_type == ((void*)0)) ? ((void*)0) : (self-> int16_type = (bala_code_node_unref (self->int16_type), ((void *)0)))); |
| 38503 | _bala_code_node_unref0 (self->uint16_type)((self->uint16_type == ((void*)0)) ? ((void*)0) : (self-> uint16_type = (bala_code_node_unref (self->uint16_type), ( (void*)0)))); |
| 38504 | _bala_code_node_unref0 (self->int32_type)((self->int32_type == ((void*)0)) ? ((void*)0) : (self-> int32_type = (bala_code_node_unref (self->int32_type), ((void *)0)))); |
| 38505 | _bala_code_node_unref0 (self->uint32_type)((self->uint32_type == ((void*)0)) ? ((void*)0) : (self-> uint32_type = (bala_code_node_unref (self->uint32_type), ( (void*)0)))); |
| 38506 | _bala_code_node_unref0 (self->int64_type)((self->int64_type == ((void*)0)) ? ((void*)0) : (self-> int64_type = (bala_code_node_unref (self->int64_type), ((void *)0)))); |
| 38507 | _bala_code_node_unref0 (self->uint64_type)((self->uint64_type == ((void*)0)) ? ((void*)0) : (self-> uint64_type = (bala_code_node_unref (self->uint64_type), ( (void*)0)))); |
| 38508 | _bala_code_node_unref0 (self->size_t_type)((self->size_t_type == ((void*)0)) ? ((void*)0) : (self-> size_t_type = (bala_code_node_unref (self->size_t_type), ( (void*)0)))); |
| 38509 | _bala_code_node_unref0 (self->string_type)((self->string_type == ((void*)0)) ? ((void*)0) : (self-> string_type = (bala_code_node_unref (self->string_type), ( (void*)0)))); |
| 38510 | _bala_code_node_unref0 (self->regex_type)((self->regex_type == ((void*)0)) ? ((void*)0) : (self-> regex_type = (bala_code_node_unref (self->regex_type), ((void *)0)))); |
| 38511 | _bala_code_node_unref0 (self->float_type)((self->float_type == ((void*)0)) ? ((void*)0) : (self-> float_type = (bala_code_node_unref (self->float_type), ((void *)0)))); |
| 38512 | _bala_code_node_unref0 (self->double_type)((self->double_type == ((void*)0)) ? ((void*)0) : (self-> double_type = (bala_code_node_unref (self->double_type), ( (void*)0)))); |
| 38513 | _bala_code_node_unref0 (self->pointer_type)((self->pointer_type == ((void*)0)) ? ((void*)0) : (self-> pointer_type = (bala_code_node_unref (self->pointer_type), ((void*)0)))); |
| 38514 | _bala_code_node_unref0 (self->gtype_type)((self->gtype_type == ((void*)0)) ? ((void*)0) : (self-> gtype_type = (bala_code_node_unref (self->gtype_type), ((void *)0)))); |
| 38515 | _bala_code_node_unref0 (self->gobject_type)((self->gobject_type == ((void*)0)) ? ((void*)0) : (self-> gobject_type = (bala_code_node_unref (self->gobject_type), ((void*)0)))); |
| 38516 | _bala_code_node_unref0 (self->gerror_type)((self->gerror_type == ((void*)0)) ? ((void*)0) : (self-> gerror_type = (bala_code_node_unref (self->gerror_type), ( (void*)0)))); |
| 38517 | _bala_code_node_unref0 (self->glist_type)((self->glist_type == ((void*)0)) ? ((void*)0) : (self-> glist_type = (bala_code_node_unref (self->glist_type), ((void *)0)))); |
| 38518 | _bala_code_node_unref0 (self->gslist_type)((self->gslist_type == ((void*)0)) ? ((void*)0) : (self-> gslist_type = (bala_code_node_unref (self->gslist_type), ( (void*)0)))); |
| 38519 | _bala_code_node_unref0 (self->gnode_type)((self->gnode_type == ((void*)0)) ? ((void*)0) : (self-> gnode_type = (bala_code_node_unref (self->gnode_type), ((void *)0)))); |
| 38520 | _bala_code_node_unref0 (self->gqueue_type)((self->gqueue_type == ((void*)0)) ? ((void*)0) : (self-> gqueue_type = (bala_code_node_unref (self->gqueue_type), ( (void*)0)))); |
| 38521 | _bala_code_node_unref0 (self->gvaluearray_type)((self->gvaluearray_type == ((void*)0)) ? ((void*)0) : (self ->gvaluearray_type = (bala_code_node_unref (self->gvaluearray_type ), ((void*)0)))); |
| 38522 | _bala_code_node_unref0 (self->gstringbuilder_type)((self->gstringbuilder_type == ((void*)0)) ? ((void*)0) : ( self->gstringbuilder_type = (bala_code_node_unref (self-> gstringbuilder_type), ((void*)0)))); |
| 38523 | _bala_code_node_unref0 (self->garray_type)((self->garray_type == ((void*)0)) ? ((void*)0) : (self-> garray_type = (bala_code_node_unref (self->garray_type), ( (void*)0)))); |
| 38524 | _bala_code_node_unref0 (self->gbytearray_type)((self->gbytearray_type == ((void*)0)) ? ((void*)0) : (self ->gbytearray_type = (bala_code_node_unref (self->gbytearray_type ), ((void*)0)))); |
| 38525 | _bala_code_node_unref0 (self->gptrarray_type)((self->gptrarray_type == ((void*)0)) ? ((void*)0) : (self ->gptrarray_type = (bala_code_node_unref (self->gptrarray_type ), ((void*)0)))); |
| 38526 | _bala_code_node_unref0 (self->gthreadpool_type)((self->gthreadpool_type == ((void*)0)) ? ((void*)0) : (self ->gthreadpool_type = (bala_code_node_unref (self->gthreadpool_type ), ((void*)0)))); |
| 38527 | _bala_code_node_unref0 (self->gquark_type)((self->gquark_type == ((void*)0)) ? ((void*)0) : (self-> gquark_type = (bala_code_node_unref (self->gquark_type), ( (void*)0)))); |
| 38528 | _bala_code_node_unref0 (self->gvalue_type)((self->gvalue_type == ((void*)0)) ? ((void*)0) : (self-> gvalue_type = (bala_code_node_unref (self->gvalue_type), ( (void*)0)))); |
| 38529 | _bala_code_node_unref0 (self->gvariant_type)((self->gvariant_type == ((void*)0)) ? ((void*)0) : (self-> gvariant_type = (bala_code_node_unref (self->gvariant_type ), ((void*)0)))); |
| 38530 | _bala_code_node_unref0 (self->mutex_type)((self->mutex_type == ((void*)0)) ? ((void*)0) : (self-> mutex_type = (bala_code_node_unref (self->mutex_type), ((void *)0)))); |
| 38531 | _bala_code_node_unref0 (self->gmutex_type)((self->gmutex_type == ((void*)0)) ? ((void*)0) : (self-> gmutex_type = (bala_code_node_unref (self->gmutex_type), ( (void*)0)))); |
| 38532 | _bala_code_node_unref0 (self->grecmutex_type)((self->grecmutex_type == ((void*)0)) ? ((void*)0) : (self ->grecmutex_type = (bala_code_node_unref (self->grecmutex_type ), ((void*)0)))); |
| 38533 | _bala_code_node_unref0 (self->grwlock_type)((self->grwlock_type == ((void*)0)) ? ((void*)0) : (self-> grwlock_type = (bala_code_node_unref (self->grwlock_type), ((void*)0)))); |
| 38534 | _bala_code_node_unref0 (self->gcond_type)((self->gcond_type == ((void*)0)) ? ((void*)0) : (self-> gcond_type = (bala_code_node_unref (self->gcond_type), ((void *)0)))); |
| 38535 | _bala_code_node_unref0 (self->gsource_type)((self->gsource_type == ((void*)0)) ? ((void*)0) : (self-> gsource_type = (bala_code_node_unref (self->gsource_type), ((void*)0)))); |
| 38536 | _bala_code_node_unref0 (self->type_module_type)((self->type_module_type == ((void*)0)) ? ((void*)0) : (self ->type_module_type = (bala_code_node_unref (self->type_module_type ), ((void*)0)))); |
| 38537 | _bala_code_node_unref0 (self->dbus_proxy_type)((self->dbus_proxy_type == ((void*)0)) ? ((void*)0) : (self ->dbus_proxy_type = (bala_code_node_unref (self->dbus_proxy_type ), ((void*)0)))); |
| 38538 | _bala_code_node_unref0 (self->gtk_widget_type)((self->gtk_widget_type == ((void*)0)) ? ((void*)0) : (self ->gtk_widget_type = (bala_code_node_unref (self->gtk_widget_type ), ((void*)0)))); |
| 38539 | _bala_code_node_unref0 (self->delegate_target_type)((self->delegate_target_type == ((void*)0)) ? ((void*)0) : (self->delegate_target_type = (bala_code_node_unref (self ->delegate_target_type), ((void*)0)))); |
| 38540 | _bala_code_node_unref0 (self->delegate_target_destroy_type)((self->delegate_target_destroy_type == ((void*)0)) ? ((void *)0) : (self->delegate_target_destroy_type = (bala_code_node_unref (self->delegate_target_destroy_type), ((void*)0)))); |
| 38541 | _bala_code_node_unref0 (self->priv->destroy_notify)((self->priv->destroy_notify == ((void*)0)) ? ((void*)0 ) : (self->priv->destroy_notify = (bala_code_node_unref (self->priv->destroy_notify), ((void*)0)))); |
| 38542 | _bala_code_node_unref0 (self->priv->gerror)((self->priv->gerror == ((void*)0)) ? ((void*)0) : (self ->priv->gerror = (bala_code_node_unref (self->priv-> gerror), ((void*)0)))); |
| 38543 | _g_free0 (self->module_init_param_name)(self->module_init_param_name = (g_free (self->module_init_param_name ), ((void*)0))); |
| 38544 | _bala_iterable_unref0 (self->wrappers)((self->wrappers == ((void*)0)) ? ((void*)0) : (self->wrappers = (bala_iterable_unref (self->wrappers), ((void*)0)))); |
| 38545 | _bala_iterable_unref0 (self->priv->generated_external_symbols)((self->priv->generated_external_symbols == ((void*)0)) ? ((void*)0) : (self->priv->generated_external_symbols = (bala_iterable_unref (self->priv->generated_external_symbols ), ((void*)0)))); |
| 38546 | BALA_CODE_VISITOR_CLASS (bala_ccode_base_module_parent_class)((((BalaCodeVisitorClass*) g_type_check_class_cast ((GTypeClass *) ((bala_ccode_base_module_parent_class)), ((bala_code_visitor_get_type ()))))))->finalize (obj); |
| 38547 | } |
| 38548 | |
| 38549 | /** |
| 38550 | * Code visitor generating C Code. |
| 38551 | */ |
| 38552 | static GType |
| 38553 | bala_ccode_base_module_get_type_once (void) |
| 38554 | { |
| 38555 | static const GTypeInfo g_define_type_info = { sizeof (BalaCCodeBaseModuleClass), (GBaseInitFunc) NULL((void*)0), (GBaseFinalizeFunc) NULL((void*)0), (GClassInitFunc) bala_ccode_base_module_class_init, (GClassFinalizeFunc) NULL((void*)0), NULL((void*)0), sizeof (BalaCCodeBaseModule), 0, (GInstanceInitFunc) bala_ccode_base_module_instance_init, NULL((void*)0) }; |
| 38556 | GType bala_ccode_base_module_type_id; |
| 38557 | bala_ccode_base_module_type_id = g_type_register_static (BALA_TYPE_CODE_GENERATOR(bala_code_generator_get_type ()), "BalaCCodeBaseModule", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); |
| 38558 | BalaCCodeBaseModule_private_offset = g_type_add_instance_private (bala_ccode_base_module_type_id, sizeof (BalaCCodeBaseModulePrivate)); |
| 38559 | return bala_ccode_base_module_type_id; |
| 38560 | } |
| 38561 | |
| 38562 | GType |
| 38563 | bala_ccode_base_module_get_type (void) |
| 38564 | { |
| 38565 | static volatile gsize bala_ccode_base_module_type_id__volatile = 0; |
| 38566 | if (g_once_init_enter (&bala_ccode_base_module_type_id__volatile)(__extension__ ({ _Static_assert (sizeof *(&bala_ccode_base_module_type_id__volatile ) == sizeof (gpointer), "Expression evaluates to false"); (void ) (0 ? (gpointer) *(&bala_ccode_base_module_type_id__volatile ) : ((void*)0)); (!(__extension__ ({ _Static_assert (sizeof * (&bala_ccode_base_module_type_id__volatile) == sizeof (gpointer ), "Expression evaluates to false"); gpointer gapg_temp_newval ; gpointer *gapg_temp_atomic = (gpointer *)(&bala_ccode_base_module_type_id__volatile ); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5) ; gapg_temp_newval; })) && g_once_init_enter (&bala_ccode_base_module_type_id__volatile )); }))) { |
| 38567 | GType bala_ccode_base_module_type_id; |
| 38568 | bala_ccode_base_module_type_id = bala_ccode_base_module_get_type_once (); |
| 38569 | g_once_init_leave (&bala_ccode_base_module_type_id__volatile, bala_ccode_base_module_type_id)(__extension__ ({ _Static_assert (sizeof *(&bala_ccode_base_module_type_id__volatile ) == sizeof (gpointer), "Expression evaluates to false"); 0 ? (void) (*(&bala_ccode_base_module_type_id__volatile) = ( bala_ccode_base_module_type_id)) : (void) 0; g_once_init_leave ((&bala_ccode_base_module_type_id__volatile), (gsize) (bala_ccode_base_module_type_id )); })); |
| 38570 | } |
| 38571 | return bala_ccode_base_module_type_id__volatile; |
| 38572 | } |
| 38573 | |
| 38574 | static void |
| 38575 | _bala_array_destroy (gpointer array, |
| 38576 | gint array_length, |
| 38577 | GDestroyNotify destroy_func) |
| 38578 | { |
| 38579 | if ((array != NULL((void*)0)) && (destroy_func != NULL((void*)0))) { |
| 38580 | gint i; |
| 38581 | for (i = 0; i < array_length; i = i + 1) { |
| 38582 | if (((gpointer*) array)[i] != NULL((void*)0)) { |
| 38583 | destroy_func (((gpointer*) array)[i]); |
| 38584 | } |
| 38585 | } |
| 38586 | } |
| 38587 | } |
| 38588 | |
| 38589 | static void |
| 38590 | _bala_array_free (gpointer array, |
| 38591 | gint array_length, |
| 38592 | GDestroyNotify destroy_func) |
| 38593 | { |
| 38594 | _bala_array_destroy (array, array_length, destroy_func); |
| 38595 | g_free (array); |
| 38596 | } |
| 38597 | |
| 38598 | static gint |
| 38599 | _bala_array_length (gpointer array) |
| 38600 | { |
| 38601 | gint length; |
| 38602 | length = 0; |
| 38603 | if (array) { |
| 38604 | while (((gpointer*) array)[length]) { |
| 38605 | length++; |
| 38606 | } |
| 38607 | } |
| 38608 | return length; |
| 38609 | } |
| 38610 |